mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-08-14 06:48:31 +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)
|
dim|notify)
|
||||||
echo "notify: start"
|
echo "notify: start"
|
||||||
redshift=$(systemctl --user show \
|
systemctl --user kill -s STOP redshift@$(systemd-escape -- "$DISPLAY").service
|
||||||
--property MainPID \
|
trap "systemctl --user kill -s CONT redshift@$(systemd-escape -- "$DISPLAY").service" EXIT
|
||||||
--value redshift@$(systemd-escape -- "$DISPLAY").service)
|
|
||||||
[ x$redshift = x ] || {
|
|
||||||
kill -STOP $redshift
|
|
||||||
trap "kill -CONT $redshift" EXIT
|
|
||||||
}
|
|
||||||
trap 'echo notify: user activity; kill %% 2> /dev/null; exit 0' HUP # user activity
|
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
|
trap 'echo notify: locker started; kill %% 2> /dev/null; exit 0' TERM # locker started
|
||||||
outputs=($(xrandr -q | sed -n 's/\([^ ]*\) connected .*/\1/p'))
|
outputs=($(xrandr -q | sed -n 's/\([^ ]*\) connected .*/\1/p'))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue