Hot to automatically turn off screen in 5s after lock the screen by pressing shortcut

Hi, guys. I want to make Manjaro turn off screen quickly after locking screen. For example, I press Meta+L to lock screen, then the screen will be off automatically in 5 seconds but if I am using my computer not locking, the screen won’t turn off in 5 seconds.

I used to work on Windows with this feature and felt good, so I want to have it in Manjaro.

I have try to bind Meta+L to cmd xset dpms force off&xdg-screensaver lock. But it didn’t work sometimes and it is not quickly but immediately.

I have google it and get no answer so I have to post it here for help. This is my first post, if you need more information, please ask me to post it. Thank you in advance! :heart:

I am using KDE.

do you want to turn off your screen automatically after 5 seconds of inactivity?

Is wrongly writed; maybe you mean xset dpms force off && xdg-screensaver

Do you want it instant?

xdg-screensaver lock && sleep 5s && xset dpms force off
1 Like

I want to turn off my screen automatically after 5 seconds when screen is locking.

I tried your cmd but screen didn’t turn off after 5s. Same when I ran it in terminal. It just made my screen locking.

EDIT: I tried xdg-screensaver lock; sleep 5; xset dpms force off and it worked perfectly. Thank you so much.

Thank you for pointing out my mistake! I get this cmd xdg-screensaver lock; sleep 5; xset dpms force off working perfectly.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.