summaryrefslogtreecommitdiff
path: root/scripts/bg.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-12-11 18:45:10 +0000
committerdavidovski <david@davidovski.xyz>2022-12-11 18:45:10 +0000
commit3739ff6661d2f51c957118a373dafcc9709219fa (patch)
tree5407aef1c733bac34203680c5697f339261dd8b9 /scripts/bg.sh
parent365412b61b6cfefac353fcce7d0bb470ee8953b0 (diff)
Updated to graphite theme
Diffstat (limited to 'scripts/bg.sh')
-rwxr-xr-xscripts/bg.sh24
1 files changed, 22 insertions, 2 deletions
diff --git a/scripts/bg.sh b/scripts/bg.sh
index e6f6999..72c612c 100755
--- a/scripts/bg.sh
+++ b/scripts/bg.sh
@@ -1,3 +1,23 @@
#!/bin/sh
-#feh --force-aliasing --bg-tile ~/.config/dither.png
-feh --force-aliasing --bg-fill ~/.config/bg
+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)
+frames_per_second=30
+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