aboutsummaryrefslogtreecommitdiff
path: root/bin/sway-random-bg
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2024-01-24 23:54:35 +0800
committerGuangxiong Lin <[email protected]>2024-01-24 23:54:35 +0800
commitc7ebc26a9070f7593622748c023d0a78761045c6 (patch)
tree21f12ba6b81240c95cc5f180bcf93f098d44e927 /bin/sway-random-bg
parentdcc82e4f2daa496358d2c9f378c7c873ba7d106c (diff)
downloaddotfiles-c7ebc26a9070f7593622748c023d0a78761045c6.tar.gz
dotfiles-c7ebc26a9070f7593622748c023d0a78761045c6.tar.bz2
dotfiles-c7ebc26a9070f7593622748c023d0a78761045c6.zip
Add script to help update wallpapers
Diffstat (limited to 'bin/sway-random-bg')
-rwxr-xr-xbin/sway-random-bg7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/sway-random-bg b/bin/sway-random-bg
new file mode 100755
index 0000000..bdcfd67
--- /dev/null
+++ b/bin/sway-random-bg
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+export SWAYSOCK="/run/user/$(id -u)/sway-ipc.$(id -u).$(pgrep -x sway).sock"
+
+WALLPAPER_PATH="$HOME/Pictures/wallpapers"
+
+swaymsg output '*' bg "$(find "$WALLPAPER_PATH" -type f | shuf -n 1)" fill