
Turn Off Monitor
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
This simple desktop file allows you to "turn off" the monitor (put it into sleep mode) as well as turning off the backlight if you own a laptop.
To install follow these instructions:
If you want it to be an icon in a panel:
- Open the folder where you downloaded the TurnOffMonitor.desktop file
- Drag the file to the panel
If you want it to behave like a regular program that you can call from krunner (Alt+F2):
- Right click the "Application Launcher" widget (the K icon in your panel) and select "Menu Editor"
- Drag the TurnOffMonitor.desktop file to the category you choose.
If when you download the file it opens up in a new window on your browser instead of downloading to your computer, try the "Save page as..." option in your browser and save it somewhere where you can find it. Then follow the instructions above.
If you found this useful, please vote!
DigitalCookieMonster
4 years ago
#!/bin/sh
loginctl lock-session
sleep 0.5
xset dpms force off
To use this, open up notepad, copy the above code and then save it as KDE5lock.sh. Pick any name you want, just make sure it has the .sh as the file extension. Give it the permission to be executed throuh Dolphin or your prefered file manager and then either put it somewhere you can easily click on, or connect it to a keybaord shortcut. (Meta+L) is my personal preference.
Report
DigitalCookieMonster
4 years ago
Use this instead, there's no .5 second delay between the screen locking and the monitor being turned off.
#!/bin/sh
sleep 0.5
loginctl lock-session
xset dpms force off
Report
TranquilWaters
9 years ago
+1
Report
ilpianista
10 years ago
Report
Sciamano72
11 years ago
Report
tog000
11 years ago
Report
panzi
11 years ago
#!/bin/sh
sleep 0.5
xset dpms force off
And assigned it to a global hotkey ("Pause"). The sleep is needed because hitting any key turns the monitor on again and without the sleep somehow the keypress for the hotkey itself turned the monitor on again.
Report
tog000
11 years ago
One could also create the shortcut directly using khotkeys, but you should make sure the script never changes place, and i found that after every "cleanup" some things would stop working because I deleted the scripts... Adding it to the menu, moves the desktop file inside the .local folder, where its virtually impossible to accidentally delete it.
Glad you liked it, and yes, we are running the same code, different launcher :D
Report
tog000
11 years ago
One could also create the shortcut directly using [i]khotkeys[i], but you should make sure the script never changes place, and i found that after every "cleanup" some things would stop working because I deleted the scripts... Adding it to the menu, moves the desktop file inside the .local folder, where its virtually impossible to accidentally delete it.
Glad you liked it, and yes, we are running the same code, different launcher :D
Report
nicovai
11 years ago
monitor" button on the desktop.
Greetings!
Report
tog000
11 years ago
If you want it to live on your desktop, try dragging the .desktop file to the desktop! An icon will appear (thats what I call KDE4 goodness!), that you can resize and do the same things you would to a plasmoid.
There was a "turn off screen and suspend" plasmoid that I used for a while, but it was a little obtrusive to my taste because you couldn't make it smaller than 200x100px, so I opted to use this approach.
Hope you can make it work the way you intend it.
Thanks!
Report