wallpaper: use a per-display wallpaper

Just to be coherent with having a per-display service and timer.
This commit is contained in:
Vincent Bernat 2020-02-07 09:58:02 +01:00
parent e3ad1d73f0
commit a42edf621a
2 changed files with 7 additions and 6 deletions

View file

@ -3,6 +3,7 @@
me="$(readlink -f "$0")"
timeout=300
notify=10
display=$(systemd-escape -- "$DISPLAY")
configure() {
xset s $((timeout - notify)) $notify
@ -20,8 +21,8 @@ case "$1" in
;;
dim|notify)
echo "notify: start"
systemctl --user kill -s STOP redshift@$(systemd-escape -- "$DISPLAY").service
trap "systemctl --user kill -s CONT redshift@$(systemd-escape -- "$DISPLAY").service" EXIT
systemctl --user kill -s STOP redshift@${display}.service
trap "systemctl --user kill -s CONT redshift@${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 --current | sed -n 's/\([^ ]*\) connected .*/\1/p'))
@ -39,9 +40,9 @@ case "$1" in
xdotool key XF86AudioStop
# Then, lock screen
echo "lock: lock screen"
systemctl --user stop compton@$(systemd-escape -- "$DISPLAY").service
i3lock -n -e -i $HOME/.cache/awesome/current-wallpaper.png -t -f
systemctl --user start compton@$(systemd-escape -- "$DISPLAY").service
systemctl --user stop compton@${display}.service
i3lock -n -e -i $HOME/.cache/awesome/current-wallpaper-${display}.png -t -f
systemctl --user start compton@${display}.service
echo "lock: unlock screen"
;;
esac

View file

@ -5,7 +5,7 @@ PartOf=graphical-session@%i.target
[Service]
Environment=DISPLAY=%I
Environment=WALLPAPER_DIRECTORY=%h/.config/awesome/wallpapers
Environment=WALLPAPER_OUTPUT=%h/.cache/awesome/current-wallpaper.png
Environment=WALLPAPER_OUTPUT=%h/.cache/awesome/current-wallpaper-%i.png
ExecStart=%h/.config/awesome/bin/build-wallpaper --crop \
--directory $WALLPAPER_DIRECTORY \
--target $WALLPAPER_OUTPUT