[Powerdevil] [Bug 348529] Turn off screen after lock screen

Chris bugzilla_noreply at kde.org
Fri May 14 00:46:50 BST 2021


https://bugs.kde.org/show_bug.cgi?id=348529

Chris <inkbottle007 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |inkbottle007 at gmail.com

--- Comment #33 from Chris <inkbottle007 at gmail.com> ---
I've tried the following on debian sid with Plasma 5.21, Framework 5.82, and
most importantly Wayland:

$ cat ./kde-saver-script.sh 
#! /bin/bash
#
https://unix.stackexchange.com/questions/353998/run-script-on-screen-lock-in-kde
# Run the script in a terminal and then type Ctrl+Alt+L, and then the screen
should turn off after only 60 sec.
# Once you unlocked the screen, the turn off screen timer is set back to 600
sec.
dbus-monitor --session "type='signal',interface='org.freedesktop.ScreenSaver'"
|
  while read x; do
    case "$x" in
      *"boolean true"*)
        echo SCREEN_LOCKED;
        kwriteconfig5 --file powermanagementprofilesrc --group AC --group
DPMSControl --key idleTime 60;
        qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement
org.kde.Solid.PowerManagement.refreshStatus
        ;;
      *"boolean false"*)
        echo SCREEN_UNLOCKED;
        kwriteconfig5 --file powermanagementprofilesrc --group AC --group
DPMSControl --key idleTime 600;
        qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement
org.kde.Solid.PowerManagement.refreshStatus
        ;;
    esac
  done

And it works, very well indeed. But sometimes, even though it worked when you
left the room, when you come back you find the screen turned on, and stubbornly
refusing to turn off all by itself.
Consistency is of the essence here: save the planet, turn off the screen.

Even though it's not working, the "turn off screen" seems much more consistent
with Wayland than it was with x11.
(https://blog.martin-graesslin.com/blog/2015/09/comparing-dpms-on-x11-and-wayland/)

And maybe obvious improvements to the script could fix it.

Note that I did do `sudo systemd-inhibit --list`, when I observed the "turn
off" action was failing, but nothing stuck out. So I have no idea on what went
wrong.

However the "turn off screen" thing seems consistent without my script meddling
into it, and only the settings in "power management / energy saving". So it is
likely that the poor script above is missing some mandatory settings.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Plasma-devel mailing list