“非活动时关闭屏幕”-从终端设置

Hag*_*dol 6 command-line settings

我想从终端将“不活动 x 分钟时关闭屏幕”设置(在亮度设置中)设置为“从不”,但我找不到正确的命令。

这将在可执行文件中用于更改 Ubuntu 实时安装的一些设置。

编辑:

由于更多涉及的原因,我想更改这个独立于屏幕保护程序设置的特定设置(我认为)。

Bru*_*ira 10

gsettings set org.gnome.desktop.session idle-delay 0
Run Code Online (Sandbox Code Playgroud)

将阻止您的屏幕锁定并将该设置更改为从不。

注意:关闭/重新打开设置窗口以查看命令的效果。

你在那里写的值是 Unity 决定你没有做任何事情并且屏幕应该被锁定所需的时间(以秒为单位)。


Wil*_*ilf 7

我想你可以使用这个命令:

xset s off
Run Code Online (Sandbox Code Playgroud)

xset手册页( man xset)

s       The  s  option  lets you set the screen saver parameters.  This
       option   accepts   up   to   two   numerical   parameters,    a
       'blank/noblank'  flag,  an  'expose/noexpose' flag, an 'on/off'
       flag, an 'activate/reset' flag, or the 'default' flag.   If  no
       parameters  or  the  'default' flag is used, the system will be
       set to its default screen saver characteristics.  The  'on/off'
       flags  simply  turn  the screen saver functions on or off.  The
       'activate' flag forces activation of screen saver even  if  the
       screen  saver  had  been  turned  off.  The 'reset' flag forces
       deactivation of screen saver if it is active.  The 'blank' flag
       sets  the preference to blank the video (if the hardware can do
       so) rather than display a background pattern,  while  'noblank'
       sets  the preference to display a pattern rather than blank the
       video.  The 'expose' flag sets the preference to  allow  window
       exposures  (the  server  can  freely  discard window contents),
       while 'noexpose' sets the preference to  disable  screen  saver
       unless  the  server  can regenerate the screens without causing
       exposure events.  The length  and  period  parameters  for  the
       screen  saver  function  determines how long the server must be
       inactive for screen saving  to  activate,  and  the  period  to
       change  the background pattern to avoid burn in.  The arguments
       are specified in seconds.  If only one numerical  parameter  is
       given, it will be used for the length.
Run Code Online (Sandbox Code Playgroud)

对于 Gnome 和 Unity 桌面,在关闭一段时间后关闭锁定屏幕:

gsettings set org.gnome.desktop.screensaver lock-enabled  false
Run Code Online (Sandbox Code Playgroud)

重新打开它:

gsettings set org.gnome.desktop.screensaver lock-enabled true
Run Code Online (Sandbox Code Playgroud)

您还可以设置x几分钟后屏幕将在屏幕空白后锁定,但您必须将其输入为秒(乘以 60)

gsettings set org.gnome.desktop.screensaver lock-delay "x"
Run Code Online (Sandbox Code Playgroud)

示例值为3005 分钟 - 您可以在以下 bash 行中输入分钟:

gsettings set org.gnome.desktop.screensaver lock-delay $(echo X*60 | bc)
Run Code Online (Sandbox Code Playgroud)

X以分钟为单位的数字在哪里- 似乎在 Ubuntu 13.10 中有效。

哦,禁用屏幕变暗:

gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
Run Code Online (Sandbox Code Playgroud)