summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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*)