dotfiles/.local/bin/set_wall_clock
2024-03-05 23:19:26 +01:00

22 lines
686 B
Bash
Executable file

#!/bin/bash -e
if [[ -f /tmp/output.png ]]
then
feh --no-fehbg --bg-center /tmp/output.png
fi
cd ~/Images/clocks/Current/
date="date -d now+1minute"
month=$($date +%-m)
day=$($date +%-d)
weekday=$($date +%-u)
hour=$(( ($($date +%-H)%12)*5 + $($date +%-M)/12))
minute=$($date +%-M)
# Avec jour de la semaine
convert "bg.jpg" "month${month}.png" -composite "day${day}.png" -composite "weekday${weekday}.png" -composite "hour${hour}.png" -composite "minute${minute}.png" -composite "/tmp/output.png"
# Sans jour de la semaine
#convert "bg.jpg" "month${month}.png" -composite "day${day}.png" -composite "hour${hour}.png" -composite "minute${minute}.png" -composite "/tmp/output.png"