I think you can use this command:
xset s off
From the xset
manual page (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.
for Gnome and Unity desktops, to turn lock screen after an amount of time off:
gsettings set org.gnome.desktop.screensaver lock-enabled false
to turn it back on:
gsettings set org.gnome.desktop.screensaver lock-enabled true
You can also set x
minutes after which the screen will lock after the screen blanks, but you have to enter it as seconds (multiply by 60):
gsettings set org.gnome.desktop.screensaver lock-delay "x"
An example values are 300
for 5 minutes - you may be able to enter as minutes in the following bash line:
gsettings set org.gnome.desktop.screensaver lock-delay $(echo X*60 | bc)
Where X
is a number in minutes - seems to work in Ubuntu 13.10.
Oh, and to disable screen dimming:
gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
sudo xset s off
, but as the accepted answer explains you'll need to do a little extra work. – jobin Mar 06 '14 at 18:32