LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-07-2008, 09:26 AM   #1
0ddba11
Member
 
Registered: Nov 2004
Location: Derby - UK
Distribution: Ubuntu at Home, RedHat Enterprise at Work
Posts: 46

Rep: Reputation: 15
Using nvidia-settings from the command line only


I'm pretty sure this problem must have come up before, but I am really struggling to find a solution.

Basically, I know I can use nvidia-settings to:
1. Enable Twinview on my external monitor
2. Disable my laptop display panel
3. Apply settings

This as you may have guessed is for when I dock my laptop.

The infuriating thing is that I can not find out how to do this from the command line so that it can be scripted and thus automated using ACPI events.

After quite a bit of digging, I have come to the conclusion that all that is really happening is that nvidia-settings is actually using xrandr to create the illusion of the other panel being disabled.

So what I'm I'm looking for is either a way to run nvidia-settings at the command line or tips on how to use xrandr to do whatever it is that nvidia-settings does with it.
 
Old 06-07-2008, 11:33 AM   #2
0ddba11
Member
 
Registered: Nov 2004
Location: Derby - UK
Distribution: Ubuntu at Home, RedHat Enterprise at Work
Posts: 46

Original Poster
Rep: Reputation: 15
Ok, so after having been into town, done a bit of shopping, stopped for a pint and a bowl of spicey chicken noodles, I thought I would have another try.

I managed to get some success by adding the lines listed in bold below to the 'screen' section of /etc/X11/xorg.conf

Code:
Section "Screen"
    Identifier     "Screen0"
    Device         "Videocard0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "1"
    Option         "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-1: NULL; DFP-1: nvidia-auto-select +0+0, DFP-0: NULL" 
EndSection
This now means that I can switch to my external monitor by using:

Code:
xrandr -s 1
and back again to the laptop display panel using:

Code:
xrandr -s 0
However, there is one flaw, and that is that unless X is started with the external monitor attached, xrandr does not display the correct modes. For example, if X is started with the external monitor, xrandr shows:

Code:
Screen 0: minimum 1280 x 800, current 1600 x 1200, maximum 1600 x 1200
default connected 1600x1200+0+0 0mm x 0mm
   1280x800       50.0  
   1600x1200      51.0*    50.0
Great, the two resolutions we need, but if X is started without the External monitor attached:

Code:
Screen 0: minimum 320 x 240, current 1280 x 800, maximum 1280 x 800
default connected 1280x800+0+0 0mm x 0mm
   1280x800       50.0* 
   1152x768       51.0  
   1024x768       52.0  
   800x600        53.0     54.0  
   640x480        55.0  
   640x384        56.0  
   576x384        57.0  
   512x384        58.0  
   400x300        59.0     60.0  
   320x240        61.0
So by having to restart X to get xrandr to recognise the correct resolutions it defeats the whole point of the excersise!

I think I may be at a dead end now because it seems that only the Open Source nvidia driver supports hot plugging, and if I'm going to be going back to the open source driver, I might as well use xrandr like this:

Code:
xrandr --output LVDS --mode off;xrandr --output DVI1 --mode auto
Then I don't have to mess around with metamodes.

I think all this combined with the way some apps still loose their title bar when running compiz means that hacking around trying to get the proprietary driver to work just ain't worth it at the moment.

But the chicken noodles and beer deserve full credit for my progress this afternoon.
 
Old 06-07-2008, 12:02 PM   #3
PMorph
Member
 
Registered: Sep 2003
Distribution: Debian
Posts: 213

Rep: Reputation: 31
To load settings from command line, I use:
nvidia-settings --config=~/.nvidia-settings-rc --load-config-only

Maybe you tried it already, but couldn't tell from your posts
 
Old 06-08-2008, 01:32 AM   #4
enbuyukfener
LQ Newbie
 
Registered: Jun 2008
Posts: 7

Rep: Reputation: 3
You're a legend PMorph. Been looking for a solution for awhile now and seeing that nvidia-settings had no CLI, I went and tried messing with xrandr and things like that as 0ddba11 did. Didn't think of using nvidia-settings that way. Thanks a lot.
 
Old 06-08-2008, 05:26 AM   #5
PMorph
Member
 
Registered: Sep 2003
Distribution: Debian
Posts: 213

Rep: Reputation: 31
Good to hear it was useful
I use that mainly for launching games from scripts (using several rc files), to adjust AA, AF etc. settings depending on how demanding the game is.
 
Old 06-08-2008, 11:23 AM   #6
0ddba11
Member
 
Registered: Nov 2004
Location: Derby - UK
Distribution: Ubuntu at Home, RedHat Enterprise at Work
Posts: 46

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by PMorph View Post
To load settings from command line, I use:
nvidia-settings --config=~/.nvidia-settings-rc --load-config-only

Maybe you tried it already, but couldn't tell from your posts
Hmmmmm, I have tried it but I think I might be missing something.

What I did was create two config files to load with nvidia-settings, onr for when I am docked, and one for when I am undocked. I created them by running the gui, changing the settings and quitting then copying the .nvidia-setting-rc file.

The trouble is that when I try to load the config files I get something like this:

Code:
[email protected]:~$ nvidia-settings --config=~/.nvidia-settings-undocked --load-config-only

