在 Ubuntu 14.04 上锁定后阻止屏幕变黑

Raz*_*k11 6 14.04

在 Ubuntu 14.04 中,当我锁定屏幕时,它会显示我的登录屏幕并且背景很漂亮,但几秒钟后屏幕变黑。

我怎样才能阻止 Ubuntu 这样做,以便在我重新登录之前看到我的登录屏幕?

小智 3

答案实际上来自另一个问题:如何控制LightDM省电偏好?

[...]I've added a script to handle turning off the X dpms timeouts when the user logs in. Here are the three files that I've created. First, the config file:

/etc/lightdm/lightdm.conf.d/50-dpms.conf

[SeatDefaults] 
display-setup-script=/etc/lightdm/dpms-enable
session-setup-script=/etc/lightdm/dpms-disable

Make sure the above is owned by root. Easiest is to create it with sudoedit.

Next are the two scripts. These need to be owned by root and made executable (chmod +x).

/etc/lightdm/dpms-enable

#!/bin/sh

(
    # This delay is required. Might be because the X server isn't
    # started yet.
    sleep 10

    # Set up a 5 minute timeout before powering off the display.
    xset dpms 0 0 300 
) &

/etc/lightdm/dpms-disable

#!/bin/sh

(
    # This delay is required. Might be because the X server isn't
    # started yet.
    sleep 10

    # Turn off X's handling of dpms timeout. Otherwise
    # gnome-settings-daemon and gnome-screensaver will fight over it.
    xset dpms 0 0 0 
) &

Given the above, I get monitor power-down at the login screen, and the dpms timeouts are set to zero for a user session, so the screensaver works properly.
Run Code Online (Sandbox Code Playgroud)

理论上,只需将 xset dpms 的所有值设置为零,您就可以了:)