summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2022-05-23 22:37:23 -0700
committerxyz <gky44px1999@gmail.com>2022-05-23 22:37:23 -0700
commit98a5c320596832e68e42a7632c1e33daa16be216 (patch)
treea338eae975430f6258c79d91e11b7d38e9a45cc0 /home
parent509f70f50c52e15af572b981d32b360636d4c9f3 (diff)
alarm now can execute immediately
Diffstat (limited to 'home')
-rwxr-xr-xhome/xyz/.local/bin/alarm4
1 files changed, 3 insertions, 1 deletions
diff --git a/home/xyz/.local/bin/alarm b/home/xyz/.local/bin/alarm
index 9b366e19..50fe0176 100755
--- a/home/xyz/.local/bin/alarm
+++ b/home/xyz/.local/bin/alarm
@@ -1,6 +1,8 @@
#!/bin/sh
-printf 'notify-send -u critical "%s"; bell' "${2:-alarm}" | at now + "$1" minutes && notify-send "Successfully Scheduled"
+if printf 'notify-send -u critical "%s"; bell' "${2:-alarm}" | at now + "${1:-0}" minutes; then
+ [ "$1" ] && notify-send "Successfully Scheduled"
+fi
# at used to not like string like 'Boiling Water!', don't know why now it works, if see similar issue, use folllowing codes
#at now + "$1" minutes << EOF && notify-send 'Successfully Scheduled'