summaryrefslogtreecommitdiff
path: root/x11-themes/background-lnxpcs/files/i3background
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2018-08-09 12:11:49 +0200
committerKarel Kočí <karel.koci@nic.cz>2018-08-09 12:11:49 +0200
commitcc567a7a1f92e501c34ad8761b923fc7bc8ef4f8 (patch)
tree8931548e1fa0d4e799da1c1acc25f92637aec5ca /x11-themes/background-lnxpcs/files/i3background
parent4359ab521743fe86b7e2f5f6059bb9671c2934f2 (diff)
downloadgentoo-personal-overlay-cc567a7a1f92e501c34ad8761b923fc7bc8ef4f8.tar.gz
gentoo-personal-overlay-cc567a7a1f92e501c34ad8761b923fc7bc8ef4f8.tar.bz2
gentoo-personal-overlay-cc567a7a1f92e501c34ad8761b923fc7bc8ef4f8.zip
Add x11-themes/background package
Diffstat (limited to 'x11-themes/background-lnxpcs/files/i3background')
-rwxr-xr-xx11-themes/background-lnxpcs/files/i3background21
1 files changed, 21 insertions, 0 deletions
diff --git a/x11-themes/background-lnxpcs/files/i3background b/x11-themes/background-lnxpcs/files/i3background
new file mode 100755
index 0000000..faec41e
--- /dev/null
+++ b/x11-themes/background-lnxpcs/files/i3background
@@ -0,0 +1,21 @@
+#!/bin/sh
+BACKS="/usr/share/backgrounds"
+BACKS="/home/cynerd/src/lnxpcs/walls/solarized-dark"
+# Set background
+if [ -n "$DISPLAY" ]; then
+ # Only current one
+ feh --randomize --no-fehbg --bg-center "$BACKS"
+else
+ # All instances
+ for socket in `find /tmp/i3-* -name ipc-socket\*`; do
+ i3-msg -s $socket "exec feh --randomize --no-fehbg --bg-center '$BACKS'"
+ done
+fi
+# Set cron
+if ! crontab -l | grep -q i3background; then
+ TCRN="$(mktemp)"
+ crontab -l > "$TCRN"
+ echo "* * * * * i3background" >> "$TCRN"
+ crontab "$TCRN"
+ rm "$TCRN"
+fi