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

Newegg Daily Deals

Reply
 
Thread Tools
Old 01-10-09, 02:39 PM   #13
cmasus
Registered User
 
Join Date: Jan 2009
Posts: 1
Default Re: call for testers: disper -- on-the-fly display switching

Quote:
Originally Posted by kcrudup View Post
You know what would be really nice? "disper --toggle", where it toggles back and forth between "disper --single" and "disper --extend"; this way I could make up a button for "--toggle" and make it a one-push display change.
Hi
First of all I want to say thank you for a great tool. I also want a cycle feature, so I made a litle bash script that uses disper and goes through some different display modes. In this way I can connect Fn+F7 to this script an am able to use disper in the way I want .

I had to rename the file to .txt to be able to upload it. Normaly it would be called .sh. Just "chmod a+x display-switch.sh" to make it executable.

I hope this script is general enough to be able to work for all of you. My displays are called DFP-0, CRT-0 and this script only works if the display names have that kind of format. Otherwise feel free to modify the script for your won liking. I should not be too hard.

I still agree with the others that it would be better to have the cycle option in disper itself. So this is just for all of you that want that option right away.
Attached Files
File Type: txt display-switch.txt (1.1 KB, 309 views)
cmasus is offline   Reply With Quote
Old 01-19-09, 01:02 PM   #14
khaytsus
Registered User
 
Join Date: May 2006
Posts: 2
Default Re: call for testers: disper -- on-the-fly display switching

I haven't tested extensively yet, but this works beautifully for me. This is exactly what I was looking for.

I have a 1920x1200 LCD laptop and typically 1024x768 projectors, and I'm always having to fiddle with nvidia-settings, Fn-F8, etc to go to projector, back from projector, etc.. disper -e and disper -s are all I need now!

I agree with a previous poster, a toggle command to go between e and s would be good. I'm going to look at the shell script here, probably do the job for now, but IMO toggling e/s is probably the main use case of this program.

Thank you very, very much!
khaytsus is offline   Reply With Quote
Old 01-22-09, 08:30 AM   #15
cosine
Registered User
 
Join Date: Dec 2008
Posts: 8
Default Re: call for testers: disper -- on-the-fly display switching

One more minor bug:
Disper fails ungracefully is the DISPLAY variable is not set.

> DISPLAY=""
> export DISPLAY
> disper -p
Segmentation fault

This might seems perhaps an unlikely scenario, but it does occur when disper is called from system routines.
For instance, I'm currently trying to call disper when I dock.
cosine is offline   Reply With Quote
Old 02-09-09, 05:24 AM   #16
wvengen
Registered User
 
Join Date: Nov 2008
Posts: 30
Default Re: call for testers: disper -- on-the-fly display switching

Just encountered it as well, thanks for reporting. Followup on https://bugs.launchpad.net/disper/+bug/327133
wvengen is offline   Reply With Quote
Old 02-13-09, 12:02 PM   #17
wvengen
Registered User
 
Join Date: Nov 2008
Posts: 30
Default Re: call for testers: disper -- on-the-fly display switching

disper 0.2.1 was just released. Changes:

