[clfswm-devel] Some news: new Expos? mode, new toolbar system.

Philipp Kroos Philipp.Kroos at t-online.de
Mon Aug 20 17:40:09 UTC 2012


Hi,

thanks for the update, I really like it!
The expose-mode is great and the toolbar... well, I thought
clfswm won't need one, but it does!

I already made a small module, a button-like-thing that lets you
switch to the expo-mode on click. You can configure if it shows
all or just the current root. Hope I made it right.

You might also want to consider the other patch attached; it adds
a here-placement-function to the core. I did this because with my
two-screen-setup, the mainmenu shows up on the wrong screen when the
focus is there. The here-placement uses the current pointer-position,
what is really convenient. It does not make sense for all placeable
components though, so maybe there is some better solution.

Another thing is this code:
  ;; Miscellaneous Group:
;  *NEVER-MANAGED-WINDOW-LIST* (quote ((#<CLOSURE CLFSWM::IS-TOOLBAR-WINDOW-P> NIL)
;        (CLFSWM::EQUAL-WM-CLASS-ROX-PINBOARD NIL)
;        (CLFSWM::EQUAL-WM-CLASS-XVKBD CLFSWM::RAISE-WINDOW)
;        (CLFSWM::EQUAL-CLFSWM-TERMINAL CLFSWM::RAISE-AND-FOCUS-WINDOW)))

which is written to my rc when I save all variables. It causes the
compilation to fail when uncommented. I don't know why. Maybe the 
closure...?

Beside this, everything works as expected!

Best regards,
Philipp


On Thu, Aug 16, 2012 at 11:19:00PM +0200, Philippe Brochard wrote:
> Hi CLFSWM followers,
> 
> Here are some news of CLFSWM development as I plan to release a new
> clfswm version soon.
> 
> 1) The Exposé mode is again available. Here are some screenshots:
> 
>   http://common-lisp.net/project/clfswm/expose-mode-2.png
>   http://common-lisp.net/project/clfswm/expose-mode.png
> 
>   And indeed, it works over all your root screens.
> 
> 
> 2) The toolbar framework in /contrib is done. I've beginning to write
>   some modules. Here is a screenshot:
> 
>   http://common-lisp.net/project/clfswm/toolbar.png
> 
>   This is for test, but for the story, as this is not seen on the
>   picture, the upper toolbar appear on edge motion contact. The lower
>   one (my actual toolbar) appear on button press.
> 
>   For the record, I paste here the add-toolbar documentation to create a
>   new toolbar in your configuration file:
> 
>   --------------------------------------------------
>   add-toolbar (root-x root-y direction size placement modules
>                       &key (autohide *toolbar-default-autohide*)
>                       (thickness *toolbar-default-thickness*)
>                       (refresh-delay *toolbar-default-refresh-delay*)
>                       (border-size *toolbar-default-border-size*))
>     "Add a new toolbar.
>        root-x, root-y: root coordinates or if root-y is nil, root-x is the nth root in root-list.
>        direction: one of :horiz or :vert
>        placement: same argument as with-placement macro
>        modules: list of modules: a list of module name, position in percent and arguments.
>                 0%=left/up   <->   100%=right/down.
>                 Example: '((clock 1) (label 50 \"My label\") (clickable-clock 90))
>        size: toolbar size in percent of root size
>        thickness: toolbar height for horizontal toolbar or width for vertical one
>        autohide: one of nil, :click, or :motion
>        refresh-delay: refresh delay for toolbar in seconds
>        border-size: toolbar window border size"
> 
>  Here are some examples:
>     (load-contrib "toolbar.lisp")
> 
>   ;; Add an horizontal toolbar on root at coordinates 0,0 pixels
>   ;; with default modules
> 
>     (add-toolbar 0 0 :horiz 80 'top-middle-root-placement *default-toolbar*)
> 
> 
>   ;; Add an horizontal toolbar on root at coordinates 0,0 pixels
> 
>     (add-toolbar 0 0 :horiz 90 'top-middle-root-placement
>                  '((clock 1) (label 50 "Plop") (clock-second 25) (clickable-clock 99))
>                  :autohide :click
>                  :refresh-delay 1)
> 
> 
>   ;; Add an horizontal toolbar on root at coordinates 0,0 pixels
> 
>     (add-toolbar 0 0 :horiz 70 'bottom-middle-root-placement '((clock 1) (label 50 "Paf) (clock 99))
>                  :autohide :motion)
> 
> 
>   ;; Add a vertical toolbar on root 0
> 
>     (add-toolbar 0 nil :vert 60 'middle-left-root-placement '((clock 1) (label 50 "My label") (clock 90)))
> 
> 
>   ;; Add a vertical toolbar on root 1
> 
>     (add-toolbar 1 nil :vert 70 'bottom-right-root-placement '((clock 1) (label 50) (clickable-clock 99)))
>   --------------------------------------------------
> 
> 
> Now, I need your help if you want some particular modules on your
> toolbar.
> I plan to write one for mpd and sound volume, one for navigating in
> clfswm (enter frame, leave frame...). But any other idea or code is very
> welcome!!!
> 
> If you want to write a new toolbar module, you just have to define what
> to do when it must be displayed. And, if needed, what to do when you
> click on it. 
> This is done with the two macros define-toolbar-module and
> define-toolbar-module-click.
> 
> Here is an example. But see contrib/toolbar.lisp for more details (at
> the end of the file):
> 
> (define-toolbar-module (module-name module-arg1 module-arg2...)
>   "...Module documentation..."
>   (action to do on display))
> 
> (define-toolbar-module-click (module-name module-arg1 module-arg2...)
>   "...Module documentation on click..."
>   (action to do on click))
> 
> 
> 
> Please test intensively and share any idea or code.
> I plan to release a new CLFSWM version on the next week I think.
> 
> Best regards,
> 
> Have fun,
> 
> Philippe
> 
> _______________________________________________
> clfswm-devel mailing list
> clfswm-devel at common-lisp.net
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/clfswm-devel
-------------- next part --------------
From ae8be82f09e60d78826d7d3535219ddb6ff80f81 Mon Sep 17 00:00:00 2001
From: Philipp Kroos <Philipp.Kroos at t-online.de>
Date: Mon, 20 Aug 2012 09:13:14 +0200
Subject: [PATCH 1/2] contrib/toolbar.lisp: expose-mode-button-module

---
 ChangeLog            |  4 ++++
 contrib/toolbar.lisp | 19 +++++++++++++++++++
 2 Dateien geändert, 23 Zeilen hinzugefügt(+)

diff --git a/ChangeLog b/ChangeLog
index 9d63d26..44154fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-20  Philipp Kroos  <philipp.kroos at t-online.de>
+
+	* contrib/toolbar.lisp: expose-mode-button-module
+
 2012-08-19  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* contrib/toolbar.lisp (remove-toolbar): New function.
diff --git a/contrib/toolbar.lisp b/contrib/toolbar.lisp
index 0e2b27b..05a5dec 100644
--- a/contrib/toolbar.lisp
+++ b/contrib/toolbar.lisp
@@ -666,3 +666,22 @@
                          cpu
                          (round (* (/ used total) 100)))))
 
