First of all, I'm aware a similar question for GNOME is asked here: "Switch off laptop backlight when locking screen".
Objective
I would like to turn off my screen on locking the session for power saving reasons.
Actual problem
Locking the screen on Kubuntu (KDE) inevitably triggers the screensaver as far as I can see. There's no screensaver option other than 'Blank screen' together with its background colour set to black that comes just close to my goal. It blanks the screen, but doesn't turn off the screen. Screen's backlight will still be on and not saving any power.
Current workaround
A workaround via a script + shortcut key is possible, however, it's just a workaround since it doesn't trigger on all ways to lock the session. Therefore, I think it should be possible to have it done more elegantly, for example by providing this option in KDE's configuration dialog of the screensaver.
The workaround I am now using is the following. A script that locks the screen and turns off the screen:
#!/bin/bash
qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
xset dpms force standby
and let it run with a shortcut key via a custom menu entry. It works.
Here's why I consider it to be a workaround rather than a solution. It doesn't work for other ways to trigger the locking of the session.
My actual question(s)
Do I need to touching/patching KDE's source?
- If not what are my options?
- If so,
- could someone point me to where I can get started?
- what do you think is the recommended place in the GUI for configuration?
I'm using Kubuntu 12.04 and willing to upgrade to KDE 4.9 or waiting for the 12.10 release.
xset dpms force standby
seems to be very reliable and doesn't need thesleep 1 ; xset dpms force off
trick. – Alan Thompson Sep 17 '15 at 04:00sleep 1
is just so that if you're using a mouse to click a button, you have time to let go of the mouse and it to stop moving before the display turns off. Otherwise, it can wake up the display instantly, which might mean you need to enter your password before you can lock the display again. Not sure where I recommended usingsleep 1
, though. – SomeoneSomewhereSupportsMonica Sep 18 '15 at 05:54