diff options
Diffstat (limited to '.config/polybar/scripts')
-rwxr-xr-x | .config/polybar/scripts/calendar.sh | 26 | ||||
-rwxr-xr-x | .config/polybar/scripts/date-time.sh | 14 |
2 files changed, 40 insertions, 0 deletions
diff --git a/.config/polybar/scripts/calendar.sh b/.config/polybar/scripts/calendar.sh new file mode 100755 index 0000000..08f84e5 --- /dev/null +++ b/.config/polybar/scripts/calendar.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Calendar script + +ShowCalendar() { + notify-send -a "Calendar" --hint string:x-canonical-private-synchronous:calendar " Calendar" "$(cal | sed "s/\<$(date +%d | sed 's/^0*//')\>/<big><b>$(date +%d | sed 's/^0*//')<\/b><\/big>/")" +} + +EditCalendar() { + echo +} + +case "$1" in + show) + ShowCalendar + ;; + + edit) + EditCalendar + ;; + + *) + echo $"Usage: ${0##*/} {show|edit}" + exit 1 + +esac 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 " |