You are not logged in.

#1 2008-10-23 10:02:12

jordi
Member
Registered: 2006-12-16
Posts: 103
Website

xrandr, dual monitor, openbox - setting the main monitor?

Hello fellow archers,

got some kind of nasty problem here:

I got a notebook (on the right side) and a old monitor (on the left side).

By using the handy xrandr tool I can set up dual monitors (almost) fine:

xrandr --output VGA-0 --mode 1400x1050 --left-of LVDS

That should do the trick, but unfortunatle conky and gmrun than appear on the left-monitor. But I would like to have my notebook screen as the main-screen.

So basically I would like to have what I get with

xrandr --output VGA-0 --mode 1400x1050 --right-of LVDS

just with the minor difference that I can swap screens when I move my mouse over the left-notebook-edge / right-monitor-edge instead of the other way round.

Hope you get what I mean and maybe someone even knows a solution.

Offline

#2 2008-10-23 11:38:02

Frots
Member
Registered: 2008-10-02
Posts: 57

Re: xrandr, dual monitor, openbox - setting the main monitor?

With xrandr you set a virtual desktop.
Afaik your desktop starts in the top left corner so I don't know if you can change this in openbox.
Your window manager only knows of one desktop, it doesn't know you have 2. I think that's why your opened windows will render on the left screen.

Offline

#3 2008-10-23 21:26:25

jordi
Member
Registered: 2006-12-16
Posts: 103
Website

Re: xrandr, dual monitor, openbox - setting the main monitor?

Guess than all I have to do is to put the xrandr command into a little script which also changes my gmrun and conky settings...

Just thought that there might be a more elegant solution.

Thanks.

Offline

#4 2008-10-24 06:54:52

Heller_Barde
Member
Registered: 2008-04-01
Posts: 245

Re: xrandr, dual monitor, openbox - setting the main monitor?

err. there has to be a more elegant solution! big_smile openbox has excellent support for dualheading now.
the xrandr thingie togehter with kde works like this afaicr:

xrandr --output 1 --right-of 2

leads to :

[    screen 2   ] [screen 1 (main)]

maybe this works with openbox just as well

cheers Barde

EDIT: i'm an idiot ^^ there is an option in the openbox configuration file... it's called placement and it's under

<?xml version="1.0" encoding="UTF-8"?>
<openbox_config xmlns="http://openbox.org/3.4/rc">

</snip>

  <placement>
    <policy>Smart</policy>
    <!-- 'Smart' or 'UnderMouse' -->
    <center>yes</center>
    <!-- whether to place windows in the center of the free area found or
       the top left corner -->
    <monitor>Any</monitor>
    <!-- with Smart placement on a multi-monitor system, try to place new windows
       on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
       the active window is -->
  </placement>

</snip>

</openbox_config>

Last edited by Heller_Barde (2008-10-24 06:58:52)

Offline

#5 2008-10-24 08:29:30

jordi
Member
Registered: 2006-12-16
Posts: 103
Website

Re: xrandr, dual monitor, openbox - setting the main monitor?

Thanks Heller_Barde

I knew that configuration option, the problem is that while it does work for regular new windows like terminals, gvim and stuff, it doesn't for conky and gmrun.

These 2 apps get their position within their configuration files and as Frots pointed out xrandr sets up a virtual desktop with a resolution of (in my case) 2800x1050.

So far now I am using this little hack:

xrandr --output VGA-0 --mode 1400x1050 --left-of LVDS
killall conky
sed -i 's/gap_x 4/gap_x 1404/' $HOME/.conkyrc
sed -i 's/Left = 200/Left = 1600/' $HOME/.gmrunrc
sleep 3 && conky &

Now I just need to find a way to move all already opened applications. Guess I will take a look at some kind of python xlib libary

Offline

Board footer

Powered by FluxBB