File: loadstate.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 (18 lines) | stat: -rwxr-xr-x 379 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

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

# loads layouts for each tag coming from stdin
# the format is the one created by savestate.sh

# a common usage is:
# savestate.sh > mystate
# and sometime later:
# loadstate.sh < mystate

while read line ; do
    tag="${line%%: *}"
    tree="${line#*: }"
    hc add "$tag"
    hc load "$tag" "$tree"
done