[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set resolution



I have a nice solution for this which lets you choose your resolution from the WM menu.
Put this in your windowmaker menu (as a Program generated submenu):
("Set Resolution", OPEN_MENU, "|| /usr/bin/resolution.sh"),

Then put this script in /usr/bin, naming it resolution.sh

#!/bin/sh
#
# resolution.sh - Piter PUNK
#
# This script makes a menu with all possible resolutions, and you can
# change to that resolutions with one "click".
#
# After change the resolution of screen, you need to "Restart WindowMaker",
# to put all windows and menus inside the new screen size.
#

# modified by Gilbert Ashley <amigo@ibiblio.org> to work with xrandr-1.2 

if [[ $(xrandr --version |grep 1.2) ]] ; then
xrandr -q | grep -v Screen | grep -v connected | awk '
BEGIN { 
	print "\"Resolution\" MENU" 
} 

{ 
	print "\"   "$1"  " $2"\" EXEC xrandr -s " $1 
} 

END { 
	print "\"Resolution\" END"
}'

else
xrandr | tr "*" " " | awk '
BEGIN { 
	print "\"Resolution\" MENU" 
} 

/^.[0-9]/ { 
	print "\"   "$2"x" $4"\" EXEC xrandr -s " $1 
} 

END { 
	print "\"Resolution\" END"
}'
fi

Gilbert Ashley

On Tue, 21 Oct 2008 21:50:47 -0700
"John H. Robinson, IV" <jaqque@sbih.org> wrote:

> John H. Robinson, IV wrote:
> > Germ?n Arias wrote:
> > > Hi, the gnome's tool don't work, show the panel ask me if I want keep the new resolution or back at the last, but the resolution don't change. Then, I did make a script call "Default" on /etc/gdm/PostLogin with code
> > > 
> > > xrandr -s 1280x1024 
> > 
> > Most games I have used have reset the resolution to the previous when
> > they exit. You may want to make a wrapper akin to the following:
> 
> #!/bin/sh
> RES=`xrandr -q | awk '/^\*/ { print $2 "x" $4 }'`
> "$@"
> xrandr -s "${RES}"
> 
> > invoked as such:
> 
> $ play_game /usr/games/robotfindskitten 30
> 
> "$@" will pass along the options, as well as the program executable
> itself.
> 
> -- 
> John H. Robinson, IV          jaqque@sbih.org
>                                                                  http  ((((
> WARNING: I cannot be held responsible for the above,         sbih.org ( )(:[
> as apparently my cats have learned how to type.          spiders.html  ((((
> 
> 
> -- 
> To unsubscribe, send mail to wmaker-user-unsubscribe@lists.windowmaker.info.


-- 
To unsubscribe, send mail to wmaker-user-unsubscribe@lists.windowmaker.info.