



Actual problem


Current workaround




qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
xset dpms force standby



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?



Found a way for KDE 4 (up to Ubuntu 14.10). For modern KDE 5 see other answer.

  1. Go to System SettingsApplication and System NotificationsManage Notifications.

  2. Select Screen Saver as the Event Source

  3. Locate and select the Screen Locked

  4. add this command to the event:

     xset dpms force off

enter image description here

It will turn off all displays every time it gets locked.

| improve this answer | |
  • For Kubuntu 15.04 users - this approach appears hit a bug in which KDE daemon crashes completely, taking the whole session with it... :-( – gertvdijk Jul 26 '15 at 17:00
  • @gertvdijk Hmm. Might have to check that - I'm still on 14.04, and it's working for me. Though I've slowly expanded this to about half a dozen different things that happens when I lock/unlock. – SomeoneSomewhereSupportsMonica Jul 28 '15 at 6:22
  • xset dpms force standby seems to be very reliable and doesn't need the sleep 1 ; xset dpms force off trick. – Alan Thompson Sep 17 '15 at 4:00
  • @AlanThompson, the sleep 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 using sleep 1, though. – SomeoneSomewhereSupportsMonica Sep 18 '15 at 5:54

Confirmed: running the command: /bin/sleep 1 ; /usr/bin/xset dpms force off within the screen locked notification works for Plasmashell 5.10.

Go to: System Settings > Notifications > Event source "Screen Saver":

Notifications -- System Settings

| improve this answer | |

As of KDE 5, most of the solutions here no longer work.

Here's what I found that works though (as of 2016-09-28), create a text document and in it copy and paste the following code:

sleep 0.5
loginctl lock-session
xset dpms force off

and then save it as "KDE5lockscreenanddpms.sh" The name doesn't matter, just make sure you have the .sh at the end of it. Then navigate to where you saved with your file manager, right click on it and open up properties>permissions> and make it executable.

Now you can click on it and it will run the script which will lock your screen and then after .5 seconds will turn your monitor(s) off.

Here are some posts with the info about these commands.

KDE.org- loginctl lock-session

Linux-apps.com - sleep 0.5 xset dpms force off

| improve this answer | |


Following is outline

  1. Disable KDE screen saver

    2. Uncheck Start automatically after
  2. Install xscreensaver

    sudo apt-get install xscreensaver

  3. Create ~/.kde/Autostart/xscreensaver.desktop

    Add following lines into it

    [Desktop Entry]
  4. Replace KDE lock screen

    cd /usr/lib/kde4/libexec
    sudo mv kscreenlocker kscreenlocker.original
    sudo vim kscreenlocker

    Add following lines into kscreenlocker

    xscreensaver-command -lock

    Configure DPMS in Advance tab. The minimum standby is 1min.



| improve this answer | |

With KDE Plasma 5.18, it is a little bit different from this comment.

Search for Notification via Super and follow the screenshots below:


Notifications - Application Settings

Configure Notifications - System Settings Module

I used /bin/sleep 5; /usr/bin/xset dpms force off instead of 1, but that's up to you.

| improve this answer | |

Kde5 and XScreenSaver(5.34) : click on tab complex Advance , then activate energy management by ticking it and set the minutes in power-off to your like (or use even quick power-off).

| improve this answer | |
  • Hmm, I'm missing something perhaps... How to get to a window that has the "complex" tab? – gertvdijk Nov 22 '16 at 12:47
  • Did you mean to comment this to the other XScreensaver answer perhaps? askubuntu.com/a/232844/88802 – gertvdijk Nov 22 '16 at 12:50
  • 1
    The OP is 4 years old and KDE version is < 4.9. Your answer should address the differences. – WinEunuuchs2Unix Nov 22 '16 at 12:51
  • My kde is in German and "Komplex" seems to be "Advance" in English version. Also, it's debian, not ubuntu. Should I delete my answer? – dr0i Nov 28 '16 at 15:37


| improve this answer | |
  • 5
    Can you explain how this works and what it does? – Kaz Wolfe Aug 31 '14 at 3:16

On Kubuntu 14.04, simply go System Setting - Power Mgmt. - turn off Dim Screen and Screen Energy Saving under Energy Saving tab.


| improve this answer | |
  • And then what? It does not turn off my screen (DPMS) when locking. So it does not answer my question. – gertvdijk Nov 25 '15 at 16:30

Your Answer

