This command will turn off the monitor on a Linux box from the command line (sorta like what happens when you have your power saving options configured to do this automatically after a length of time):
xset dpms force offThe monitor turns off until you hit a keyboard button or move the mouse. With this info you could set up a keyboard shortcut to run this command and have something like a "lock screen button" on your netbook, to turn off the display on command and conserve battery life for a little bit longer than usual.
For a "lock screen button" that also locks the screen in addition to turning it off, a pair of commands like this may be handy:
xset dpms force off; xscreensaver-command --lock
There are 17 comments on this page. Add yours.
I always forget how to do this and your page is the first one that comes up in the google search. Thanks for the simple handy tip
Hi I am trying to turn off 4 monitors at a time using the above command. It so happens that it turns off the 3 monitors except for 1 which displays RGB screensaver . Can you suggest a way out to turn off all the 4 monitors .
Simple works. Thanks for sharing!
Thanks, needed a way to do this from an "at" job in the middle of the night.
thank you very much!
in the Shower tf2 get good get lmaobox poop.
Thanks a lot! I wonder if it's simple to create a button for this...
Thanks! This was a big help...
Thanks a ton !! Very Helpful. You could write a shell script as follows and run it from the Desktop like a batch file in windows
Create a new file with text editor
#!/bin/bash xset dpms force off
Save file as .sh extension Chmod 755 to set permissions
Thank you. I created a Desktop Icon with that command to put my monitor to sleep.
Thank you! This is exactly what I was looking for. Useful short guide.
Forgot to mention for a more lightweight alternative there is i3lock. So for a black screen use xset dpms force off; i3lock -c 000000 -n
or with a background picture xset dpms force off; i3lock -i /path/to/picture/only.png -n
This is EXACTLY what I needed! And it worked beautifully! Thank you so much! =)
I needed to be able to do this remotely, and just needed to add 'display :0' to the command. So now I can ssh in and run
xset -display :0 dpms force off or just
ssh targetMachine "xset -display :0 dpms force off"
Nine years after your original post and it's still helping people.