river: Generalize dual-screen wallpaper setup

Instead of checking for the specific DP-3 and DP-5 setup that my two
screens default to, we just check that two DP- monitors are connected
and set up the wallpapers on them.
This also circumvents the issue that screens receive different numbering
when disconnected and reconnected at any point.
This commit is contained in:
Marty Oehme 2023-03-03 18:29:46 +01:00
parent 0447f652cb
commit c13db186cc
Signed by: Marty
GPG Key ID: EDBF2ED917B2EF6A
1 changed files with 7 additions and 6 deletions

View File

@ -235,16 +235,17 @@ for pad in $(riverctl list-inputs | grep -i touchscreen); do
done
setxkbmap -option "compose:menu"
# set a nice wallpaper
if exist wlopm && exist swww; then
if exist swww; then
riverctl spawn "swww init"
if [ -e "$HOME/pictures/wall.jpg" ]; then
outputs=$(swww query | cut -d':' -f1)
if [ "$(echo "$outputs" | grep -c -e '^DP')" -eq 2 ] && [ -e "$HOME/pictures/wall_r.jpg" ]; then
swww img -o "$(echo "$outputs" | tail -n1)" "$HOME/pictures/wall_l.jpg"
swww img -o "$(echo "$outputs" | head -n1)" "$HOME/pictures/wall_r.jpg"
elif [ -e "$HOME/pictures/wall.jpg" ]; then
swww img "$HOME/pictures/wall.jpg"
fi
if wlopm | grep -q DP-5 && wlopm | grep -q DP-3 && [ -e "$HOME/pictures/wall_l.jpg" ] && [ -e "$HOME/pictures/wall_r.jpg" ]; then
swww img -o DP-5 "$HOME/pictures/wall_l.jpg"
swww img -o DP-3 "$HOME/pictures/wall_r.jpg"
fi
fi
# start status bar