aboutsummaryrefslogtreecommitdiff
path: root/.config/polybar/scripts/date-time.sh
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2025-10-07 21:04:07 +0100
committerJustine Smithies <justine@smithies.me.uk>2025-10-07 21:04:07 +0100
commitb417b248c874cba7ddf6ded78273df584a81931d (patch)
tree8dd5706b4423703d1ce692b8e5af32ba75598587 /.config/polybar/scripts/date-time.sh
parent258e1d9f7797b64e8b459b6436f8aaaf72a6f787 (diff)
Initial commit
Diffstat (limited to '.config/polybar/scripts/date-time.sh')
-rwxr-xr-x.config/polybar/scripts/date-time.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/.config/polybar/scripts/date-time.sh b/.config/polybar/scripts/date-time.sh
new file mode 100755
index 0000000..a84d54c
--- /dev/null
+++ b/.config/polybar/scripts/date-time.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+DaySuffix() {
+ case $day in
+ 1|21|31) echo "st";;
+ 2|22) echo "nd";;
+ 3|23) echo "rd";;
+ *) echo "th";;
+ esac
+}
+
+day=$(date +%d | sed 's/^0*//')
+text=$(date "+%A $day$(DaySuffix) %B %Y - %H:%M")
+
+echo "$text "