]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Feat: adds notifier script
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 29 Oct 2024 22:36:24 +0000 (19:36 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 29 Oct 2024 22:36:24 +0000 (19:36 -0300)
notifier [new file with mode: 0755]

diff --git a/notifier b/notifier
new file mode 100755 (executable)
index 0000000..77fc0f6
--- /dev/null
+++ b/notifier
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+#
+# Notifier: a simple tool that notifies once a command finished.
+# Runs a task, compute it's duration and notify upon completion.
+#
+
+# Dispatch
+time "$@"
+
+# Opportunistic UX depending on the available environment
+if which awesome-client &> /dev/null; then
+  echo "naughty.notify({title = \"Action completed:\", text =\"${@}\", timeout = 2})" | awesome-client
+# This one is more intrusive
+#elif which sm &> /dev/null; then
+#  sm -f '#ffffff' -b '#1c1c1c' "Action completed: ${@}"
+fi