summaryrefslogtreecommitdiff
path: root/.local/bin/statusbar/timeinfo
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/statusbar/timeinfo')
-rwxr-xr-x.local/bin/statusbar/timeinfo15
1 files changed, 14 insertions, 1 deletions
diff --git a/.local/bin/statusbar/timeinfo b/.local/bin/statusbar/timeinfo
index 884e165..762a490 100755
--- a/.local/bin/statusbar/timeinfo
+++ b/.local/bin/statusbar/timeinfo
@@ -7,6 +7,19 @@ TODAY_BEGIN='3c623e3c753e'
# echo -en '</b></u>' | xxd -p -
TODAY_END='3c2f753e3c2f623e'
+function timeuntil() {
+ if ! [[ "${1}" =~ "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{2}:[0-9]{2}" ]]; then
+ echo "argument must be of the form \"YYYY-MM-DD hh:mm\""
+ else
+ local TDIFF=$(($(date -d "${1}" +%s) - $(date +%s) - 24 * 60 * 60))
+ if [ $(($TDIFF)) -lt 0 ]; then
+ echo 'YEEHAW'
+ else
+ date -u -d @${TDIFF} '+[%d %H:%M:%S]'
+ fi
+ fi
+}
+
case $ARG in
1) notify-send --urgency=low \
"Calendar" \
@@ -14,7 +27,7 @@ case $ARG in
| xxd -p - \
| tr -d '\n' \
| sed -Ee "s/1b5b376d/${TODAY_BEGIN}/g;s/1b5b32376d/${TODAY_END}/g" \
- | xxd -p -r -)"
+ | xxd -p -r -)"
;;
3) notify-send --urgency=low \
"Weather" \