[ltp] Fn-F7 btn

Raanan Manor linux-thinkpad@linux-thinkpad.org
Sat, 18 Aug 2007 00:10:37 +0300


Hi, 

I was thinking of writing a video-btn.sh script for the Fn-F7 button. As
I have xrandr and the radeon driver with randr-1.2 installed I can use
it. 

for example - 
xrandr | grep ' connected' | awk -F' ' '{print $1}' 

will give me a list of all connected monitors. 

and - 

xrandr | grep ' connected' | awk -F' ' '{print $3}' | awk -F+ '{print
$1}' 

will give me the list of the highest resolution each monitor support.
But as i am new to linux script programming, could someone help me by
telling me how do I insert those values into variables. My problem is
that there could be a few values in several rows, like - 

VGA-0 
LVDS

and 

1600x1200
1024x768

and i want to insert those into variables  monitor1,mode1;
monitor2,mode2, so I could use those vars in switching the display. 

Or maybe I'll do it in Java and use some kind of UI to switch the modes,
which will be much easier for me to do as I program in Java. 

Thanks for any info.