From 7822c0e9f12aa43bb2d878112d71bdae322538a4 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Thu, 24 Dec 2020 11:53:05 +0100 Subject: [PATCH] simplified appointment script a bit --- .local/bin/statusbar/appointments | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/appointments b/.local/bin/statusbar/appointments index 1036e2d..0789340 100755 --- a/.local/bin/statusbar/appointments +++ b/.local/bin/statusbar/appointments @@ -1,7 +1,7 @@ #!/bin/sh #Print the next appointment for the day for statusbar #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 secs=$(( $(echo "$diff" | cut -f1 -d ':') * 3600 + $(echo "$diff" | cut -f2 -d ':') *60 )) time_appointment="$(date --date "@$(( $( date +'%s' ) + $secs ))" +"%s")"