summaryrefslogtreecommitdiff
path: root/scripts/hs-cycle-padding
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2015-10-23 03:14:36 -0300
committerMatias Linares <matiaslina@openmailbox.org>2015-10-23 03:14:36 -0300
commit5b132bf1244a008ad3ce67688030a7678831f77d (patch)
tree501aa27e89f81d5f4bdfaab31c72378991a9c749 /scripts/hs-cycle-padding
downloaddotfiles-5b132bf1244a008ad3ce67688030a7678831f77d.tar.gz
Initial commit
Diffstat (limited to 'scripts/hs-cycle-padding')
-rwxr-xr-xscripts/hs-cycle-padding21
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