summaryrefslogtreecommitdiff
path: root/.local/bin/makewall
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-08-05 19:30:47 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2024-08-05 19:30:47 -0400
commit9ebf91e892cbafbf03d09f3adca652db181d1587 (patch)
tree299f0a362d3ad0f7be8757c7b3cbd2ee715b65cc /.local/bin/makewall
parentda5ef3b9e22e11192279f0becaa0c8c35b7ff929 (diff)
Wayland migration (first of many)
Diffstat (limited to '.local/bin/makewall')
-rwxr-xr-x.local/bin/makewall13
1 files changed, 10 insertions, 3 deletions
diff --git a/.local/bin/makewall b/.local/bin/makewall
index ad8fc02..9edd3c2 100755
--- a/.local/bin/makewall
+++ b/.local/bin/makewall
@@ -1,9 +1,14 @@
#!/bin/sh
+# NOTE: (for wayland migration)
+# wlr-randr --json | jq -r '.[] | select(.enabled) | .name'
+
wallDir="$XDG_CONFIG_HOME/wallpapers"
# Acquire the list of connected displays
-displays=$(xrandr | grep " connected" | sed 's/^\([a-Z,0-9,-]*\).*/\1/')
+# displays=$(xrandr | grep " connected" | sed 's/^\([a-Z,0-9,-]*\).*/\1/')
+displays="$(wlr-randr --json | jq -r '.[] | select(.enabled) | .name')"
+echo "$displays"
# If there is a wallpaper with a filename matching the display
# name, set it as the wallpaper for that display.
@@ -14,16 +19,18 @@ setDisplay() {
case $(ls $wallDir) in
*"$1"*)
wall=$(ls $wallDir | grep "$1" | head -n 1)
- xwallpaper --output $1 --zoom $wallDir/$wall
+ # xwallpaper --output $1 --zoom $wallDir/$wall
;;
*)
wall=$(ls $wallDir | grep "default" | head -n 1)
- xwallpaper --output $1 --zoom $wallDir/$wall
+ # xwallpaper --output $1 --zoom $wallDir/$wall
;;
esac
+ swaybg --output $1 -m fill --image $wallDir/$wall &
}
# Set the wallpaper for each display
+killall swaybg > /dev/null 2>&1
for display in $displays; do
setDisplay $display
done