summaryrefslogtreecommitdiff
path: root/x11-themes/background-lnxpcs/files/i3background
blob: cf51581d8f165e388735154bd6c227eef71ecac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
BACKS="/usr/share/backgrounds"

if [ -n "$DISPLAY" ]; then
	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
	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 $0"
	done
fi