Advertisement
Guest User

tv-switch.sh

a guest
May 31st, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ "$1" = "switch" ]; then
  4.   state=$(xrandr | grep DFP5 | grep +)
  5.   echo $state
  6.   if [[ ${#state} -gt 0 ]]; then
  7.     xrandr --output DFP1 --auto
  8.     xrandr --output DFP5 --off
  9.   else
  10.     xrandr --output DFP5 --below DFP1 --mode 1920x1080 --rate 50
  11.     xrandr --output DFP1 --off
  12.     aticonfig --set-dispattrib=dfp5,sizeX:1920
  13.     aticonfig --set-dispattrib=dfp5,sizeY:1080
  14.     aticonfig --set-dispattrib=dfp5,positionX:0
  15.     aticonfig --set-dispattrib=dfp5,positionY:0
  16.   fi
  17. else
  18.   if [ "$1" = "on" ]; then
  19.     xrandr --output DFP5 --below DFP1 --mode 1920x1080 --rate 50
  20.     aticonfig --set-dispattrib=dfp5,sizeX:1920
  21.     aticonfig --set-dispattrib=dfp5,sizeY:1080
  22.     aticonfig --set-dispattrib=dfp5,positionX:0
  23.     aticonfig --set-dispattrib=dfp5,positionY:0
  24.   else
  25.     xrandr --output DFP5 --off
  26.   fi
  27. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement