summaryrefslogtreecommitdiff
path: root/x11-themes/background-lnxpcs/files/i3background
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2018-08-10 10:45:18 +0200
committerKarel Kočí <karel.koci@nic.cz>2018-08-10 10:45:18 +0200
commitb0df64a038152e78071453475f5022b6847f81fc (patch)
treefd46ee505f72daf1aad9b9f094215884f5343e28 /x11-themes/background-lnxpcs/files/i3background
parentc85194dfbe9962b1cd7446a8cbc431fc3d9505e7 (diff)
downloadgentoo-personal-overlay-b0df64a038152e78071453475f5022b6847f81fc.tar.gz
gentoo-personal-overlay-b0df64a038152e78071453475f5022b6847f81fc.tar.bz2
gentoo-personal-overlay-b0df64a038152e78071453475f5022b6847f81fc.zip
x11-themes/background-lnxpcs: make backgrounds full hd
Diffstat (limited to 'x11-themes/background-lnxpcs/files/i3background')
-rwxr-xr-xx11-themes/background-lnxpcs/files/i3background21
1 files changed, 9 insertions, 12 deletions
diff --git a/x11-themes/background-lnxpcs/files/i3background b/x11-themes/background-lnxpcs/files/i3background
index f55f8e7..cf51581 100755
--- a/x11-themes/background-lnxpcs/files/i3background
+++ b/x11-themes/background-lnxpcs/files/i3background
@@ -1,20 +1,17 @@
#!/bin/sh
BACKS="/usr/share/backgrounds"
-# Set background
+
if [ -n "$DISPLAY" ]; then
- # Only current one
feh --randomize --no-fehbg --bg-fill "$BACKS"
+ if ! crontab -l 2>/dev/null | grep -q i3background; then
+ TCRN="$(mktemp)"
+ crontab -l 2>/dev/null > "$TCRN"
+ echo "* * * * * i3background" >> "$TCRN"
+ crontab "$TCRN"
+ rm "$TCRN"
+ fi
else
- # All instances
for socket in $(find /run/user/$(id -u)/i3 /tmp/i3-$(id -un).* -name ipc-socket\* 2>/dev/null); do
- i3-msg -s $socket "exec feh --randomize --no-fehbg --bg-fill '$BACKS'"
+ i3-msg -s $socket "exec $0"
done
fi
-# Set cron
-if ! crontab -l 2>/dev/null | grep -q i3background; then
- TCRN="$(mktemp)"
- crontab -l 2>/dev/null > "$TCRN"
- echo "* * * * * i3background" >> "$TCRN"
- crontab "$TCRN"
- rm "$TCRN"
-fi