neodotfiles/source/dwmblocks/scripts/block_clock
2024-03-28 18:55:20 -04:00

31 lines
939 B
Bash
Executable file

#!/usr/bin/env bash
# ***This script was made by Clay Gomera (Drake)***
# - Description: A dwmblocks script to print the date and time
# - Dependencies: dwm, dwmblocks, date
# this variable will store the current hour of the clock
hour="$(date +%I)"
# for every hour, the clock icon will change
case "$hour" in
"01") clock_icon="󱐿";;
"02") clock_icon="󱑀";;
"03") clock_icon="󱑁";;
"04") clock_icon="󱑂";;
"05") clock_icon="󱑃";;
"06") clock_icon="󱑄";;
"07") clock_icon="󱑅";;
"08") clock_icon="󱑆";;
"09") clock_icon="󱑇";;
"10") clock_icon="󱑈";;
"11") clock_icon="󱑉";;
"12") clock_icon="󱑊";;
esac
# this variable will store the clock in the desired format
clock="$(date +%I:%M%p | sed 's/^0//')"
# this variable will store the date in the desired format
ddate="$(date +%d/%m/%y)"
echo " $clock_icon $clock | 󰸗 $ddate " # print the clock icon, the current time and then date