You are not logged in.

#1 2009-01-06 21:43:41

Zetsumei
Member
From: NC
Registered: 2007-09-13
Posts: 156

Trouble with multiple urxvt's in openbox.

I'm having trouble getting two or more urxvt's in different spots in openbox.  I've edited rc.xml for the first one to put it in the bottom left corner, but how would I add another one to say the upper right corner or somewhere else?  Right now I open another one and it just goes on top of the first one, I want it in a different spot.  Anyone know how to achieve this?

Offline

#2 2009-01-06 22:43:30

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: Trouble with multiple urxvt's in openbox.

You might use different -name options for your urxvts so that you can set up different application rules in your rc.xml.
Maybe write a frontend that figures out which of your urxvts is already running (using "wmctrl -l" or "xdotool search") and start the next urxvt in the next free place. (e.g. use names like "urxvt_top_left" "urxvt_bottom_left" etc...)

Offline

#3 2009-01-07 05:02:07

Zetsumei
Member
From: NC
Registered: 2007-09-13
Posts: 156

Re: Trouble with multiple urxvt's in openbox.

How would I name them then and how would I specifiy what name to position in rc.xml?

Offline

#4 2009-01-07 12:19:03

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: Trouble with multiple urxvt's in openbox.

Put this in your rc.xml:

<application name="urxvt_top_left" class="URxvt">
      <decor>no</decor>
      <position><x>0</x><y>0</y></position>
</application>

<application name="urxvt_top_right" class="URxvt">
      <decor>no</decor>
      <position><x>527</x><y>0</y></position>
</application>

<application name="urxvt_bottom_left" class="URxvt">
      <decor>no</decor>
      <position><x>0</x><y>451</y></position>
</application>

<application name="urxvt_bottom_right" class="URxvt">
      <decor>no</decor>
      <position><x>527</x><y>451</y></position>
</application>

Adjust the postitions to your urxvt size... Now you can run

urxvt -name urxvt_bottom_right

To start the urxvt in the bottom right corner. Since this is not too convenient, you can use the following script as a frontend for launching your urxvts:

#!/bin/sh

NAMES=(urxvt_top_left urxvt_top_right urxvt_bottom_left urxvt_bottom_right)

NEXT=0
for NAME in ${NAMES[@]}; do
    if [ "$(xdotool search --name $NAME)" != "" ]; then
        let NEXT++
    fi
done

if [ $NEXT -lt ${#NAMES[@]} ]; then
    NAME=${NAMES[$NEXT]}
else
    NAME="urxvt"
fi

echo "starting urxvt -name $NAME"
urxvt -name $NAME &

It will start a urxvt in the next free position by using the appropriate -name option. If all slots are taken it just starts urxvt with the default name ("urxvt"). The script requires xdotool, which is available in the community repo...

As far as I see it there's no way to do this otherwise in openbox, but i may be mistaken...

Offline

#5 2009-01-07 14:43:57

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Trouble with multiple urxvt's in openbox.

If you want these terminals to start for every session, you can also use urxvt's -geometry option, and run them all from ~/.config/openbox/autostart.sh, or even ~/.xinitrc

Offline

#6 2009-01-07 16:36:21

Zetsumei
Member
From: NC
Registered: 2007-09-13
Posts: 156

Re: Trouble with multiple urxvt's in openbox.

Thanks, I'll give this a try when I get back home.  Thanks for that piece of code and the explanation.

Offline

Board footer

Powered by FluxBB