mirror of
https://github.com/The-Repo-Club/DotFiles.git
synced 2025-02-07 04:54:18 -05:00
59 lines
981 B
Bash
Executable File
59 lines
981 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
DaySuffix() {
|
|
if [ "x$(date +%-d | cut -c2)x" = "xx" ]; then
|
|
DayNum=$(date +%-d)
|
|
else
|
|
DayNum=$(date +%-d | cut -c2)
|
|
fi
|
|
|
|
CheckSpecialCase=$(date +%-d)
|
|
case $DayNum in
|
|
0)
|
|
echo "th"
|
|
;;
|
|
1)
|
|
if [ "$CheckSpecialCase" = "11" ]; then
|
|
echo "th"
|
|
else
|
|
echo "st"
|
|
fi
|
|
;;
|
|
2)
|
|
if [ "$CheckSpecialCase" = "12" ]; then
|
|
echo "th"
|
|
else
|
|
echo "nd"
|
|
fi
|
|
;;
|
|
3)
|
|
if [ "$CheckSpecialCase" = "13" ]; then
|
|
echo "th"
|
|
else
|
|
echo "rd"
|
|
fi
|
|
;;
|
|
[4-9])
|
|
echo "th"
|
|
;;
|
|
*)
|
|
return 1
|
|
;;
|
|
esac
|
|
}
|
|
|
|
clock() {
|
|
# load colors
|
|
. ~/.config/repobar/bar_themes/minimal-mistakes
|
|
|
|
icon_date=" "
|
|
icon_time=" "
|
|
|
|
date=$(date +" %-d$(DaySuffix) %b %Y")
|
|
time=$(date +" %I:%M %P")
|
|
|
|
printf " %s %s %s %s \n" "^c$Foreground^^b$Green^$icon_date" "^c$Foreground^^b$Green_Bright^ $date" "^c$Foreground^^b$Green^$icon_time" "^c$Foreground^^b$Green_Bright^ $time"
|
|
}
|
|
|
|
clock
|