7

I can turn off the monitor and lock the screen manually with cinnamon-screensaver-command -l && xset dpms force off.

However, if I try to put that command as a custom shortcut in Keyboard->shortcuts, the monitor doesn't turn off, and if I switch the order then nothing happens.

How can I get a shortcut to fire both commands?

3
  • Try it in terminal first, it is easier to check whether it works then. you may also want to try: cinnamon-screensaver-command -l & xset dpms force off and gnome-screensaver-command -l && xset dpms force off.
    – Wilf
    Jan 5, 2014 at 21:10
  • @wilf Thank you for looking wilf! It does work in terminal as expected. It doesn't as a keyboard shortcut. Would it make a difference if it were in a bash script? Thank you in advance!
    – user128334
    Jan 5, 2014 at 22:00
  • 4
    The default shortcut is Ctrl+Alt+L
    – manuc66
    Dec 8, 2017 at 15:52

1 Answer 1

12

It might work if you did it like this in the keyboard shortcut settings::

bash -c "cinnamon-screensaver-command -l; xset dpms force off;"
1
  • Glad to be of help :-)
    – Wilf
    Jan 5, 2014 at 23:12

You must log in to answer this question.