ERROR: The attribute 'XVideoSyncToDisplay' specified on line 51 of configuration file
'/home/gaz/.nvidia-settings-undocked' cannot be assigned the value of DFP-0 (the currently
enabled display devices are DFP-1 on gaz-laptop:0.0).
And this is because I am disabling one of the displays but loading the config file doesn't seem to enable the display.

Last edited by 0ddba11; 06-08-2008 at 11:25 AM.
 
Old 08-17-2008, 10:16 AM   #7
cscutcher
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
I'm having a similar problem. I think the reason you've had no luck with .nvidia-settings-rc is because it doesn't seem to have any settings related to enabling disabling screens.
 
Old 08-19-2008, 08:17 PM   #8
sagyvolkov
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
nvidia command line

did anyone had a fix/solution for this issue?
looks like using nvidia-settings only let u load configuration, not applying it.
 
Old 09-01-2008, 10:03 AM   #9
enbuyukfener
LQ Newbie
 
Registered: Jun 2008
Posts: 7

Rep: Reputation: 3
To anyone interested, Fn-F8 works after upgrading to 177.xx (at least in my case). Finally I can rid myself of the work around.
 
Old 09-02-2008, 01:36 AM   #10
sagyvolkov
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
What's your hardware?
 
Old 09-03-2008, 02:06 AM   #11
enbuyukfener
LQ Newbie
 
Registered: Jun 2008
Posts: 7

Rep: Reputation: 3
Quote:
Originally Posted by sagyvolkov View Post
What's your hardware?
NVidia Geforce 8600M GT PCI-E 512MB
Core 2 Duo and 2 GB RAM
Any other details you want?

Software if you are interested:

Mostly defaults

Arch Linux / Gnome / Compiz / Emerald

NVidia 177.68 driver (mentioned as 177.70 seems to have some regressions, haven't seen them for myself though)

Running this after nvidia has loaded for a slight improvement, not really noticeable though:
nvidia-settings -a InitialPixmapPlacement=2 -a GlyphCache=1

xorg.conf
Code:
Section "Device"
    Identifier     "Geforce 8600M GT"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation" 
    BoardName      "Geforce 8600M GT"
    Option         "PixmapCacheSize" "1000000"
    Option         "AllowSHMPixmaps" "0" 
    Option         "OnDemandVBlankInterrupts" "True"
    Option         "NoLogo" "True"
    Option         "TripleBuffer" "True"
    Option         "BackingStore" "True"
    Option         "RenderAccel" "True"
    Option         "UseCompositeWrapper" "True"
    Option         "AllowIndirectPixmaps" "True"
    Option         "RenderAccel" "True"
    Option         "UseEvents" "False"
    Option         "DamageEvents" "1"
EndSection
Read up on this before copying it. My one probably is not optimal, if not far from it.
 
Old 09-05-2008, 04:20 AM   #12
sagyvolkov
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
Where did u get 177.x drivers? the Linux page at Nvidia shows only 173.x
 
Old 09-05-2008, 04:55 AM   #13
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 5,160

Rep: Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833
It may also be worth checking BIOS settings. With my Toshiba Satellite 1410 laptop there is a BIOS setting for the output to the external monitor, either Autoselect or Simultaneous. With Autoselect things are a hassle, but with Simultaneous all works just fine.
 
Old 09-05-2008, 11:38 PM   #14
enbuyukfener
LQ Newbie
 
Registered: Jun 2008
Posts: 7

Rep: Reputation: 3
Quote:
Originally Posted by sagyvolkov View Post
Where did u get 177.x drivers? the Linux page at Nvidia shows only 173.x
Under the "get drivers by product" form on the download drivers page, there's a link to the beta drivers:
http://www.nvidia.com/Download/Find.aspx?lang=en-us

However, you should be doing stuff like this through your package manager. Simpler, saves time and less issues usually. The package is called nvidia-beta on Arch Linux for example.
 
Old 03-08-2009, 04:22 PM   #15
jacksenechal
LQ Newbie
 
Registered: Mar 2009
Posts: 1

Rep: Reputation: 3
I was seeking a solution to quickly reconfigure my X display to swap between monitors. Actually, I wanted it to default to dual-screen twinview mode, and I wanted to be able to unplug the laptop and quickly reconfigure for single-display mode on the fly. Originally I'd thought to try nvidia-settings command line interface, but as it's revealed on this thread and others, nvidia-settings doesn't work for that.

After lots of searching and trying things I stumbled upon the program "disper". I installed the Ubuntu package and the program does exactly what I wanted.

I used nvidia-settings to save my dual-screen setup to xorg.conf so that it will default to that on boot-up. Then I used CompizConfig to bind a shortcut key to execute the command

Code:
disper -d auto -e
This auto-detects the display configuration and sets up the dual-monitor configuration if both are available. If the monitor isn't plugged in, it correctly configures just the laptop monitor. If you wanted to configure just the external monitor, you could run something like

Code:
disper -d CRT-0 -s
Use "disper -l" to find out the names of your attached displays.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Pulseaudio] how to change user settings using a command line ? Ed38 Linux - Software 1 12-23-2007 01:31 PM
configuring video settings from command line stannnn Linux - Newbie 1 06-19-2005 04:33 PM
Nvidia command line problems hypershadow147 SUSE / openSUSE 1 04-02-2005 01:19 PM
Command line DNS settings nateDiggsCSU Linux - Software 1 08-28-2004 04:29 PM
How to change volume/audio settings using the command line? brynjarh Linux - Newbie 3 07-08-2004 10:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:44 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration