Jump to content

How can I turn off display sooner when lock screen is active ? (Linux Mint)

Go to solution Solved by Sauron,

Cinnamon and gnome based desktops in general do not offer this functionality natively, simply because the power manager keeps track of the idle timer independently from the lock screen functionality. You could modify the source code, but I doubt this is what you're interested in. A quicker, more jerry-rigged solution is to bind a keyboard shortcut to a script that will lock your screen and turn it off at the same time or with a given delay.

 

Open your keyboard shortcut settings and create a new binding for whichever key combination you prefer. Then, assign it to this command:

bash -c "cinnamon-screensaver-command -l; xset dpms force off;"

which will tell bash (the default command line shell/interpreter) to, in order, lock the screen and turn off the screen. If you wish for it to wait some time before turning off the screen you'll need to place a call to "sleep" with the desired number of seconds before the call to "xset", like so:

bash -c "cinnamon-screensaver-command -l; sleep 30; xset dpms force off;"

using the number of seconds you want it to wait instead of 30.

Can't seem to find this info online.
cause like on windows the screen would turn off ~30 seconds after lock. but here it keeps the same timeout option as if it were unlocked.

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Which DE are you using? Is it cinnamon or something else?

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Sauron said:

Which DE are you using? Is it cinnamon or something else?

cinnamon yea

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Cinnamon and gnome based desktops in general do not offer this functionality natively, simply because the power manager keeps track of the idle timer independently from the lock screen functionality. You could modify the source code, but I doubt this is what you're interested in. A quicker, more jerry-rigged solution is to bind a keyboard shortcut to a script that will lock your screen and turn it off at the same time or with a given delay.

 

Open your keyboard shortcut settings and create a new binding for whichever key combination you prefer. Then, assign it to this command:

bash -c "cinnamon-screensaver-command -l; xset dpms force off;"

which will tell bash (the default command line shell/interpreter) to, in order, lock the screen and turn off the screen. If you wish for it to wait some time before turning off the screen you'll need to place a call to "sleep" with the desired number of seconds before the call to "xset", like so:

bash -c "cinnamon-screensaver-command -l; sleep 30; xset dpms force off;"

using the number of seconds you want it to wait instead of 30.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

25 minutes ago, Sauron said:

Cinnamon and gnome based desktops in general do not offer this functionality natively, simply because the power manager keeps track of the idle timer independently from the lock screen functionality. You could modify the source code, but I doubt this is what you're interested in. A quicker, more jerry-rigged solution is to bind a keyboard shortcut to a script that will lock your screen and turn it off at the same time or with a given delay.

 

Open your keyboard shortcut settings and create a new binding for whichever key combination you prefer. Then, assign it to this command:


bash -c "cinnamon-screensaver-command -l; xset dpms force off;"

which will tell bash (the default command line shell/interpreter) to, in order, lock the screen and turn off the screen. If you wish for it to wait some time before turning off the screen you'll need to place a call to "sleep" with the desired number of seconds before the call to "xset", like so:


bash -c "cinnamon-screensaver-command -l; sleep 30; xset dpms force off;"

using the number of seconds you want it to wait instead of 30.

Thank you very much, this works perfectly with the desired effect. 

 

what is the xset and dpms, parts of the command do.

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, Arty said:

Thank you very much, this works perfectly with the desired effect. 

 

what is the xset and dpms, parts of the command do.

xset is an xorg utility, it allows you to control the behaviour of some screen related services, particularly dpms (the screen energy saving service) to turn the screen on or off and specify how long to wait before either happens. "force off" turns the screen off instantly.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×