#!/bin/sh . ../mpanel.subr align="left" background="$(color 5)" foreground="$(color 3)" waitFunc="wait_for tag_changed" print_tags() { output="" for element in $(herbstclient tag_status); do pref="$(echo "$element" | cut -c1-1)" tag="$(echo "$element" | cut -c2-)" if [ "$pref" = "#" ]; then output="$output%{R}$tag%{R}" elif [ "$pref" = ":" ]; then output="$output%{A:herbstclient use_index $(expr $tag - 1):} $tag %{A}" else output="$output" fi done echo "$output" } loop print_tags