dot/scripts/bg.sh

28 lines
542 B
Bash
Raw Normal View History

2021-10-09 21:20:41 +00:00
#!/bin/sh
2023-10-09 16:42:22 +00:00
2024-05-04 00:15:19 +00:00
feh --no-xinerama --bg-fill ~/.config/bg.png
2023-10-09 16:42:22 +00:00
exit
2022-12-11 18:45:10 +00:00
setbg="feh --force-aliasing --bg-tile "
image=~/.config/bg.gif
dir=/tmp/bggif
printf "Converting..."
[ ! -d "$dir" ] || rm -rf "$dir"
mkdir -p "$dir"
convert -coalesce $image $dir/%05d.png
printf "done\n"
amount_of_frames=$(ls -1 "$dir" | wc -l)
2023-02-06 12:07:49 +00:00
frames_per_second=10
2022-12-11 18:45:10 +00:00
speed=$(echo "scale=3; ($amount_of_frames/$frames_per_second) * (1/$frames_per_second)" | bc -l)
while : ; do
for i in $(ls -1 $dir); do
$setbg $dir/$i;
sleep $speed
done;
done