You are not logged in.

#1 2010-02-25 07:01:21

sdellysse
Member
Registered: 2009-12-15
Posts: 33

drandr - a dmenu based XRandR frontend

Manipulate the XRandR system from a dmenu instance.
https://php.radford.edu/~sdellysse/drandr.rb

I got tired of having to open the a throwaway terminal everytime I wanted to hook my netbook up to my external monitor, so I started hacking dmenu in ruby. Right now it's able to enumerate the different outputs and the possible resolutions of each, and also disconnect a monitor from the system.

It is no where near complete yet, and it's getting late so I'm posting it here for some feedback. Tomorrow I'll toss it up on the AUR.

Requires:
- ruby
- dmenu
- xrandr

Tell me what you think guys.

Offline

#2 2010-02-25 07:26:09

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: drandr - a dmenu based XRandR frontend

I usually use nvidia-settings which is a bit of a PITA so I might give this a go later.


neutral

Offline

#3 2010-02-25 11:48:16

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: drandr - a dmenu based XRandR frontend

Didn't seem to work for me. It wouldn't detect the tv I had connected to svideo.


neutral

Offline

#4 2010-02-25 12:19:54

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: drandr - a dmenu based XRandR frontend

Dont think binary nvidia drivers are supported by randr, may be wrong tho.

Offline

#5 2010-02-25 15:08:18

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: drandr - a dmenu based XRandR frontend

Hi sdellysse

The case statement can be simplified to:

    case command
      when 'Connect'
      when 'Disconnect'
      when 'Resize'
      when 'Rotate'
      when 'Move'
      when 'List'
    end

Cheers!

Offline

#6 2010-02-25 15:11:02

sdellysse
Member
Registered: 2009-12-15
Posts: 33

Re: drandr - a dmenu based XRandR frontend

awkwood wrote:

Hi sdellysse

The case statement can be simplified to:

    case command
      when 'Connect'
      when 'Disconnect'
      when 'Resize'
      when 'Rotate'
      when 'Move'
      when 'List'
    end

Cheers!

Thank you very much. I was figuring that could be done, but hadn't tried it.

Offline

#7 2010-02-25 16:32:45

sdellysse
Member
Registered: 2009-12-15
Posts: 33

Re: drandr - a dmenu based XRandR frontend

sand_man wrote:

Didn't seem to work for me. It wouldn't detect the tv I had connected to svideo.

Can you post the output of 'xrandr -q'?

Offline

#8 2010-03-06 16:31:22

Vyazovoi
Member
From: Russia
Registered: 2007-07-31
Posts: 14
Website

Re: drandr - a dmenu based XRandR frontend

I simply use this:

if [ ! -z "`xrandr | grep 'VGA1 connected'`" ]; then
    xrandr --output LVDS1 --off
    xrandr --output VGA1 --auto
else
    xrandr --output VGA1 --off
    xrandr --output LVDS1 --auto
fi

Offline

#9 2010-03-06 19:48:56

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: drandr - a dmenu based XRandR frontend

I like the concept :-) I don't know if it works, I can't test it right now.
Will you create an AUR package?

Offline

#10 2010-03-09 22:17:20

sdellysse
Member
Registered: 2009-12-15
Posts: 33

Re: drandr - a dmenu based XRandR frontend

Army wrote:

I like the concept :-) I don't know if it works, I can't test it right now.
Will you create an AUR package?

Thanks. I just bought a new netbook, and am migrating my stuff to that at the moment. I'll toss it up on the AUR when I get a chance.

Offline

#11 2011-02-07 13:57:39

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 1,961
Website

Re: drandr - a dmenu based XRandR frontend

Vyazovoi wrote:

I simply use this:

if [ ! -z "`xrandr | grep 'VGA1 connected'`" ]; then
    xrandr --output LVDS1 --off
    xrandr --output VGA1 --auto
else
    xrandr --output VGA1 --off
    xrandr --output LVDS1 --auto
fi

cool script. albeit a bit ugly.  I cleaned it up a bit and changed LVDS to eDP (that's how it's called on my system)

#!/bin/bash
if xrandr | grep -q 'VGA1 connected'
then
    xrandr --output eDP1 --off --output VGA1 --auto
else
    xrandr --output eDP1 --auto --output VGA1 --off
fi

btw, drandr is not on the AUR yet tongue

Last edited by Dieter@be (2011-02-07 13:58:48)


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#12 2011-02-07 18:37:52

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: drandr - a dmenu based XRandR frontend

Now it is http://aur.archlinux.org/packages.php?ID=46239 wink I don't know the version number and the license...

Last edited by Army (2011-02-07 18:39:41)

Offline

Board footer

Powered by FluxBB