simplified appointment script a bit
This commit is contained in:
parent
bc1d00533a
commit
7822c0e9f1
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#Print the next appointment for the day for statusbar
|
#Print the next appointment for the day for statusbar
|
||||||
#or generate notification for upcoming appointment
|
#or generate notification for upcoming appointment
|
||||||
diff=$(calcurse --next | tail -n1 | sed 's/^\s*//; s/\[//;s/\]//' | cut -f1 -d ' ' | perl -pe 's/0([0-9])/\1/g' )
|
diff=$(calcurse --next | sed -n 's/^\s*//; s/\[//;s/\]//p' | cut -f1 -d ' ' | perl -pe 's/0([0-9])/\1/g' )
|
||||||
if [ -n "$diff" ]; then
|
if [ -n "$diff" ]; then
|
||||||
secs=$(( $(echo "$diff" | cut -f1 -d ':') * 3600 + $(echo "$diff" | cut -f2 -d ':') *60 ))
|
secs=$(( $(echo "$diff" | cut -f1 -d ':') * 3600 + $(echo "$diff" | cut -f2 -d ':') *60 ))
|
||||||
time_appointment="$(date --date "@$(( $( date +'%s' ) + $secs ))" +"%s")"
|
time_appointment="$(date --date "@$(( $( date +'%s' ) + $secs ))" +"%s")"
|
||||||
|
Loading…
Reference in New Issue
Block a user