summaryrefslogtreecommitdiff
path: root/x11-themes/background-lnxpcs/files/swaybaground
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-01-10 15:12:56 +0100
committerKarel Kočí <cynerd@email.cz>2022-01-10 15:12:56 +0100
commit831642301a60ae371d00d5f3cf9c8c66d3fd6f83 (patch)
treebf5304500ebabc773ed759096464639640757305 /x11-themes/background-lnxpcs/files/swaybaground
parent4fd6f99ace29bff27068a21ecf3e549fadd546a6 (diff)
downloadgentoo-personal-overlay-831642301a60ae371d00d5f3cf9c8c66d3fd6f83.tar.gz
gentoo-personal-overlay-831642301a60ae371d00d5f3cf9c8c66d3fd6f83.tar.bz2
gentoo-personal-overlay-831642301a60ae371d00d5f3cf9c8c66d3fd6f83.zip
x11-themes/background-lnxpcs: add swaybackground
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