2012-12-27 22:37:16 +01:00
|
|
|
#! /bin/sh
|
2012-12-19 15:50:42 +01:00
|
|
|
#
|
2013-09-18 22:35:14 +02:00
|
|
|
# Example panel for LemonBoy's bar-aint-recursive
|
2012-12-19 15:50:42 +01:00
|
|
|
|
|
|
|
while read -r line ; do
|
|
|
|
case $line in
|
|
|
|
S*)
|
2013-09-18 22:35:14 +02:00
|
|
|
# clock output
|
|
|
|
sys_infos="\\br\\f6${line#?}"
|
2012-12-19 15:50:42 +01:00
|
|
|
;;
|
2013-03-16 12:29:24 +01:00
|
|
|
T*)
|
2013-09-18 22:35:14 +02:00
|
|
|
# xtitle output
|
|
|
|
title="\\br\\f7${line#?}"
|
2013-03-16 12:29:24 +01:00
|
|
|
;;
|
2013-04-02 19:50:32 +02:00
|
|
|
W*)
|
2013-09-18 22:35:14 +02:00
|
|
|
# bspwm internal state
|
2012-12-19 15:50:42 +01:00
|
|
|
wm_infos=""
|
|
|
|
IFS=':'
|
2013-07-14 14:15:36 +02:00
|
|
|
set -- ${line#?}
|
2012-12-19 15:50:42 +01:00
|
|
|
while [ $# -gt 0 ] ; do
|
|
|
|
item=$1
|
2013-05-29 15:00:18 +02:00
|
|
|
name=${item#?}
|
2012-12-19 15:50:42 +01:00
|
|
|
case $item in
|
2013-09-18 22:35:14 +02:00
|
|
|
O*)
|
|
|
|
# focused occupied desktop
|
|
|
|
wm_infos="$wm_infos \\u3\\br\\fr${name}\\ur"
|
|
|
|
;;
|
|
|
|
F*)
|
|
|
|
# focused free desktop
|
|
|
|
wm_infos="$wm_infos \\u4\\br\\f7${name}\\ur"
|
|
|
|
;;
|
|
|
|
U*)
|
|
|
|
# focused urgent desktop
|
|
|
|
wm_infos="$wm_infos \\u9\\br\\fr${name}\\ur"
|
2012-12-19 15:50:42 +01:00
|
|
|
;;
|
2013-09-09 23:13:51 +02:00
|
|
|
o*)
|
2013-09-18 22:35:14 +02:00
|
|
|
# occupied desktop
|
|
|
|
wm_infos="$wm_infos \\br\\fr${name}"
|
2012-12-19 15:50:42 +01:00
|
|
|
;;
|
2013-09-09 23:13:51 +02:00
|
|
|
f*)
|
2013-09-18 22:35:14 +02:00
|
|
|
# free desktop
|
|
|
|
wm_infos="$wm_infos \\br\\f7${name}"
|
2012-12-19 15:50:42 +01:00
|
|
|
;;
|
2013-09-09 23:13:51 +02:00
|
|
|
u*)
|
|
|
|
# urgent desktop
|
2013-09-18 22:35:14 +02:00
|
|
|
wm_infos="$wm_infos \\b1\\fr${name}"
|
2013-09-09 23:13:51 +02:00
|
|
|
;;
|
2012-12-19 15:50:42 +01:00
|
|
|
L*)
|
|
|
|
# layout
|
2013-05-29 15:00:18 +02:00
|
|
|
layout=$(printf "%s" "${name}" | sed 's/\(.\).*/\U\1/')
|
2013-09-18 22:35:14 +02:00
|
|
|
wm_infos="$wm_infos \\br\\f6$layout"
|
2012-12-19 15:50:42 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
2013-09-18 22:35:14 +02:00
|
|
|
printf "%s\n" "\\l $wm_infos \\c $title \\r $sys_infos "
|
2012-12-19 15:50:42 +01:00
|
|
|
done
|