From cc567a7a1f92e501c34ad8761b923fc7bc8ef4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 9 Aug 2018 12:11:49 +0200 Subject: Add x11-themes/background package --- x11-themes/background-lnxpcs/files/i3background | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 x11-themes/background-lnxpcs/files/i3background (limited to 'x11-themes/background-lnxpcs/files/i3background') 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 -- cgit v1.2.3