blob: dca82f397a2837ab817528af3ce88a1b7b6a60cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/bin/sh
#i3blocks calcurse module
case $BUTTON in
3)notify-send -t 5000 "$(calcurse -D ~/.config/calcurse/ -c ~/.config/calcurse/apts -a)";;
1)notify-send -t 20000 "$(calcurse -D ~/.config/calcurse/ -c ~/.config/calcurse/apts -r7)";;
2)notify-send -t 5000 "$(calcurse -D ~/.config/calcurse/ -t)"
esac
name="$(calcurse -D ~/.config/calcurse/ -c ~/.config/calcurse/apts -n | grep "\[" | sed "s/\s*\[/\[/" | cut -d ' ' -f 2-)"
[ "$name" = "" ] && echo "Nothing Scheduled" && exit 0
time="$(grep "$name" ~/.config/calcurse/apts | head -1 | cut -d ' ' -f 3)"
[ ${time%%:*} -gt 12 ] && time="$((${time%%:*}-12)):${time##*:} PM" || time="$time AM"
echo "$name @ $time"
|