Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 04-06-10, 11:33 PM   #1
Mazaryk
Registered User
 
Join Date: Apr 2010
Posts: 2
Default Change active displays via command line

Hey,

I have two monitor configurations ("Monitor Profiles") that I would like to switch between easily via the command line. (I have no problem doing this with the nvidia-settings GUI. I just want to do this on the command line)

Okay here's the scenario: I have a laptop. The laptop has an LCD display and an external display. So the two profiles are: 1) LCD on, External off, and 2) LCD off, External on.

I have figured out that these profiles are essentially different metamodes.

I have been able to add the second metamode using the nv-control-dpy tool.

Eg of adding monitor profile #2:

Code:
# nv-control-dpy --add-metamode 'DFP-0: NULL, CRT-0: nvidia-auto-select'
This works fine and the metamode is added. The following confirms:
Code:
#nv-control-dpy --print-metamode

Using NV-CONTROL extension 1.17 on :0.0
Connected Display Devices:
  CRT-0 (0x00000001): SONY TV
  DFP-0 (0x00010000): Seiko

MetaModes:
  id=50, switchable=no, source=nv-control :: DFP-0: nvidia-auto-select @1680x1050 +0+0, CRT-0: NULL
  id=51, switchable=no, source=nv-control :: CRT-0: nvidia-auto-select @1920x1080 +0+0, DFP-0: NULL
This is where I get lost. What command will switch between metamodes? Does 'switchable=no' have something to do with it?

I've been playing around with 'nvidia-settings', 'nv-control-dpy', and 'xrandr' but have not found the right command.

Oh, yah, I'm on Ubuntu 9.04 Jaunty Jackalope. Thanks in advance for the help

Cheers,
Mazaryk is offline   Reply With Quote
Old 04-07-10, 01:32 AM   #2
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Change active displays via command line

The "xrandr" command is the one you want. Find the resolution with the 50 or 51 in the "refresh rate" field -- it corresponds to the metamode ID reported by nv-control-dpy.

If you don't want to muck about with nv-control-dpy, you can define the metamodes you want using the "MetaModes" option in xorg.conf. Then, you can simply switch between them with xrandr without having to add them each time you start the X server.
AaronP is offline   Reply With Quote
Old 04-09-10, 09:32 PM   #3
Mazaryk
Registered User
 
Join Date: Apr 2010
Posts: 2
Default Re: Change active displays via command line

AaronP,

Thanks. But when I execute:

Code:
#xrandr -s 1680x1050@51
nothing happens.

Code:
#xrandr 
...
1680x1050    50.0*    51.0    79.0    52.0
...

The * beside 50.0 seams to indicate the current metamode id. But when I execute the xrandr command to switch to 1680x1050@51 nothing happens, and the * stays on 50.0.

Anyone got any clues?

Thanks,
Mazaryk is offline   Reply With Quote
Old 04-09-10, 10:41 PM   #4
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Change active displays via command line

That's because -s only specifies the mode size. Try "xrandr -s 1680x1050 -r 51".
AaronP is offline   Reply With Quote
Reply


Thread Tools

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
Forum Jump


All times are GMT -5. The time now is 06:27 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.