File: loadstate.sh

package info (click to toggle)
herbstluftwm 0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 684 kB
  • sloc: ansic: 6,168; sh: 399; makefile: 117
file content (20 lines) | stat: -rwxr-xr-x 367 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

hc=${herbstclient_command:-herbstclient}

# loads layouts for each tag comming 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