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

Newegg Daily Deals

Reply
 
Thread Tools
Old 10-11-08, 07:01 PM   #1
CptDondo
Registered User
 
Join Date: Jan 2007
Posts: 18
Default Programmatically tell how many monitors are attached

I need to write a shell script that figures out how many monitors are attached to multiple nvidia cards.

For example, on one test machine I have 2 dual-DVI nVidia Quadra cards, so I can have 0 to 4 monitors attached. On another test machine, I have 1 dual DVI quadra card and 2 single DVI quadra cards; again, I can have 0 to 4 monitors attached.

I need to know how many monitors are attached from inside a shell script, before X starts, so I can start the correct number of X sessions.
CptDondo is offline   Reply With Quote
Old 10-12-08, 09:18 AM   #2
Tub
Registered User
 
Join Date: Nov 2006
Posts: 95
Default Re: Programmatically tell how many monitors are attached

I don't think there's an easy way to do that. To query the amount of attached monitors, you need to initialize the gfx drivers, and to initialize those, you'll need to start X. If you take a look into your Xorg.0.log, you'll notice that the attached devices are queried when X starts, not earlier.

you can query a lot of information via
Quote:
nvidia-settings -q all
once at least one X server is started, but I'm not going to unplug my monitor to see if any of that is useful.

The best way might be to just start all 4 X servers and to make sure that those without monitors fail silently.
Tub 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nvidia Quadro 420 and dual 30" monitors quickSTi NVIDIA Linux 2 06-20-12 12:04 PM
Problems with configuring monitors and keeping them disabled with 302.17 Erosmith NVIDIA Linux 2 06-20-12 12:10 AM
quadro 1000m with 2 external monitors stephenh NVIDIA Linux 1 06-14-12 04:04 PM
Enhancing Windows 8 for multiple monitors News Archived News Items 0 05-16-12 01:40 AM
Monitors found but no configuration suitable bluephile NVIDIA Linux 4 08-31-02 06:53 AM

All times are GMT -5. The time now is 08:20 PM.


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