summaryrefslogtreecommitdiff
path: root/scripts/hs-cycle-padding
blob: 56fe802cc32fccad59478f2e98af7e0e13edd373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/ruby

file1 = "/tmp/herbst-padding-1"
file2 = "/tmp/herbst-padding-2"

pad1 = 'pad 0 0 0 0 0'
pad2 = 'pad 0 0 20 0 200'
pad3 = 'pad 0 0 0 0 150'

files = [file1, file2].map{|f| File.exist? File.expand_path(f)}

if files == [false, false]  # 0 files
    system "herbstclient #{pad2}"
    system "touch #{file1}"
elsif files == [true, false]  # 1 file
    system "herbstclient #{pad1}"
    system "touch #{file2}"
else           # 2 files
    system "herbstclient #{pad3}"
    system "rm #{file1} #{file2}"
end