aboutsummaryrefslogtreecommitdiff
path: root/herbstluftwm/scripts/hide.sh
blob: 8450f1789d9cf83c1e88a30970add31d898d9710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
function tag() {
  herbstclient list_monitors | grep ‘[FOCUS]’ | cut -d’”’ -f2
}
 
tag=$(tag)
case "$@" in
  +1)   herbstclient dump “‘$tag” || herbstclient add “‘$tag”
        herbstclient move “‘$tag”
        ;;
  -1)   if herbstclient dump “‘$tag”; then
          herbstclient chain . lock . use “‘$tag”
          winid=$(herbstclient attr clients.focus.winid)
          herbstclient chain . use $tag . bring $winid . unlock
        fi
        ;;
  0|*)  herbstclient dump “‘$tag” && herbstclient merge_tag “‘$tag” ;;
esac