mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-08-02 01:04:26 +02:00
xss-lock: use systemctl kill instead of extracting MainPID
This commit is contained in:
parent
80cd6d2c26
commit
db92161900
1 changed files with 2 additions and 7 deletions
|
@ -20,13 +20,8 @@ case "$1" in
|
|||
;;
|
||||
dim|notify)
|
||||
echo "notify: start"
|
||||
redshift=$(systemctl --user show \
|
||||
--property MainPID \
|
||||
--value redshift@$(systemd-escape -- "$DISPLAY").service)
|
||||
[ x$redshift = x ] || {
|
||||
kill -STOP $redshift
|
||||
trap "kill -CONT $redshift" EXIT
|
||||
}
|
||||
systemctl --user kill -s STOP redshift@$(systemd-escape -- "$DISPLAY").service
|
||||
trap "systemctl --user kill -s CONT redshift@$(systemd-escape -- "$DISPLAY").service" EXIT
|
||||
trap 'echo notify: user activity; kill %% 2> /dev/null; exit 0' HUP # user activity
|
||||
trap 'echo notify: locker started; kill %% 2> /dev/null; exit 0' TERM # locker started
|
||||
outputs=($(xrandr -q | sed -n 's/\([^ ]*\) connected .*/\1/p'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue