SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-01-12 05:04:05

monkeybritt
#! Junkie
From: Nowhere, Indiana
Registered: 2009-10-17
Posts: 288
Website

Xrandr quick scripts

I hook my laptop to my tv an a quite regular basis. I store all recorded tv episodes and such on my desktop and I use sshfs to view them on the tv via this connection. I find grandr a little odd to understand so I just put together to very short scripts that give me what I want.

#!/bin/bash

xrandr --output VGA1 --auto --right-of LVDS1 &

exit

This adds VGA as an extended desktop to the right of LVD.

This handles both resolutions very well and once you set up the wallpapers with the seperate options for both in nitrogen, nitro will store that config in a file and will automatically reapply the settings when you reconnect.

#!/bin/bash

xrandr --output VGA1 --off &
exit

That restores to the original single monitor settings.
That is much simpler than fussing with grandr every time I have to hook it up so my daughter can watch cinderella or sleeping beauty.

Last edited by monkeybritt (2010-01-12 05:05:01)


failure is only a negative way to describe a learning experience.
i am constantly learning. smile

Offline

Be excellent to each other!

#2 2010-01-12 05:20:49

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 9,249

Re: Xrandr quick scripts

Well done monkeybritt!  I do something very similar, except I just scroll through my xterm history to run the xrandr commands - they seem to stay relatively fresh in the history.


while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.

Offline

#3 2010-01-12 14:02:05

monkeybritt
#! Junkie
From: Nowhere, Indiana
Registered: 2009-10-17
Posts: 288
Website

Re: Xrandr quick scripts

thank you, I do the scroll back for most things but I'm a bit of a neat freak and regularly clear my histroy. smile


failure is only a negative way to describe a learning experience.
i am constantly learning. smile

Offline

#4 2010-01-14 22:22:24

dastagg
Member
Registered: 2009-02-20
Posts: 14

Re: Xrandr quick scripts

I have a question please.
I am using 9.04 now but wrote (stole from somewhere I can't remember) the following script when using 8.10.
Connect the projector and then run the script. It displays on both laptop and the projector.
It worked really well on 8.10 and it works on 9.04 BUT when I run it to connect to the projector, it logs me out. Almost like I did a ctrl-alt-backspace.

#!/bin/bash
if xrandr -q | grep "VGA connected" > /dev/null ; then
    xrandr --output LVDS --mode "1024x768" --output VGA --mode "1024x768"
    else
        xrandr --output LVDS --auto --output VGA --auto
fi

Any ideas why it logs me out?

Thanks

Offline

#5 2010-01-14 23:03:12

monkeybritt
#! Junkie
From: Nowhere, Indiana
Registered: 2009-10-17
Posts: 288
Website

Re: Xrandr quick scripts

I have had xrandr shutme out a few times but it was do to poor execution.  I would try man xrandr and add the option for either --right-of or the clone option.


failure is only a negative way to describe a learning experience.
i am constantly learning. smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo