You are not logged in.

#1 2013-07-30 19:30:15

anadyr
Member
Registered: 2005-02-10
Posts: 225

Fluxbox apps file and aterms

Hi,

I often open two or three aterms in fluxbox, and I want to get these to start at fixed places on the desktop. In the apps file of fluxbox I set dimensions for aterm, but it cannot handle multiple instances of aterm. The second is placed exactly on top of the first, just as the third, the fourth, etc.

Is it somehow possible to distinguish between the first, the second, the third (etc) instances of aterm and make it start at fixed places on the desktop?

Thanks!
Rogier

Offline

#2 2013-07-31 15:25:37

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: Fluxbox apps file and aterms

Not sure about "aterm" but when I launch urxvt I can give it a name, e.g. urxvt -name term1" . That should do it?


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#3 2013-08-03 06:16:40

anadyr
Member
Registered: 2005-02-10
Posts: 225

Re: Fluxbox apps file and aterms

This is possible with the aterm option -title too. But the problem is that, when setting titles or names, you have to launch aterm differently each time. In a fluxbox menu, this means that I have to have different commands, aterm-1, aterm-2, aterm-3, aterm-4 (or something). I would like to have this automated, so that I only have 1 command in the menu.

Offline

#4 2013-08-03 14:49:06

CommanderC
Member
Registered: 2012-10-31
Posts: 14

Re: Fluxbox apps file and aterms

It can be done with the help of xdotool:

#!/bin/bash

names=('aterm-1' 'aterm-2' 'aterm-3' 'aterm-4')
term=aterm
for n in "${names[@]}"; do
    if ! xdotool search --name "$n" 2>&1 >/dev/null; then
        exec "$term" -title "$n"
    fi
done
exec "$term"

But, in my opinion, it is better to use the window classname. This second version uses urxvt:

#!/bin/bash

names=('aterm-1' 'aterm-2' 'aterm-3' 'aterm-4')
term=urxvt
for n in "${names[@]}"; do
    if ! xdotool search --classname "$n" 2>&1 >/dev/null; then
        exec "$term" -name "$n"
    fi
done
exec "$term"

Offline

Board footer

Powered by FluxBB