File: layout.sh

package info (click to toggle)
herbstluftwm 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,248 kB
  • ctags: 1,516
  • sloc: ansic: 12,309; sh: 655; makefile: 180; python: 99
file content (16 lines) | stat: -rwxr-xr-x 472 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

# print layout of all tags, and colorizes all window ids
# it's useful to get a overview over the list of all windows

hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;}

hc complete 1 use |
while read tag ; do
    echo -n "$tag "
    indent=$(echo -n "$tag " | sed 's/./ /g')
    # prepend indent, except in first line
    hc layout "$tag" \
        | sed -e "2,\$ s/^/$indent/" \
              -e "s/0x[0-9a-f]\+/$(tput setaf 3)&$(tput sgr0)/g"
done