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

--- Comment #37 from whoopsdecade <jcdop...@gmail.com> ---
Btw, I posted a workaround here:
https://discuss.kde.org/t/custom-shortcut-to-restart-plasmashell/30482/13?u=whoopsdecade
it's ugly and I assume it won't work for some but it's allowed me to avoid
downgrading and having to manually restart plasma on each unlock.

Add /path/to/script/monitor_screen_lock.sh with content:

#!/bin/bash
dbus-monitor --session "type='signal',interface='org.freedesktop.ScreenSaver'"
|
while read -r line; do
    case "$line" in
        *"boolean true"*)
            # Screen is locked
            ;;
        *"boolean false"*)
            ## Screen is unlocked
            plasmashell --replace &
            ;;
    esac
done

chmod +x /path/to/script/monitor_screen_lock.sh

Create a systemd user service at
~/.config/systemd/user/screen_lock_monitor.service:

[Unit]
Description=Restart plasmashell on session unlock
After=graphical-session.target

[Service]
ExecStart=/path/to/script/monitor_screen_lock.sh
Restart=always
Environment=DISPLAY=:0
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus

[Install]
WantedBy=default.target

/run/user/1000/bus needs to match your user ID (id -u).

Reload the systemd user services:

systemctl --user daemon-reload

Enable the service so it starts on login:

systemctl --user enable screen_lock_monitor.service

Start the service immediately:

systemctl --user start screen_lock_monitor.service

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

Reply via email to