Browse Source

herbstpanel: also show current tag

master
Lucas 2 months ago
parent
commit
0dd308156c
1 changed files with 10 additions and 9 deletions
  1. +10
    -9
      xdg-config-dir/herbstluftwm/herbstpanel.sh

+ 10
- 9
xdg-config-dir/herbstluftwm/herbstpanel.sh View File

@@ -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


Loading…
Cancel
Save