Permalink
Browse files

Rewrite xrandr scripts

  • Loading branch information...
ISF committed Feb 24, 2013
1 parent ce65abb commit da0833a461800d4dae130403c5ca4c462187370e
Showing with 9 additions and 19 deletions.
  1. +0 −4 .scripts/extern_only.sh
  2. +9 −8 .scripts/xrandr.sh
  3. +0 −5 .scripts/xrandr_connect.sh
  4. +0 −2 .scripts/xrandr_disconnect.sh
View
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-size=$(echo $(xrandr -q | grep VGA -A1 | tail -n 1) | cut -d " " -f 1)
-xrandr --output LVDS1 --off --output VGA1 --mode $size --pos 0x0 --rotate normal
View
@@ -1,16 +1,17 @@
#!/bin/bash
-if [[ $1 == "extern_only" ]]; then
- cmd="$HOME/.scripts/extern_only.sh"
-else
- cmd="$HOME/.scripts/xrandr_connect.sh"
-fi
-
+size=$(echo $(xrandr -q | grep VGA -A1 | tail -n 1) | cut -d " " -f 1)
+size_note=$(echo $(xrandr -q | grep LVDS1 -A1 | tail -n 1) | cut -d " " -f 1)
if [[ -z $(xrandr -q | grep VGA | grep disconnected) ]]; then
- $cmd
+ if [[ $1 == "extern_only" ]]; then
+ xrandr --output LVDS1 --off --output VGA1 --mode $size --pos 0x0 --rotate normal
+ else
+ xrandr --output LVDS1 --primary --mode $size_note --pos 72x${size/*x/} --rotate normal \
+ --output VGA1 --mode $size --pos 0x0 --rotate normal
+ fi
else
- $HOME/.scripts/xrandr_disconnect.sh
+ xrandr --output LVDS1 --mode $size_note --pos 0x0 --rotate normal --output VGA1 --off
fi
nitrogen --restore
pkill conky # ugly, but works
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-size=$(echo $(xrandr -q | grep VGA -A1 | tail -n 1) | cut -d " " -f 1)
-xrandr --output LVDS1 --primary --mode 1280x800 --pos 72x${size/*x/} --rotate normal \
- --output VGA1 --mode $size --pos 0x0 --rotate normal
@@ -1,2 +0,0 @@
-#!/bin/bash
-xrandr --output LVDS1 --mode 1280x800 --pos 0x0 --rotate normal --output VGA1 --off

0 comments on commit da0833a

Please sign in to comment.