summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2010-12-28 17:50:35 +0100
committerStefan Ritter <xeno@thehappy.de>2010-12-28 17:50:35 +0100
commit2b5ffad2c3b4b5fe2a330f63d06d56e5cde6d9f2 (patch)
tree64569e0c2c6a10981b2369536a1ccf402a69de6c
parentcd0869586452a5f0918158c16d1616140579e618 (diff)
Add automon function for my own purposes
-rw-r--r--zsh/zshrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/zsh/zshrc b/zsh/zshrc
index 7bf939e..2f5b00e 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -114,6 +114,15 @@ md() {
cd $1
}
+automon() {
+ vga=$(xrandr -q | while read line; do if [[ $line =~ ^VGA1.*$ ]] { echo $line | cut -d " " -f 2 }; done)
+ if [[ $vga = "disconnected" ]] {
+ xrandr --output LVDS1 --auto --output VGA1 --off
+ } else {
+ xrandr --output LVDS1 --off --output VGA1 --auto
+ }
+}
+
case $TERM in
rxvt*)