-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathbgclock
More file actions
executable file
·25 lines (24 loc) · 844 Bytes
/
bgclock
File metadata and controls
executable file
·25 lines (24 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
# keeps running and update the wallpaper image with the current
# time, also calls ~/.fehbg to re-apply new wallpaper.
# creates .fehbg if doesn't exist.
# this script will only work if fehbg is configured correctly or absent,
# script will respect pre-existing .fehbg and not change it
# setting any other image as wallpaper will render this useless
originalimagefile="$1"
if [ -z "$1" ]; then
originalimagefile="${HOME}/.config/wall/wall"
fi
if [ ! -r "$originalimagefile" ]; then
echo -e "usage\n $(basename "$0") [src] [dest]"
echo -e "$originalimagefile does not exist"
exit 1
fi
outputimagefile="${2:-${HOME}/.config/wall/wall_clock}"
while true; do
imgclock "$originalimagefile" "$outputimagefile"
if [ ! -r "${HOME}"/.fehbg ]; then feh --bg-fill "$outputimagefile"
else "${HOME}"/.fehbg
fi
sleep 0.1
done