+;;;
+;;; Expose-mode-button
+;;;
+(define-toolbar-color expose-mode-button "Expose-mode button")
+
+(defconfig *expose-mode-button-show-all* nil 
+  'toolbar "If t, show all frames. Default: show only frames of current root")
+
+(define-toolbar-module (expose-mode-button text)
+  "On click, switch to expose-mode"
+  (with-set-toolbar-module-rectangle (module)
+      (toolbar-module-text toolbar module (tb-color expose-mode-button) (or text "Xpo"))))
+
+(define-toolbar-module-click (expose-mode-button)
+  "Switch to expose mode"
+  (declare (ignore code state toolbar module))
+  (if *expose-mode-button-show-all*
+    (expose-all-windows-mode)
+    (expose-windows-mode)))
-- 
1.7.11.4

-------------- next part --------------
From c8e8b80fe7f50e78cfaaf6350f9f50ed278eca76 Mon Sep 17 00:00:00 2001
From: Philipp Kroos <Philipp.Kroos at t-online.de>
Date: Mon, 20 Aug 2012 11:36:58 +0200
Subject: [PATCH 2/2] src/clfswm-placement.lisp (here-placement): evaluates to
 current position of pointer

---
 ChangeLog                 | 4 ++++
 src/clfswm-placement.lisp | 5 +++++
 2 Dateien geändert, 9 Zeilen hinzugefügt(+)

diff --git a/ChangeLog b/ChangeLog
index 44154fb..032be33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-08-20  Philipp Kroos  <philipp.kroos at t-online.de>
 
+	* src/clfswm-placement.lisp (here-placement): evaluates to current position of pointer
+
+2012-08-20  Philipp Kroos  <philipp.kroos at t-online.de>
+
 	* contrib/toolbar.lisp: expose-mode-button-module
 
 2012-08-19  Philippe Brochard  <pbrochard at common-lisp.net>
diff --git a/src/clfswm-placement.lisp b/src/clfswm-placement.lisp
index c40901c..31713e9 100644
--- a/src/clfswm-placement.lisp
+++ b/src/clfswm-placement.lisp
@@ -112,6 +112,11 @@
     (values (- w width) (- h height) width height)))
 
 
+(defun here-placement (&optional (width 0) (height 0) (border-size *border-size*))
+  (with-x-pointer
+      (values x y width height)))
+
+
 ;;;
 ;;; Current child placement
 ;;;
-- 
1.7.11.4



More information about the clfswm-devel mailing list