From 458578b4ada5892abd0d0b59e565eeb09c263108 Mon Sep 17 00:00:00 2001 From: encrypt Date: Mon, 14 Mar 2016 17:35:39 +0100 Subject: [PATCH] add notifyfo --- notifyfo/README.md | 12 ++++++++++++ notifyfo/notifyfo.sh | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 notifyfo/README.md create mode 100755 notifyfo/notifyfo.sh diff --git a/notifyfo/README.md b/notifyfo/README.md new file mode 100644 index 0000000..e6c96f9 --- /dev/null +++ b/notifyfo/README.md @@ -0,0 +1,12 @@ +notifyfo +======== + +Send simple notifications from shitty programs, without dbus and without system(). + +Usage +----- + +``` +$ ./notifyfo.sh +$ echo "Fuck you d-bus, fuck you." > /tmp/notify-send +``` diff --git a/notifyfo/notifyfo.sh b/notifyfo/notifyfo.sh new file mode 100755 index 0000000..6426e4f --- /dev/null +++ b/notifyfo/notifyfo.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# WTFPL +# fuck you dbus, fuck you. + +fifo="/tmp/notify-send" + +trap "rm -rf $fifo" EXIT + +if [[ ! -p $fifo ]]; +then + mkfifo $fifo + chmod 666 $fifo +fi + +while read line < $fifo +do + notify-send "$line" +done