mirror of https://github.com/nkoehring/configs.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
897 B
Bash
32 lines
897 B
Bash
10 years ago
|
tags() {
|
||
|
output=""
|
||
|
|
||
|
for tag in $(herbstclient tag_status)
|
||
|
do
|
||
|
status=${tag:0:1}
|
||
|
tag_id=${tag:1:1}
|
||
|
case $status in
|
||
|
'#')
|
||
|
title=$(herbstclient attr clients.focus.title)
|
||
|
[ ${#title} -ge 30 ] && title="${title:0:29}…"
|
||
|
item="<fc=gray50>[</fc><fc=#ffee00>$title</fc><fc=gray50>]</fc>"
|
||
|
;;
|
||
|
':')
|
||
|
item="<fc=gray50>[</fc><fc=#ee9a00>$tag_id</fc><fc=gray50>]</fc>"
|
||
|
;;
|
||
|
'.')
|
||
|
item="<fc=gray20>[$tag_id]</fc>"
|
||
|
;;
|
||
|
'*')
|
||
|
item="<fc=gray50>[</fc><fc=gray50>$tag_id</fc><fc=gray50>]</fc>"
|
||
|
;;
|
||
|
esac
|
||
|
action="<action=`echo herbstclient use $tag_id`>$item</action>"
|
||
|
output="$output$action"
|
||
|
done
|
||
|
|
||
|
echo $output
|
||
|
}
|
||
|
|
||
|
while true; do tags; sleep .5; done
|