tbeepop + popup - client/server popup service - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit fe4d70f9e802ea8401d7d71401700bc5ffeebfcf
(DIR) parent 726fd4eeadd4b0ab4a9c48d72643315e6aa4c64d
(HTM) Author: z3bra <willyatmailoodotorg>
Date: Wed, 23 Sep 2015 00:49:09 +0200
beepop + popup - client/server popup service
beepop is the full script. It starts a listener on /tmp/beepop.fifo, and creates
a lasting popup for each line that comes.
Now if it's called as "popup" (eg, ln -s beepop popup; ./popup) it will write
all arguments to the FIFO. ISN'T THAT AWESOME?!
Typical use
# download beepop...
ln -s beepop popup
./beepop &
popup "testing a popup!"
Enjoy!
Diffstat:
A beepop | 44 +++++++++++++++++++++++++++++++
T popup | 0
2 files changed, 44 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/beepop b/beepop
t@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# depends: lemonbar, wattr and common sense
+
+default_geometry() {
+ # get screen size
+ x=$(wattr w `lsw -r`)
+ y=$(wattr h `lsw -r`)
+
+ width=256
+ height=28
+
+ offy=32
+ offx=$(( x - $width ))
+
+ echo "${width}x${height}+${offx}+${offy}"
+}
+
+FIFO=/tmp/beepop.fifo
+GEOM=$(default_geometry)
+SLEEP=3
+
+# bar options
+ICON='-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*'
+FONT='-*-codingfonttobi1-medium-r-*--12-90-96-96-c-70-iso8859-1'
+BG="#00000000"
+FG="#ffffffff"
+HL="%{F#ff666666}"
+
+case $(basename $0) in
+ beepop)
+ test -p $FIFO || mkfifo $FIFO
+
+ tail -f $FIFO | while read LINE; do
+ (
+ echo "%{r}$LINE ${HL} "
+ sleep $SLEEP
+ ) | lemonbar -d -g "$GEOM" -f $FONT -f $ICON -B $BG -F $FG
+ done
+ ;;
+ popup)
+ echo "$*" > $FIFO
+ ;;
+esac
(DIR) diff --git a/popup b/popup