How to filter by command/parent PID ?

Philippe Brochard pbrochard at common-lisp.net
Sat Jun 22 14:37:17 UTC 2013


Thijs Oppermann writes:

> I've been looking into this, searching a lot, but unable to find what I need.
>
> The situation:
>
> I have multiple profiles for firefox. Everytime I shut down my computer I just
> let them be killed, which means that the next time I start them up they will
> ask me if I want to restore the previous session. These previous sessions often
> consist of multiple windows (with multiple tabs, but that's beside the point).
>
> In my .clfswmrc I've setup a hook so that firefox windows go to the 'browser'
> frame (using absorb-window-nw-hook). But I would really like to have these
> different profiles's windows go to different frames.
>
> How can I set this up? I can't use the window name, as this is the tab title in
> firefox and will be different for each window.
>
> I was thinking if I could find the initial process id (PID) I could somehow
> check if a navigator window was a child of the original PID and then send them
> to the appropriate frame based on that.
>
> In my searches I found a thread on the stumpwm list where someone else seems to
> have been trying the same thing, but sadly the thread stops at a point where it
> remains unresolved:
>
> http://lists.nongnu.org/archive/html/stumpwm-devel/2009-08/msg00002.html
>
> I searched the code for something like the '(xlib:get-property (window-xwin w)
> :_NET_WM_PID)' mentioned there, but no dice.
>
> So, is this possible? Any pointers would be very much appreciated...
>
Hi, two things comes in mind:

1) You can use directly (xlib:window-id window) to know the window id.
But I think it can change each time you reboot.

2) If you always want a different frame for each firefox window, you can
setup a default frame which absorb the first firefox window and then
create a new one for each others.
This can be done with a permanent new window hook (need to be written).

Have a look at clfswm-nw-hooks.lisp. Indeed, you can ask if you want
more details or I can write the code if needed.
And, please, share your results here.

Philippe



More information about the clfswm-devel mailing list