Hi,

On 12/31/2010 10:34 AM, Ronen Narkis wrote:
> Sorry if Im not clear the API is new to me, when I added:
> 
> awful.util.spawn('firefox',true)
> 
> And a rule:
> 
> awful.rules.rules = {
>     -- Set Firefox to always map on tags number 2 of screen 1.
>      { rule = { class = "Firefox" },
>        properties = { tag = tags[1][2] } },
> }
> 
> 
> It did start firefox on the first screen second tag which is what I
> wanted, however iv added also:
> 
> awful.key({ modkey,   }, "f", function () awful.util.spawn("firefox") end),
> 
> When using this key binding all firefox instances load also on the same
> screen tag (instead of the current selected tag),
> 
> I guess that I can add the rule once before the first spawn takes place
> on startup and remove it right after.
> 
> Ronen

There are lots of talks about this in the archives (starting an app on a
specific tag), you can search the mailing list logs. I just thought I
send "my" [1] "solution" [2] which I have created based on the
suggestions here that you save the process id on spawning the program
and in a "manage" signal handler which runs after every window creation,
compare with this process id and move to the tag you need in case it
matches.

I have attached it, it is a shell script (for the git version awesome),
which you would use with 2 paramters, first is the tag on which the
program should start, next is the program name, for example:

awrun.sh 4 x-www-browser

This will start x-www-browser on tag 4. Then you just write your
"startUsualWorkDayDesktop.sh", "startEveningFunDesktop.sh" etc which
contains a bunch of program invocations.

[1] the lua script was posted by someone else, I do not remember :(
[2] This is of course not working in case the window is popped up by
another process (with other pid) than the one which was spawned. For
example if I invoke RoxTerm, and one of it is already running, then it
just notifies the already running instance to pop another window up
(through DBus maybe). So this is not working in this case:

  awrun.sh 3 roxterm

But you will have to use it like this:

  awrun.sh 3 "roxterm --separate"

Same applies to firefox, and a bunch of other applications. However it
is still very usable.

Hope it helps,

Manner Robert

Attachment: awrun.sh
Description: Bourne shell script

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to