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

--- Comment #10 from MikeC <[email protected]> ---
After considerable trial and error, I have managed to reach a method that now
reliably turns off the hdmi connected monitor on my desktop server running Arch
Linux, when the plasma login manager (PLM) has no users logged in. The steps
needed were as follows:

1) Install hypridle

pacman -Syu hypridle

2) Create the file hypridle.conf in the newly created directory at
/var/lib/plasmalogin/.config/hypr/ with the following content:

# cat /var/lib/plasmalogin/.config/hypr/hypridle.conf

general {
ignore_dbus_inhibit = true # Bypass application locks
ignore_systemd_inhibit = true # Bypass systemd session inhibitors
ignore_wayland_inhibit = true # Bypass Wayland protocol inhibitors
inhibit_sleep = 0 # Completely disable sleep inhibition routines
}

listener {
timeout = 180 # 3 minutes
on-timeout = kscreen-doctor --dpms off # command to run when timeout is reached
on-resume = kscreen-doctor --dpms on # command to run when activity is detected
}

and ensure that the hypr directory and hypridle.conf file have owner
plasmalogin:plasmalogin

The timeout can be chosen for any desired time.

3) Make a backup copy of the wayland session file:
cd /usr/share/plasmalogin/scripts/
cp wayland-session wayland-session.bak

In the file /usr/share/plasmalogin/scripts/wayland-session add in an extra line
after the 'export SHELL ...' line, just before the last line so that the
hypridle command is executed in background, so that the last few lines of the
file become:

# Restore user shell setting that may have been clobbered by setting
environment
export SHELL=$PLASMALOGIN_USER_SHELL

# Launch the power-saving idle daemon in the background
(sleep 5 && env WAYLAND_DISPLAY=wayland-0 hypridle > /dev/null 2>&1) &

exec $@

4) Restart plasmalogin, and check the 3 minute timeout works with the screen
going blank and the monitor power turned off.  The 3 minute listener stanza
section can be changed to suit.

So now the plasma login manager greeter will powersave the hdmi connected
monitor after the three minute timeout period with no users logged in. Moving
the mouse turns the monitor back on, and normal plasma login can be achieved. 

Is it possible to include a similar set of configurations within the PLM
package itself, so that users have the benefit of the greeter being able to set
a powersave timeout, without having to implement the steps above independently
of the PLM package?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to