- Detect DFP scaling from ~/.nvidia-settings-rc or override on command-line (closes lp:#315139)
- Don't crash when DISPLAY is invalid (closes lp:#327133)
- Make panel placement consistent on switch by setting Xinerama details (closes lp:#321288)
- Make switching between single displays work when they are disconnected at the time of switch (not all cases are covered yet, laptops should be ok) (closes lp:#315920)

You'll have to wait a bit to cycle between different configurations, that's up to a future release.
wvengen is offline   Reply With Quote
Old 02-13-09, 12:12 PM   #18
kcrudup
Registered User
 
Join Date: Apr 2004
Location: Los Angeles, CA 90034
Posts: 96
Default Re: call for testers: disper -- on-the-fly display switching

Getting it now- thanks! (PM/e-mail me if you want me to contribute- I use this at least 2x/day!)
__________________
8600M GS 512MB (HP Pavilion dv9000 CTO)
kcrudup is offline   Reply With Quote
Old 07-05-09, 06:16 AM   #19
wvengen
Registered User
 
Join Date: Nov 2008
Posts: 30
Default Re: call for testers: disper -- on-the-fly display switching

disper 0.2.3 was just released; changes:
- add option -S / --secondary to enable secondary display only (when present)
- work with Python beta versions
and since disper 0.2.2 wasn't announced here, changes for that version are:
- work on older XRandR systems and broken Python ctypes
- work with python 2.3 and 2.4 as well
- remove trailing zero from string query replies (grep now works better )
wvengen is offline   Reply With Quote
Old 07-06-09, 11:20 AM   #20
kcrudup
Registered User
 
Join Date: Apr 2004
Location: Los Angeles, CA 90034
Posts: 96
Default Re: call for testers: disper -- on-the-fly display switching

Thanks again for this!

Question- I can't use it from a hibernate script (to disable the 2nd monitor before a hibernate/suspend) 'cause if you try and run it and there's no display context, it fails. Could it be set to default to the "0th" display in that case?

Also, no chance of a "disper --toggle" to flip between "primary only" and "primary and secondary"?
__________________
8600M GS 512MB (HP Pavilion dv9000 CTO)
kcrudup is offline   Reply With Quote

Old 07-06-09, 10:53 PM   #21
dino
Registered User
 
Join Date: Jun 2007
Posts: 2
Default thanks! plus: toggle wrapper script

First, thank you so much wvengen for writing disper. It has made my struggle with nvidia-settings and xorg.conf go away overnight.

For everyone who has been asking for a --toggle feature, I'd like to offer the small Perl script below that I hacked out this evening. Ugly? You bet. But perhaps it will help until something more serious is added to disper.


disper-toggle
-----
#! /usr/bin/perl

use strict;
use warnings;


# Args that are always needed

my $disperArgs = '--scaling native ';


# Use nvidia-settings to get the TwinView status

my ($twinViewStatus) = `nvidia-settings --query TwinView` =~
/Attribute 'TwinView' \(.*\): (\d)\./;


# Configure args for disper

$disperArgs .= $twinViewStatus
# TwinView is on (1), we need to switch to single
? '--single'
# TwinView is off (0), we need to extend
: '--extend';


# Perform the switch

system "disper $disperArgs";
-----

If this script is hard to read here or is mangled for you, it's also available at http://ui3.info/darcs/scripts/disper-toggle

I plan to hook this bad-boy up to my laptop monitor toggle Fn key.

Thanks again, wvengen. Great work. Much appreciated.

Last edited by dino; 07-06-09 at 11:21 PM. Reason: code may be mangled by the forum software
dino is offline   Reply With Quote
Old 07-07-09, 03:51 AM   #22
wvengen
Registered User
 
Join Date: Nov 2008
Posts: 30
Default Re: call for testers: disper -- on-the-fly display switching

@kcrudup: regarding running disper from a script (as root), please see
https://bugs.launchpad.net/disper/+bug/330258
If you find this an important request, feel free to reopen the bug.
wvengen is offline   Reply With Quote
Old 07-07-09, 04:13 AM   #23
wvengen
Registered User
 
Join Date: Nov 2008
Posts: 30
Default Re: call for testers: disper -- on-the-fly display switching

@dino: thanks for the hack Note that detection of the current state only works for internal display only, so it won't work to toggle between two external displays (I have left twinview enabled on single-screen to work around possible X server crashes)
I do plan to add a cycling option to disper, but that requires some reorganisation for which I currently don't have the time. See also
https://bugs.launchpad.net/disper/+bug/315090
wvengen is offline   Reply With Quote
Old 07-07-09, 10:06 AM   #24
dino
Registered User
 
Join Date: Jun 2007
Posts: 2
Default Re: call for testers: disper -- on-the-fly display switching

@wvengen: "Note that detection of the current state only works for internal display only, so it won't work to toggle between two external displays"

Ok, I can't test this script out in this context myself because all I have here is a laptop with one external.

I'm actually having another serious problem with getting this to work with the laptop Fn button. I think what's happening is, when this script is called by the acpi event handler, that user (root?) can't see the display. So the nvidia-settings --query is failing with a non-zero exit code and no output for TwinView status.

The upshot of this is I can use disper-toggle just fine when I type it into a shell as myself, but the fancy laptop button, nope. :/

Anyone here have an idea of how to fix that?

Or actually it would be great to not have to use nvidia-settings at all to fiugure out the state. I can't think of another way yet but will keep at it. As wvengen said in bug tracking: may be hard.
dino 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
302.07 (beta) for Linux x86/x86_64 released AaronP NVIDIA Linux 0 05-02-12 09:55 AM
Glx mrbig1344 NVIDIA Linux 7 09-30-02 06:45 AM

All times are GMT -5. The time now is 01:03 PM.


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