From dochang at gmail.com Thu Jan 27 15:30:34 2011 From: dochang at gmail.com (Desmond O. Chang) Date: Thu, 27 Jan 2011 23:30:34 +0800 Subject: [clfswm-devel] request pull my bugfix patch Message-ID: Hi all, The following changes since commit cd8cf93c1cbc59f83e69f3bcad85b5ea73d5ad89: contrib/osd.lisp (display-doc): Add another method where a CLFSWM native window is used to display the key documentation. (2010-12-29 19:16:05 +0100) are available in the git repository at: git://repo.or.cz/clfswm/dochang.git xdg-default Desmond O. Chang (1): XDG_CONFIG_HOME should be $HOME/.config by default. src/clfswm-util.lisp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Thanks, Des From pbrochard at common-lisp.net Fri Jan 28 22:29:53 2011 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Fri, 28 Jan 2011 23:29:53 +0100 Subject: [clfswm-devel] request pull my bugfix patch In-Reply-To: (Desmond O. Chang's message of "Thu, 27 Jan 2011 23:30:34 +0800") References: Message-ID: <87fwscu0f2.fsf@common-lisp.net> Desmond O. Chang writes: > Hi all, > Hi, welcome on this list and thanks for your interest in clfswm. > The following changes since commit cd8cf93c1cbc59f83e69f3bcad85b5ea73d5ad89: > > contrib/osd.lisp (display-doc): Add another method where a CLFSWM > native window is used to display the key documentation. (2010-12-29 > 19:16:05 +0100) > > are available in the git repository at: > git://repo.or.cz/clfswm/dochang.git xdg-default > > Desmond O. Chang (1): > XDG_CONFIG_HOME should be $HOME/.config by default. > > src/clfswm-util.lisp | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > Applied in the main branch and indeed it's better to always use $HOME/.config instead of just $HOME. > Thanks, > Thank you for your patch. Philippe From dochang at gmail.com Sat Jan 29 21:03:11 2011 From: dochang at gmail.com (Desmond O. Chang) Date: Sun, 30 Jan 2011 05:03:11 +0800 Subject: [clfswm-devel] request pull my bugfix patch In-Reply-To: <87fwscu0f2.fsf@common-lisp.net> References: <87fwscu0f2.fsf@common-lisp.net> Message-ID: Hi Philippe, On Sat, Jan 29, 2011 at 06:29, Philippe Brochard wrote: > Hi, welcome on this list and thanks for your interest in clfswm. I've used stumpwm for 2 years and discover clfswm recently. I like its concept and try to use it these days. I have another question here. How can I "run-or-raise" a program like emacsclient? I put the following in my clfswmrc. (defun b1-start-emacs () "start emacs" (setf *second-mode-leave-function* (lambda () (let* ((win (find "emacs" (xlib:query-tree *root*) :key 'xlib:get-wm-class :test 'string-equal))) (if win (raise-window win) (do-shell "cd $HOME && exec emacsclient -c"))))) (leave-second-mode)) Then I put (define-second-key (#\e) 'b1-start-emacs) in *BINDING-HOOK*. Keybinding works but raising doesn't. I try to use FOCUS-WINDOW to replace RAISE-WINDOW, I fail again. Any advice? Thanks, Des From pbrochard at common-lisp.net Sun Jan 30 10:21:23 2011 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sun, 30 Jan 2011 11:21:23 +0100 Subject: [clfswm-devel] request pull my bugfix patch In-Reply-To: (Desmond O. Chang's message of "Sun, 30 Jan 2011 05:03:11 +0800") References: <87fwscu0f2.fsf@common-lisp.net> Message-ID: <87ei7ubskc.fsf@common-lisp.net> Desmond O. Chang writes: > Hi Philippe, > > On Sat, Jan 29, 2011 at 06:29, Philippe Brochard > wrote: >> Hi, welcome on this list and thanks for your interest in clfswm. > > I've used stumpwm for 2 years and discover clfswm recently. I like > its concept and try to use it these days. > Ah, good! > I have another question here. How can I "run-or-raise" a program like > emacsclient? I put the following in my clfswmrc. > > (defun b1-start-emacs () > "start emacs" > (setf *second-mode-leave-function* > (lambda () > (let* ((win (find "emacs" (xlib:query-tree *root*) > :key 'xlib:get-wm-class :test 'string-equal))) > (if win > (raise-window win) > (do-shell "cd $HOME && exec emacsclient -c"))))) > (leave-second-mode)) > > Then I put (define-second-key (#\e) 'b1-start-emacs) in > *BINDING-HOOK*. Keybinding works but raising doesn't. > > I try to use FOCUS-WINDOW to replace RAISE-WINDOW, I fail again. > > Any advice? > Well, raise-window is a very low function which unhide a window and raise it from the xlib view. The clfswm tree is not updated from this function. You have to do it yourself. Here is how I would write run-or-raise. As I like to have all my windows in fullscreen, I set *current-child* and *current-root* accordingly. Fell free to do as you like. -------------------------------------------------- (defun b1-start-emacs () "start emacs" (setf *second-mode-leave-function* (lambda () (let ((window (block return-block (with-all-windows (*root-frame* win) (when (string-equal "emacs" (xlib:get-wm-class win)) (return-from return-block win)))))) (if window (let ((parent (find-parent-frame window))) (hide-all-children *current-root*) (setf *current-child* parent *current-root* parent (frame-child parent) (nconc (list window) (child-remove window (frame-child parent)))) (show-all-children)) (do-shell "cd $HOME && exec emacsclient -c"))))) (leave-second-mode)) -------------------------------------------------- If this do what you want, I can polish the code a bit more : - with an implicit return-block in with-all-windows or with an additional test parameter in find-child. - with a new function put-child-on-top instead of (nconc (list window) (child-remove window (frame-child parent))) > Thanks, > Des Hope this helps Philippe From dochang at gmail.com Mon Jan 31 03:48:57 2011 From: dochang at gmail.com (Desmond O. Chang) Date: Mon, 31 Jan 2011 11:48:57 +0800 Subject: [clfswm-devel] request pull my bugfix patch In-Reply-To: <87ei7ubskc.fsf@common-lisp.net> References: <87fwscu0f2.fsf@common-lisp.net> <87ei7ubskc.fsf@common-lisp.net> Message-ID: On Sun, Jan 30, 2011 at 18:21, Philippe Brochard wrote: > Well, raise-window is a very low function which unhide a window and > raise it from the xlib view. The clfswm tree is not updated from this > function. You have to do it yourself. > > Here is how I would write run-or-raise. As I like to have all my windows > in fullscreen, I set *current-child* and *current-root* accordingly. > Fell free to do as you like. > > -------------------------------------------------- > (defun b1-start-emacs () > ?"start emacs" > ?(setf *second-mode-leave-function* > ? ? ? ?(lambda () > ? ? ? ? ?(let ((window (block return-block > ? ? ? ? ? ? ? ? ? ? ? ? ?(with-all-windows (*root-frame* win) > ? ? ? ? ? ? ? ? ? ? ? ? ? ?(when (string-equal "emacs" (xlib:get-wm-class win)) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(return-from return-block win)))))) > ? ? ? ? ? ?(if window > ? ? ? ? ? ? ? ?(let ((parent (find-parent-frame window))) > ? ? ? ? ? ? ? ? ?(hide-all-children *current-root*) > ? ? ? ? ? ? ? ? ?(setf *current-child* parent > ? ? ? ? ? ? ? ? ? ? ? ?*current-root* parent > ? ? ? ? ? ? ? ? ? ? ? ?(frame-child parent) (nconc (list window) (child-remove window (frame-child parent)))) > ? ? ? ? ? ? ? ? ?(show-all-children)) > ? ? ? ? ? ? ? ?(do-shell "cd $HOME && exec emacsclient -c"))))) > ?(leave-second-mode)) > -------------------------------------------------- > > If this do what you want, I can polish the code a bit more : > ?- with an implicit return-block in with-all-windows or with an > ? additional test parameter in find-child. > ?- with a new function put-child-on-top instead of > ? (nconc (list window) (child-remove window (frame-child parent))) > >> Thanks, >> Des > Hope this helps Thank you! Your code works well! And I put it into a new function RUN-OR-RAISE. This is the final version in my conffile, for your reference: (defun run-or-raise (raisep run-fn &key (maximized t)) (let ((window (block return-block (with-all-windows (*root-frame* win) (when (funcall raisep win) (return-from return-block win)))))) (if window (let ((parent (find-parent-frame window))) (hide-all-children *current-root*) (setf *current-child* parent (frame-child parent) (cons window (child-remove window (frame-child parent)))) (when maximized (setf *current-root* parent)) (show-all-children)) (funcall run-fn)))) (defun $start-emacs () "start emacs" (setf *second-mode-leave-function* (lambda () (run-or-raise (lambda (win) (string-equal "emacs" (xlib:get-wm-class win))) (lambda () (do-shell "cd $HOME && exec emacsclient -c"))))) (leave-second-mode)) (defun $start-conkeror () "start conkeror" (setf *second-mode-leave-function* (lambda () (run-or-raise (lambda (win) (string-equal "Navigator" (xlib:get-wm-class win))) (lambda () (do-shell "cd $HOME && exec conkeror"))))) (leave-second-mode))