summaryrefslogtreecommitdiff
path: root/x11-themes/background-lnxpcs/files/swaybackground
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-01-10 15:33:08 +0100
committerKarel Kočí <cynerd@email.cz>2022-01-10 15:33:33 +0100
commit76b8c5a0cf595e4c6ca133073e026f2e1d797b06 (patch)
tree9caf992feaa84813d2535fffe870dd8bde7e1d42 /x11-themes/background-lnxpcs/files/swaybackground
parent831642301a60ae371d00d5f3cf9c8c66d3fd6f83 (diff)
downloadgentoo-personal-overlay-76b8c5a0cf595e4c6ca133073e026f2e1d797b06.tar.gz
gentoo-personal-overlay-76b8c5a0cf595e4c6ca133073e026f2e1d797b06.tar.bz2
gentoo-personal-overlay-76b8c5a0cf595e4c6ca133073e026f2e1d797b06.zip
x11-themes/background-lnxpcs: fix invalid file name
Diffstat (limited to 'x11-themes/background-lnxpcs/files/swaybackground')
-rwxr-xr-xx11-themes/background-lnxpcs/files/swaybackground9
1 files changed, 9 insertions, 0 deletions
diff --git a/x11-themes/background-lnxpcs/files/swaybackground b/x11-themes/background-lnxpcs/files/swaybackground
new file mode 100755
index 0000000..0bc42be
--- /dev/null
+++ b/x11-themes/background-lnxpcs/files/swaybackground
@@ -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