#!/bin/bash # hours and minutes to angle # usage: hma 9 20 # int hour, int min # hma 6 # int hour # hma # take curent system time # returns int angle of hour pointer in degrees #set -x # checks command -v bc >/dev/null 2>&1 || { echo "I need bc, exiting." >&2; exit 1; } # input h="$1" m="$2" if [[ $m -eq 0 ]] ; then m="0" fi # If no user input take system hour and minute if [[ $# -eq 0 ]] ; then h="$(date +"%I")" m="$(date +"%M")" fi # action angle="$(echo "((60*$h)+$m)/2" | bc )" echo "$angle" # draw # # # # # # convert -background transparent clock.svg clock.png # img2txt -W 20 -y 20 -f utf8 clock.png