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:
parent
0447f652cb
commit
c13db186cc
1 changed files with 7 additions and 6 deletions
|
@ -235,16 +235,17 @@ for pad in $(riverctl list-inputs | grep -i touchscreen); do
|
||||||
done
|
done
|
||||||
|
|
||||||
setxkbmap -option "compose:menu"
|
setxkbmap -option "compose:menu"
|
||||||
|
|
||||||
# set a nice wallpaper
|
# set a nice wallpaper
|
||||||
if exist wlopm && exist swww; then
|
if exist swww; then
|
||||||
riverctl spawn "swww init"
|
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"
|
swww img "$HOME/pictures/wall.jpg"
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
# start status bar
|
# start status bar
|
||||||
|
|
Loading…
Reference in a new issue