summaryrefslogtreecommitdiff
path: root/x11-themes/background-lnxpcs/files/swaybaground
diff options
context:
space:
mode:
Diffstat (limited to 'x11-themes/background-lnxpcs/files/swaybaground')
-rwxr-xr-xx11-themes/background-lnxpcs/files/swaybaground9
1 files changed, 9 insertions, 0 deletions
diff --git a/x11-themes/background-lnxpcs/files/swaybaground b/x11-themes/background-lnxpcs/files/swaybaground
new file mode 100755
index 0000000..0bc42be
--- /dev/null
+++ b/x11-themes/background-lnxpcs/files/swaybaground
@@ -0,0 +1,9 @@
+#!/bin/sh
+BACKS="/usr/share/backgrounds"
+
+if [ -n "$WAYLAND_DISPLAY" ]; then
+ swaymsg output '*' background "$(find "$BACKS" -type f | shuf -n 1)" fill
+else
+ find "/run/user/$(id -u)/" -name "sway-ipc*" \
+ -exec swaymsg -s {} "exec $0" +
+fi