From pbrochard at common-lisp.net Sat Jun 22 14:37:17 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 22 Jun 2013 16:37:17 +0200 Subject: How to filter by command/parent PID ? In-Reply-To: (Thijs Oppermann's message of "Fri, 21 Jun 2013 17:09:17 +0200") References: Message-ID: <87k3lmjjoi.fsf@minideb.elcforest> 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 From renaud at casenave-pere.fr Thu Jun 13 01:47:41 2013 From: renaud at casenave-pere.fr (=?iso-8859-1?Q?Renaud_Casenave-P=E9r=E9?=) Date: Thu, 13 Jun 2013 10:47:41 +0900 Subject: [clfswm-devel] Questions / Feature requests regarding the focus policy In-Reply-To: <87r4gisylj.fsf@minideb.elcforest> (Philippe Brochard's message of "Mon, 03 Jun 2013 22:55:52 +0200") References: <87wqt21ivn.fsf@casenave-pere.fr> <87boae5dnt.fsf@common-lisp.net> <12f59786260026ff4cc317acdc0c2745@casenave-pere.fr> <87ppyokcrd.fsf@common-lisp.net> <87k3oww4jd.fsf@casenave-pere.fr> <871uao1zc6.fsf@common-lisp.net> <87d2tzdmxm.fsf@zahikel.casenave.fr> <874nez8uuk.fsf@common-lisp.net> <87haiwg02g.fsf@casenave-pere.fr> <878v477imo.fsf@common-lisp.net> <87txmgaf23.fsf@zahikel.casenave.fr> <877gja8utm.fsf@minideb.elcforest> <87wqr2joiz.fsf@casenave-pere.fr> <87r4gisylj.fsf@minideb.elcforest> Message-ID: <87ehc693ya.fsf@casenave-pere.fr> Hi, On Tue, Jun 04 2013, Philippe Brochard wrote: > Ok, I got it (I hope). This one is pretty vicious since the use of mouse > coordinates to not focus a child is not adequate. > > Please, can you try the commit d5e80bb to see if the problem is solved. I pulled the changes and it is working fine, thank you. Regards, -- Renaud Casenave-P?r? From pbrochard at common-lisp.net Mon Jun 3 20:55:52 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Mon, 03 Jun 2013 22:55:52 +0200 Subject: [clfswm-devel] Questions / Feature requests regarding the focus policy In-Reply-To: <87wqr2joiz.fsf@casenave-pere.fr> ("Renaud \=\?iso-8859-1\?Q\?Cas\?\= \=\?iso-8859-1\?Q\?enave-P\=E9r\=E9\=22's\?\= message of "Tue, 14 May 2013 11:14:44 +0900") References: <87wqt21ivn.fsf@casenave-pere.fr> <87boae5dnt.fsf@common-lisp.net> <12f59786260026ff4cc317acdc0c2745@casenave-pere.fr> <87ppyokcrd.fsf@common-lisp.net> <87k3oww4jd.fsf@casenave-pere.fr> <871uao1zc6.fsf@common-lisp.net> <87d2tzdmxm.fsf@zahikel.casenave.fr> <874nez8uuk.fsf@common-lisp.net> <87haiwg02g.fsf@casenave-pere.fr> <878v477imo.fsf@common-lisp.net> <87txmgaf23.fsf@zahikel.casenave.fr> <877gja8utm.fsf@minideb.elcforest> <87wqr2joiz.fsf@casenave-pere.fr> Message-ID: <87r4gisylj.fsf@minideb.elcforest> Renaud Casenave-P?r? a ?crit : > Hi, > > On Wed, May 08 2013, Philippe Brochard wrote: > >>> Regarding the sloppy-select-window focus policy, I noticed a strange behavior: >>> If you move the mouse to select a window, it will focus the window as expected, >>> but if you then use run-or-raise to focus another window, the focus will quickly >>> return to where the mouse is. After it has returned, you can use run-or-raise >>> again without problem but it doesn't work the first time, every time you use >>> the mouse to focus a window. >>> >> I have added a test to take care of *steal-focus* variable in >> run-or-raise (you have to set it to nil). > > That's not really what I meant. I think the problem is not with *steal-focus* > but with the sloppy-select-window. In fact, the problem persists even when > *steal-focus* is t. You can reproduce it this way: > > Set the sloppy-select-window focus policy. > Create two frames within the root. > Have a window you can run-or-raise with a shortcut in one frame. > Put the mouse on the other frame. > > At this point, the focus is on the empty frame, where the mouse is. > > Use the keyboard shortcut to focus the window in the first frame. > > Now, the focus go to the window, but only for a second, before it returns to the > frame where the mouse is. > > If now you use the run-or-raise shortcut once again, the focus go to the window > and stays there, as it should. > > I can reproduce this problem every time I move the mouse. > Ok, I got it (I hope). This one is pretty vicious since the use of mouse coordinates to not focus a child is not adequate. Please, can you try the commit d5e80bb to see if the problem is solved. > > And actually, I think your last change introduced another problem... If you have > a frame in fullscreen and you want to run-or-raise a window in another frame, it > doesn't work if *steal-focus* is nil... > Yes, I've removed it. Sorry for the git noise... > > Sorry for being that annoying :/ > No problem, I think we really want all bugs fixed in clfswm and your request is very helpful! Regards, Philippe From pbrochard at common-lisp.net Sun Jun 23 22:05:42 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Mon, 24 Jun 2013 00:05:42 +0200 Subject: How to filter by command/parent PID ? In-Reply-To: (Thijs Oppermann's message of "Sun, 23 Jun 2013 22:41:01 +0200") References: <87k3lmjjoi.fsf@minideb.elcforest> Message-ID: <87zjugwki1.fsf@minideb.elcforest> Thijs Oppermann writes: [...] > 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... ;) > Ok, nice. It seems I've completely miss the point... Your feedback is very welcome. Philippe From pbrochard at common-lisp.net Wed Jun 12 21:18:18 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Wed, 12 Jun 2013 23:18:18 +0200 Subject: clfswm: devel mailing list (and others?) and a small patch to asd file In-Reply-To: (Thijs Oppermann's message of "Wed, 12 Jun 2013 08:44:56 +0200") References: Message-ID: <8738snrpt1.fsf@minideb.elcforest> Thijs Oppermann writes: > I have tried to find other paths to get the below minimal patch to you, but the > links to the clfswm-devel mailing list main info is broken. At least, I get an > nginx error (404 Not Found) when I follow the link to "more info" ( http:// > lists.common-lisp.net/cgi-bin/mailman/listinfo/clfswm-devel ). Is that me, or > it the setup broken? > Hi. Since the change from mailman to mlmmj the mailing list subscription is broken. I'm waiting it stabilize before doing something. For the time, it seems that you can subscribe to the ml with an email subscription to: clfswm-devel+subscribe at common-lisp.net > I wanted to send you the below patch to the clfswm.asd file, so that I can more > easily use contrib modules when I use quicklisp to get clfswm. Quicklisp puts > clfswm in its own 'dists/quicklisp/software' directory, but to support multiple > versions it puts it in a directory named something like: "clfswm-20130420-git". > So when a new version is added in quicklisp the directory will change, and so > will the location where I should get the contrib modules. > > With this small addition to the top of clfswm.asd I can get this location > through the clfswm code itself: > > -------------8<------------ > ?;;;; -*- Mode: Lisp -*- > ;;;; Author: Philippe Brochard > ;;;; ASDF System Definition > ;;; > > > + (defpackage #:clfswm-config (:export #:*base-directory*)) > + (defparameter clfswm-config:*base-directory* > + ? (make-pathname :name nil :type nil :defaults *load-truename*)) > > > (in-package #:asdf) > -------------8<------------ > > > > With that in the asd file I can do this in my .clfswmrc > > -------------8<------------ > (defparameter *contrib-dir* (truename (format nil "~acontrib/" > clfswm-config:*base-directory*))) > > (load-contrib "toolbar.lisp") > -------------8<------------ > > This technique I adapted from Xach's journal some time ago. I'm sure there are > other ways to do this, but in it would be nice if I can ask the code itself > where its base directory is. > Thanks, I'll have a look at this this weekend. > Let me end this with saying I really like clfswm and have been playing with it > for a couple of weeks now. It has already graduated to my main window manager > at home, and soon at work I will switch to it as well. It just let's me do what > I want without getting in the way. > Really nice to hear! > And, major bonus, I can just change or add stuff to it if I need it. For > example, I'd like to be able to have a certain frame capture mutliple types of > programs automatically (for example, amarok and volume control). I don't think > it can be done as is (I think?), but I've already started thinking on how I can > add this functionality myself... So maybe expect some more patches... ;) > Well, here is how I do with surf class window. I think you can adapt it for your needs: -8<------------------------------------------------- (defun set-surf-frame-nw-hook (&optional (frame (current-child))) "Open the window in the Surf frame if it match surf absorb-nw-test" (when (frame-p frame) (setf (frame-nw-hook frame) 'absorb-window-nw-hook (frame-data-slot frame :nw-absorb-test) (nw-absorb-test-class "surf")) (make-permanent-nw-hook-frame frame))) (defun init-surf-frame () ... (let ((frame ...find here the capturing frame you want...)) (set-surf-frame-nw-hook frame) ...)) (add-hook *init-hook* 'init-surf-frame)) -8<------------------------------------------------- You can have a look at how it works in clfswm-nw-hooks.lisp (nw is for new window). And you'll have to adapt the (nw-absorb-test-class "surf") function (build your own lambda form). > Which I'll probably do by git pull request? Is that the prefered way? > Yes, this is the way. > Thanks again for this great window manager! > Thanks a lot for your feedback! > Thijs > Philippe From thijso at gmail.com Fri Jun 21 15:09:17 2013 From: thijso at gmail.com (Thijs Oppermann) Date: Fri, 21 Jun 2013 17:09:17 +0200 Subject: How to filter by command/parent PID ? Message-ID: 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... thijso -------------- next part -------------- An HTML attachment was scrubbed... URL: From thijso at gmail.com Sun Jun 23 20:41:01 2013 From: thijso at gmail.com (Thijs Oppermann) Date: Sun, 23 Jun 2013 22:41:01 +0200 Subject: How to filter by command/parent PID ? In-Reply-To: References: <87k3lmjjoi.fsf@minideb.elcforest> Message-ID: On Sun, Jun 23, 2013 at 10:37 AM, Thijs Oppermann 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: From thijso at gmail.com Sun Jun 23 08:37:07 2013 From: thijso at gmail.com (Thijs Oppermann) Date: Sun, 23 Jun 2013 10:37:07 +0200 Subject: How to filter by command/parent PID ? In-Reply-To: <87k3lmjjoi.fsf@minideb.elcforest> References: <87k3lmjjoi.fsf@minideb.elcforest> Message-ID: 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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: