From 5b132bf1244a008ad3ce67688030a7678831f77d Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Fri, 23 Oct 2015 03:14:36 -0300 Subject: Initial commit --- scripts/hs-cycle-padding | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/hs-cycle-padding (limited to 'scripts/hs-cycle-padding') 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 -- cgit v1.2.3-70-g09d2