How to filter by command/parent PID ?

Thijs Oppermann thijso at gmail.com
Sun Jun 23 20:41:01 UTC 2013


On Sun, Jun 23, 2013 at 10:37 AM, Thijs Oppermann <thijso at gmail.com> wrote:

> On Sat, Jun 22, 2013 at 4:37 PM, Philippe Brochard <
> pbrochard at common-lisp.net> wrote:
>
>> 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.
>>
>>
> The window id isn't much help, as this is different for each window. I
> want to be able to group all windows of 1 firefox process in 1 frame. That
> is why I want to know the process id of the 'parent' firefox process for
> each window. Then I can group the windows on that PID into 1 frame...
>
>
>> 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
>>
>>
>
I've found how to get the PID of a window:

(xlib:get-property window :_NET_WM_PID))


So this wil enable me to filter on PID I hope. I'll get back to the list
once I have my system working... ;)

thijso
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/clfswm-devel/attachments/20130623/7119a7ec/attachment.html>


More information about the clfswm-devel mailing list