diff options
Diffstat (limited to 'scripts/hs-cycle-padding')
-rwxr-xr-x | scripts/hs-cycle-padding | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/hs-cycle-padding b/scripts/hs-cycle-padding new file mode 100755 index 0000000..56fe802 --- /dev/null +++ b/scripts/hs-cycle-padding @@ -0,0 +1,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 |