suckless-utils/scripts/dwmblocks/sb-date
2023-09-18 19:06:23 +08:00

24 lines
799 B
Bash
Executable file

#!/bin/sh
# Displays the current time in HH:MM:SS (AM|PM)
notify() {
notify-send -a Calendar -i office-calendar-symbolic \
-h string:x-canonical-private-synchronous:"$1" "$@"
}
case $BLOCK_BUTTON in
1)
notify "This Month" "$(cal --color=always |
sed "s|..7m|<span color='$(xrdb -get color1)'>|;s|..0m|</span>|")"
appointments="$(calcurse -d1 \
--format-apt "• <i>%S - %E</i>\n <span foreground='$(xrdb -get color6)'>%m</span>\n" \
--format-event "• <span foreground='$(xrdb -get color6)'>%m</span>\n")"
[ -n "$appointments" ] && notify "Appointments" "$appointments"
;;
2) setsid -f "$TERMINAL" -e calcurse ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
. sb-theme
display "$(date '+%I:%M:%S %p')"