herbstpanel: also show current tag

This commit is contained in:
Lucas 2020-01-31 03:03:27 +00:00
vecāks 64ef0b5728
revīzija 0dd308156c
1 mainīti faili ar 10 papildinājumiem un 9 dzēšanām

Parādīt failu

@ -14,29 +14,30 @@ if [ -f ~/.config/herbstluftwm/theme ]; then
. ~/.config/herbstluftwm/theme
fi
show_urgent_tags() {
show_tags() {
mon=$1
herbstclient tag_status "$mon" | tr "\t" "\n" | {
focused=$(herbstclient attr tags.focus.name)
s=
while IFS= read -r line; do
[ -n "$line" ] || continue
tag=${line#[.:+#%!-]}
case $line in
!*) focused=$(herbstclient attr tags.focus.name)
[ "$tag" != "$focused" ] && s=$s"$line "
!*) [ "$tag" != "$focused" ] && s=$s" $line"
;;
esac
done
printf "%%{l}%%{F%s}%s%%{F-}\n" "$hlwm_color9" "$s"
printf "%%{l} %s%%{F%s}%s%%{F-}\n" \
"$focused" "$hlwm_color9" "$s"
}
}
tagstatus() {
tags_status() {
mon=$1
show_urgent_tags "$mon"
herbstclient -i "tag_flags" | while read -r discard; do
show_urgent_tags "$mon"
show_tags "$mon"
herbstclient -i "tag_(changed|flags)" | while read -r discard; do
show_tags "$mon"
done
}
@ -50,7 +51,7 @@ while IFS=" " read -r m x y w h; do
center=
right=
{
tagstatus "$m" &
tags_status "$m" &
spoon -t &
} | while IFS= read line; do
case $line in