]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Xalarm: support sm output
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 19 Apr 2018 13:09:14 +0000 (10:09 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 19 Apr 2018 13:09:14 +0000 (10:09 -0300)
xalarm

diff --git a/xalarm b/xalarm
index ca3613c8a2e222563531de2666fcc7d21d0dec2c..9405ce1df124436c3227261596fde7a06e51c445 100755 (executable)
--- a/xalarm
+++ b/xalarm
@@ -1,6 +1,7 @@
 #!/bin/bash
 #
 # Simple alarm applicaton
+# Example run: xalarm 1m mymessage
 # See discussion at https://www.reddit.com/r/Gentoo/comments/1rryh1/kalarm_replacement/
 #
 
@@ -28,9 +29,12 @@ function xalarm_set {
   #echo "xmessage $MESSAGE" | at now +$DELAY
 
   # Sleep implementation
-  # Example run: xalarm 1m mymessage
   sleep $DELAY
-  xmessage $MESSAGE
+  if which sm 2> /dev/null; then
+    sm $MESSAGE
+  else
+    xmessage $MESSAGE
+  fi
 }
 
 # Cancel alarms