tbeepop - scripts - various script and utils
HTML git clone git://z3bra.org/scripts
DIR Log
DIR Files
DIR Refs
---
tbeepop (766B)
---
1 #!/bin/sh
2 #
3 # depends: lemonbar, wattr and common sense
4
5 default_geometry() {
6 # get screen size
7 x=$(wattr w `lsw -r`)
8 y=$(wattr h `lsw -r`)
9
10 width=140
11 height=28
12
13 offy=44
14 offx=$(( x - $width - 25 ))
15
16 echo "${width}x${height}+${offx}+${offy}"
17 }
18
19 FIFO=/tmp/beepop.fifo
20 GEOM=$(default_geometry)
21 SLEEP=3
22 CHAR="$(/usr/bin/printf '\uE054')"
23
24 case $(basename $0) in
25 beepop)
26 test -p $FIFO || mkfifo $FIFO
27
28 tail -f $FIFO | while read LINE; do
29 . $HOME/.theme
30 (
31
32 echo "%{r}$LINE %{F${HL}}$CHAR"
33 sleep $SLEEP
34 ) | lemonbar -d -g "$GEOM" -f "$FONT" -f "$ICON" -B "#00000000" -F "$FG"
35 done
36 ;;
37 popup)
38 echo "$*" > $FIFO
39 ;;
40 esac