From 5b132bf1244a008ad3ce67688030a7678831f77d Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Fri, 23 Oct 2015 03:14:36 -0300 Subject: Initial commit --- herbstluftwm/popups.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 herbstluftwm/popups.sh (limited to 'herbstluftwm/popups.sh') diff --git a/herbstluftwm/popups.sh b/herbstluftwm/popups.sh new file mode 100755 index 0000000..0ba7d86 --- /dev/null +++ b/herbstluftwm/popups.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +dzen_bg="#444040" + +calendary() { + ( + cal + ) | dzen2 -p -bg "${dzen_bg}" -x "1195" -y "25" -w "165" -h "20" -l "5" -sa "c" -ta "c" \ + -title-name "popup_sysinfo" -e 'onstart=uncollapse;button1=exit;button3=exit' +} + +position(){ + pos=$(mpc | awk 'NR==2' | awk '{print $4}' | sed 's/(//' | sed 's/%)//') + bar=$(echo $pos | gdbar -w $1 -h 1.5 -fg "#FF3D00" -bg "#821D00") + echo -n "$bar" + return +} + +music() { + set -e + + popup_width=220 + padding=10 + + while : + do + echo "^p(10)$(mpc current -f %artist%) +^p($padding)$(mpc current -f %title%) +^p($padding)$(mpc current -f %album%) + +^p($padding)^ca(1,mpc prev)Prev^ca() ^ca(1,mpc toggle)Play/Pause^ca() ^ca(1,mpc stop)Stop^ca() ^ca(1,mpc next)Next^ca() +^p($padding)$(position $(($popup_width - $padding)) )" 2> /dev/null + sleep 1 + done | dzen2 -p -bg "${dzen_bg}" -y 25 -x 967 -l 5 -u -w $(($popup_width + $padding)) -ta l -title-name "popup_mpd" -e 'onstart=uncollapse;button3=exit' +} + +case $1 in + cal) + calendary + ;; + music) + music + ;; + *) + ;; +esac -- cgit v1.2.3-70-g09d2