LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-12-2004, 03:36 PM   #1
lhouk
LQ Newbie
 
Registered: Apr 2004
Location: Houston, Texas USA
Distribution: Fedora 8 (mostly)
Posts: 15

Rep: Reputation: 0
Changing video resolution from command line?


I need to be able to immediately reset the display resolution from within a shell script (since one of the games I run under Wine resets the resolution to 640x480 and doesn't restore it when it exits). I tried

/sbin/setxconf -g 1024x768 -b 16

but it didn't seem to do anything. What is the command line equivalent of "right-click-on-desktop -> Properties -> Settings -> change-screen-size -> Apply" under Xandros 2.0, which I'm running? (If it didn't log me out when it resizes like that sequence does, it would be even better, by the way.) Thanks in advance to all who respond!
 
Old 04-12-2004, 06:49 PM   #2
Creak
Member
 
Registered: Feb 2004
Distribution: debian
Posts: 187

Rep: Reputation: 30
You should have to make a script that change the XF86Config-4 and reboot the x server...
I'm sur it's possible, but i don't know how, sorry

Creak
 
Old 04-14-2004, 09:31 AM   #3
lhouk
LQ Newbie
 
Registered: Apr 2004
Location: Houston, Texas USA
Distribution: Fedora 8 (mostly)
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Creak
You should have to make a script that change the XF86Config-4 and reboot the x server...

Creak
Actually, it's even simpler than that, in theory. See, if I reboot the system, it comes up with the correct resolution, so XFConfig-4 never changes. In fact, if I just do a su and then restart X with startx, it comes up with the correct resolution. However, it also comes up to a login prompt; I'm logged out when X is restarted.

Frankly, I didn't expect this to be so complicated. When I run Master of Orion II under Wine, the first thing that happens is that the screen is changed to 640x480 resolution. How does Wine do this without restarting X? Anybody familiar with the Wine source code?
 
Old 04-14-2004, 09:35 AM   #4
dkaplowitz
Member
 
Registered: Oct 2002
Location: Havertown PA
Distribution: Ubuntu/RHEL/Fedora
Posts: 253

Rep: Reputation: 31
If you have the "Modes" section set up with a number of alternative resolutions, you should be able to ctrl+alt+"+" or "-" to the other resolutions listed in "Modes".

If not that, then maybe you can use "xvidtune" to set it, but that's less immediate.
 
Old 04-15-2004, 02:16 PM   #5
lhouk
LQ Newbie
 
Registered: Apr 2004
Location: Houston, Texas USA
Distribution: Fedora 8 (mostly)
Posts: 15

Original Poster
Rep: Reputation: 0
I got a solution from the Usenet group "comp.emulators.ms-windows.wine"; I need to use the "xrandr" command. To quote from the Usenet posting:

Quote:
Ville Aakko <vaa82@hotmail.com> wrote in message news:<c5k7on$fo1$1@ousrvr3.oulu.fi>...
> Try these workarounds:
>
> - try changing resolution with CTRL+ or CTRL- (that is, pressing CTRL and +
> or CTRL and - together). Test this before running wine, so you know how
> it works.
> - If that doesn't work, run "xvidtune -unlock" and then try CTRL+ and CTRL-
> - If that doesn't work, run "xrandr -q" and then "xrandr -s #", where # is
> the correct display mode. Also look at xrandr's man page.
>
> ...You could check you have "UseXRandR" = "Y" in your wine config, I believe
> that should make wine change resolutions itself in normal situations.
Oddly enough, I found that Ctrl/Alt/+ and Ctrl/Alt/- worked fine before running Wine, but not afterwards. And "xvidtune -unlock" made no difference. But "xrandr" did! So, I wanted to post what worked for me, in hopes that it might prove useful to someone else. And also, thanks to creak and dkaplowitz for their suggestions.

Leslie
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem changing the video adapter setting and changing the screen resolution habiblove Linux - General 3 02-18-2006 05:10 PM
changing video card memory size from root command line tallboy Linux - Hardware 6 04-04-2005 03:20 PM
Changing video resolution HarryLeBlanc Mandriva 1 03-17-2005 02:06 AM
changing video driver via command line armus513 Mandriva 4 02-04-2005 11:03 AM
Changing Resolution of Linux command line mindfrost82 Linux - Newbie 6 07-09-2003 09:05 PM


All times are GMT -5. The time now is 04:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration