summaryrefslogtreecommitdiff
path: root/fn-f7
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-04-16 16:33:59 +0200
committerPatrick Simianer <p@simianer.de>2016-04-16 16:33:59 +0200
commit095848daf8044cf03271696827bc42026dbe517c (patch)
treeb9ac68009101a3d235f6d79e6a3ae439aeb3fc60 /fn-f7
parent6cf83057ed70ce3ce10ef2dc37537c190ee92405 (diff)
fn-f7: remove line
Diffstat (limited to 'fn-f7')
-rwxr-xr-xfn-f720
1 files changed, 20 insertions, 0 deletions
diff --git a/fn-f7 b/fn-f7
new file mode 100755
index 0000000..78459f2
--- /dev/null
+++ b/fn-f7
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+
+xrandrq = `xrandr -q`
+
+if xrandrq.match /VGA1 connected/
+ if File.exists? '/tmp/__vga_connected'
+ `xrandr --output VGA1 --off`
+ `xrandr --output LVDS1 --mode 1024x768`
+ `rm /tmp/__vga_connected`
+ else
+ if xrandrq.match /1680x1050\s+\d+\.\d+\s++/
+ `xrandr --output VGA1 --mode 1680x1050 --rate 60 --rotate left`
+ elsif xrandrq.match /1600x1200\s+\d+\.\d+\s++/
+ `xrandr --output VGA1 --mode 1600x1200 --rate 60 --rotate right`
+ end
+ `xrandr --output LVDS1 --off`
+ `touch /tmp/__vga_connected`
+ end
+end
+