|
|
#1 | |
|
Registered User
Join Date: Sep 2009
Posts: 6
|
I've tried using nvidia-settings from the command line, but have been unsuccessful. I've tried a number of options that seem like they would work, but don't. Key in my problem is that DFP-0 and DFP-1 have different resolutions.
Every time I sit down to work from my notebook at my desk, I go through the nvidia-settings GUI, which is intuitive, but cumbersome when done again and again. In case it helps, I've attached two screenshots of nvidia-settings indicating the two states I need to switch between. How do I make it happen via the command line? Thanks! |
|
|
|
|
|
|
#2 | |
|
NVIDIA Corporation
Join Date: Mar 2005
Posts: 2,487
|
Try this:
$ nvidia-settings -a SwitchToDisplays=`nvidia-settings -tq ProbeDisplays` I don't recall offhand whether that changes the resolution too. You may need to use the xrandr command line tool for that. Another option is to configure two MetaModes in xorg.conf, one that uses a mode on DFP-0 and the NULL mode on DFP-1, and another with the roles reversed. Then you can switch between the two with xrandr. |
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Mar 2009
Posts: 13
|
I have a launcher on my panel to this script that toggles the output.
Use: gksudo <scriptname> in the launcher. Code:
#!/bin/bash if [[ `grep DFP-0 /etc/X11/xorg.conf` ]]; then sed -i s'/DFP-0/DFP-1/' /etc/X11/xorg.conf else sed -i s'/DFP-1/DFP-0/' /etc/X11/xorg.conf fi |
|
|
|
|
|
#4 | |
|
Registered User
Join Date: Sep 2009
Posts: 6
|
But, after doing this, a restart of X is required, right?
I need to switch without restarting X. |
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Sep 2009
Posts: 6
|
Aaron,
Thanks for the suggestions. The first one gets me part-way there -- it enables TwinView, thus enabling DFP-1. However, it leaves DFP-1 at the resolution of DFP-0 (as you said it might), but it also leaves DFP-0 enabled. I'm trying to figure out how to get nvidia-settings to enable DFP-1, disable DFP-0, and auto-set it's resolution. |
|
|
|
|
|
#6 | |
|
NVIDIA Corporation
Join Date: Mar 2005
Posts: 2,487
|
The nvidia-settings command line tool won't change resolutions. When you're using the GUI, it uses the RandR extension to do that. To do the same thing from the command line, you need to use the xrandr tool.
|
|
|
|
|
|
|
#7 |
|
Registered User
Join Date: Sep 2009
Posts: 6
|
Aha!
I'm closer now. "nvidia-settings -tq ProbeDisplays" returns "0x00030000" when both display devices are connected. Because it's a bitmap value, 0x00020000 represents DFP-1, and 0x00010000 represents DFP-0. Now, I can do this to switch to the desktop display: nvidia-settings -a SwitchToDisplays=0x00020000 and this to switch to the laptop display: nvidia-settings -a SwitchToDisplays=0x00010000 Now, all I need to do is get the resolution to auto-set for each display... |
|
|
|
|
|
#8 |
|
Registered User
Join Date: Sep 2009
Posts: 6
|
Now that I'm able to enable one display device or the other, how do I invoke 'nvidia-auto-select' from the command line to auto-detect and select the proper resolution for the active display device?
|
|
|
|
|
|
#9 |
|
NVIDIA Corporation
Join Date: Mar 2005
Posts: 2,487
|
You might not be able to... you need to add a metamode with that resolution to the RandR mode pool, which you can't do with the command line utility, I think. You may want to give a program called "disper" a try -- it's supposed to be able to do all of the stuff you need.
|
|
|
|
|
|
#10 | |
|
Registered User
Join Date: Sep 2009
Posts: 6
|
AaronP -- Thanks!
Disper is exactly what I've been looking for. I was able to download and build it for my Ubuntu notebook quite easily: Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
|
|