r_avital
June 29th, 2014, 05:05 AM
Hi all,
In a terminal, I issue: xrandr -q | grep "*" - I get exactly what I expected: the line " 1600x1200 60.0*+" is output on screen. It tells me what the current resolution is.
In a bash script, I can enter:
echo "xrandr -q | grep \"*\"" -- which is nicely output to the screen, but of course, not executed. I need to:
1. Execute that command
2. capture the output
3. find out what it contains.
My plan is to follow with something similar to this (I know this syntax is wrong, this is just to explain what I need to do):
if [ output contains "1600x1200" ] ; then
do something
fi
if [output contains "1920x1080"] ; then
do something else
fi
This will execute when the greeter is started, right after X starts.
Any ideas? TIA :)
In a terminal, I issue: xrandr -q | grep "*" - I get exactly what I expected: the line " 1600x1200 60.0*+" is output on screen. It tells me what the current resolution is.
In a bash script, I can enter:
echo "xrandr -q | grep \"*\"" -- which is nicely output to the screen, but of course, not executed. I need to:
1. Execute that command
2. capture the output
3. find out what it contains.
My plan is to follow with something similar to this (I know this syntax is wrong, this is just to explain what I need to do):
if [ output contains "1600x1200" ] ; then
do something
fi
if [output contains "1920x1080"] ; then
do something else
fi
This will execute when the greeter is started, right after X starts.
Any ideas? TIA :)