From 1ab2b3a94fc182eb6be2f6ff39bc626025e6d476 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 14 Feb 2025 10:26:02 +0100 Subject: [PATCH] river: Change to swaybg for stable wallpaper setting Multi-output wallpaper setting was never particularly stable using swww. Using swaybg we can directly call on the 'description' of the outputs like we do in kanshi. This makes the interface way more stable than hoping that 'DP-3' and or 'DP-5' are discovered first. Thus, we default to use swaybg and my screens, but if the program is not found on the system we can still fall back to swww. --- desktop/.config/river/init | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index d7b86d1..f60427b 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -270,12 +270,18 @@ setxkbmap -option "compose:menu" [ "$(pidof kanshi)" -eq 0 ] || riverctl spawn kanshi # set a nice wallpaper -if exist swww; then - riverctl spawn "swww init" +if exist swaybg; then + killall swaybg + riverctl spawn "swaybg \ + -o 'LG Electronics W2442 0x000574E1' -i pictures/wall_l.jpg \ + -o 'LG Electronics W2442 0x000574FD' -i pictures/wall_r.jpg \ + " +elif exist swww; then + riverctl spawn "swww-daemon" 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" | head -n1)" "$HOME/pictures/wall_r.jpg" - swww img -o "$(echo "$outputs" | tail -n1)" "$HOME/pictures/wall_l.jpg" + swww img -o "$(echo "$outputs" | head -n1)" "$HOME/pictures/wall_l.jpg" + swww img -o "$(echo "$outputs" | tail -n1)" "$HOME/pictures/wall_r.jpg" elif [ -e "$HOME/pictures/wall.jpg" ]; then swww img "$HOME/pictures/wall.jpg" fi