From pbrochard at common-lisp.net Sat Nov 7 11:47:32 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 07 Nov 2009 06:47:32 -0500 Subject: [clfswm-cvs] r254 - clfswm Message-ID: Author: pbrochard Date: Sat Nov 7 06:47:31 2009 New Revision: 254 Log: TODO update Modified: clfswm/TODO Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Sat Nov 7 06:47:31 2009 @@ -7,7 +7,9 @@ =============== Should handle these soon. -- Mouse support in menu +- Mouse support in menu -> very urgent + +- Close/Kill/Unhide... menu bound to control+escape key - Show config -> list and display documentation for all tweakable global variables. [Philippe] TODO : From pbrochard at common-lisp.net Sat Nov 7 21:33:21 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 07 Nov 2009 16:33:21 -0500 Subject: [clfswm-cvs] r255 - in clfswm: . src Message-ID: Author: pbrochard Date: Sat Nov 7 16:33:20 2009 New Revision: 255 Log: Simplification of Escape key to close/kill/remove the focus window and unhide all windows. Modified: clfswm/ChangeLog clfswm/src/bindings-second-mode.lisp clfswm/src/bindings.lisp clfswm/src/clfswm-corner.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sat Nov 7 16:33:20 2009 @@ -1,3 +1,16 @@ +2009-11-07 Philippe Brochard + + * src/bindings-second-mode.lisp (set-default-second-keys): + Simplification of Escape key to close/kill/remove the focus window + and unhide all windows. + + * src/bindings.lisp (set-default-main-keys): Simplification of + Escape key to close/kill/remove the focus window and unhide all + windows. + + * src/clfswm-util.lisp (ask-close/kill-current-window): Add remove + focus and unhide all windows capabilities. + 2009-10-10 Philippe Brochard * contrib/mpd.lisp (start-gmpc): Add gmpc in the mpd menu. Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Sat Nov 7 16:33:20 2009 @@ -119,10 +119,7 @@ (define-second-key (#\o :control) 'set-open-in-new-frame-in-root-frame-nw-hook) (define-second-key (#\a) 'add-default-frame) ;; Escape - (define-second-key ("Escape" :control :shift) 'delete-focus-window) - (define-second-key ("Escape" :mod-1 :control :shift) 'destroy-focus-window) - (define-second-key ("Escape" :control) 'remove-focus-window) - (define-second-key ("Escape" :shift) 'unhide-all-windows-in-current-child) + (define-second-key ("Escape" :control) 'ask-close/kill-current-window) ;; Selection (define-second-key ("x" :control) 'cut-current-child) (define-second-key ("x" :control :mod-1) 'clear-selection) Modified: clfswm/src/bindings.lisp ============================================================================== --- clfswm/src/bindings.lisp (original) +++ clfswm/src/bindings.lisp Sat Nov 7 16:33:20 2009 @@ -64,10 +64,8 @@ (define-main-key ("Menu" :control) 'toggle-show-root-frame) (define-main-key (#\b :mod-1) 'banish-pointer) ;; Escape - (define-main-key ("Escape" :control :shift) 'delete-focus-window) - (define-main-key ("Escape" :mod-1 :control :shift) 'destroy-focus-window) - (define-main-key ("Escape" :control) 'remove-focus-window) - (define-main-key ("Escape" :shift) 'unhide-all-windows-in-current-child) + (define-main-key ("Escape" :control) 'ask-close/kill-current-window) + ;; Second mode (define-main-key (#\t :mod-1) 'second-key-mode) (define-main-key ("less" :control) 'second-key-mode) ;; Bind or jump functions Modified: clfswm/src/clfswm-corner.lisp ============================================================================== --- clfswm/src/clfswm-corner.lisp (original) +++ clfswm/src/clfswm-corner.lisp Sat Nov 7 16:33:20 2009 @@ -54,7 +54,7 @@ ((and (<= 0 x cs) (<= (- sh cs) y sh)) :bottom-left) ((and (<= (- sw cs) x sw) (<= (- sh cs) y sh)) :bottom-right) (t nil)))) - + @@ -147,11 +147,3 @@ t) -(defun ask-close/kill-current-window () - "Close or kill the current window (ask before doing anything)" - (let ((window (xlib:input-focus *display*))) - (when (and window (not (xlib:window-equal window *no-focus-window*))) - (info-mode-menu `(,(format nil "Focus window: ~A" (xlib:wm-name window)) - (#\c delete-focus-window "Close the focus window") - (#\k destroy-focus-window "Kill the focus window")))))) - Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Sat Nov 7 16:33:20 2009 @@ -103,7 +103,7 @@ (show-all-children)))) (defun remove-focus-window () - "Remove the focus window in the current frame" + "Remove the focus window from the current frame" (let ((window (xlib:input-focus *display*))) (when (and window (not (xlib:window-equal window *no-focus-window*))) (setf *current-child* *current-root*) @@ -1240,3 +1240,19 @@ +;;; Close/Kill focused window + +(defun ask-close/kill-current-window () + "Close or kill the current window (ask before doing anything)" + (let ((window (xlib:input-focus *display*))) + (info-mode-menu + (if (and window (not (xlib:window-equal window *no-focus-window*))) + `(,(format nil "Focus window: ~A" (xlib:wm-name window)) + (#\c delete-focus-window "Close the focus window") + (#\k destroy-focus-window "Kill the focus window") + (#\r remove-focus-window) + (#\u unhide-all-windows-in-current-child)) + `(,(format nil "Focus window: None") + (#\u unhide-all-windows-in-current-child)))))) + + Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Sat Nov 7 16:33:20 2009 @@ -59,9 +59,9 @@ x y width height border-width value-mask &allow-other-keys) (declare (ignore event-slots)) (labels ((has-x (mask) (= 1 (logand mask 1))) - (has-y (mask) (= 2 (logand mask 2))) - (has-w (mask) (= 4 (logand mask 4))) - (has-h (mask) (= 8 (logand mask 8))) + (has-y (mask) (= 2 (logand mask 2))) + (has-w (mask) (= 4 (logand mask 4))) + (has-h (mask) (= 8 (logand mask 8))) (has-bw (mask) (= 16 (logand mask 16))) (has-stackmode (mask) (= 64 (logand mask 64))) (adjust-from-request () From pbrochard at common-lisp.net Sun Nov 8 14:05:20 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sun, 08 Nov 2009 09:05:20 -0500 Subject: [clfswm-cvs] r256 - in clfswm: . doc src Message-ID: Author: pbrochard Date: Sun Nov 8 09:05:18 2009 New Revision: 256 Log: TODO update. Add a read-conf-file-p parameter to prevent reading the configuration file. Modified: clfswm/ChangeLog clfswm/TODO clfswm/doc/keys.html clfswm/doc/keys.txt clfswm/doc/menu.html clfswm/doc/menu.txt clfswm/load.lisp clfswm/src/clfswm.lisp Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sun Nov 8 09:05:18 2009 @@ -1,3 +1,10 @@ +2009-11-08 Philippe Brochard + + * src/clfswm.lisp (main): Add a read-conf-file-p parameter to + prevent reading the configuration file (this may be useful to + produce the original documentation without user modifications + with the rc configuration file). + 2009-11-07 Philippe Brochard * src/bindings-second-mode.lisp (set-default-second-keys): Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Sun Nov 8 09:05:18 2009 @@ -9,8 +9,6 @@ - Mouse support in menu -> very urgent -- Close/Kill/Unhide... menu bound to control+escape key - - Show config -> list and display documentation for all tweakable global variables. [Philippe] TODO : In ~/.clfswmrc: Modified: clfswm/doc/keys.html ============================================================================== --- clfswm/doc/keys.html (original) +++ clfswm/doc/keys.html Sun Nov 8 09:05:18 2009 @@ -263,46 +263,13 @@ - Control Shift - - - Escape - - - Close focus window: Delete the focus window in all frames and workspaces - - - - - Mod-1 Control Shift - - - Escape - - - Kill focus window: Destroy the focus window in all frames and workspaces - - - - Control Escape - Remove the focus window in the current frame - - - - - Shift - - - Escape - - - Unhide all hidden windows into the current child + Close or kill the current window (ask before doing anything) @@ -437,17 +404,6 @@ Bind or jump to a slot (a frame or a window) - - - Mod-1 - - - F2 - - - Open the Music Player Daemon (MPD) menu - -

@@ -1005,46 +961,13 @@ - Control Shift - - - Escape - - - Close focus window: Delete the focus window in all frames and workspaces - - - - - Mod-1 Control Shift - - - Escape - - - Kill focus window: Destroy the focus window in all frames and workspaces - - - - Control Escape - Remove the focus window in the current frame - - - - - Shift - - - Escape - - - Unhide all hidden windows into the current child + Close or kill the current window (ask before doing anything) Modified: clfswm/doc/keys.txt ============================================================================== --- clfswm/doc/keys.txt (original) +++ clfswm/doc/keys.txt Sun Nov 8 09:05:18 2009 @@ -27,10 +27,7 @@ Shift Menu Show all frames info windows Control Menu Show/Hide the root frame Mod-1 B Move the pointer to the lower right corner of the screen - Control Shift Escape Close focus window: Delete the focus window in all frames and workspaces - Mod-1 Control Shift Escape Kill focus window: Destroy the focus window in all frames and workspaces - Control Escape Remove the focus window in the current frame - Shift Escape Unhide all hidden windows into the current child + Control Escape Close or kill the current window (ask before doing anything) Mod-1 T Switch to editing mode Control Less Switch to editing mode Mod-1 1 Bind or jump to a slot (a frame or a window) @@ -43,7 +40,6 @@ Mod-1 8 Bind or jump to a slot (a frame or a window) Mod-1 9 Bind or jump to a slot (a frame or a window) Mod-1 0 Bind or jump to a slot (a frame or a window) - Mod-1 F2 Open the Music Player Daemon (MPD) menu Mouse buttons actions in main mode: @@ -103,10 +99,7 @@ O Open the next window in a new frame in the parent frame Control O Open the next window in a new frame in the root frame A Add a default frame in the current frame - Control Shift Escape Close focus window: Delete the focus window in all frames and workspaces - Mod-1 Control Shift Escape Kill focus window: Destroy the focus window in all frames and workspaces - Control Escape Remove the focus window in the current frame - Shift Escape Unhide all hidden windows into the current child + Control Escape Close or kill the current window (ask before doing anything) Control X Cut the current child to the selection Mod-1 Control X Clear the current selection Control C Copy the current child to the selection Modified: clfswm/doc/menu.html ============================================================================== --- clfswm/doc/menu.html (original) +++ clfswm/doc/menu.html Sun Nov 8 09:05:18 2009 @@ -76,75 +76,834 @@ m: Show current processes sorted by memory usage

- x: < XMMS menu > + v: Show the current CLFSWM version +

+
+

+ Standard-Menu +

+

+ a: < WINDOW MANAGERS > +

+

+ b: < APPLICATIONS > +

+

+ c: < GAMES > +

+

+ d: < HELP > +

+
+

+ Window Managers +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+
+

+ Applications +

+

+ a: < SYSTEM > +

+

+ b: < OFFICE > +

+

+ c: < NETWORK > +

+

+ d: < VIDEO > +

+

+ e: < SCIENCE > +

+

+ f: < SOUND > +

+

+ g: < TERMINAL EMULATORS > +

+

+ h: < VIEWERS > +

+

+ i: < FILE MANAGEMENT > +

+

+ j: < TEXT > +

+

+ k: < GRAPHICS > +

+

+ l: < EDITORS > +

+

+ m: < DATA MANAGEMENT > +

+

+ n: < PROGRAMMING > +

+

+ o: < TOOLS > +

+

+ p: < SHELLS > +

+

+ q: < ACCESSIBILITY > +

+
+

+ System +

+

+ a: < HARDWARE > +

+

+ b: < ADMINISTRATION > +

+

+ c: < MONITORING > +

+

+ d: < PACKAGE MANAGEMENT > +

+

+ e: < SECURITY > +

+

+ f: < LANGUAGE ENVIRONMENT > +

+

+ g: X Window Snapshot +

+

+ h: X Window Snapshot +

+
+

+ Hardware +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+
+

+ Administration +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+

+ g: X Window Snapshot +

+

+ h: X Window Snapshot +

+

+ i: X Window Snapshot +

+

+ j: X Window Snapshot +

+

+ k: X Window Snapshot +

+

+ l: X Window Snapshot +

+

+ m: X Window Snapshot +

+

+ n: X Window Snapshot +

+

+ o: X Window Snapshot +

+

+ p: X Window Snapshot +

+

+ q: X Window Snapshot +

+

+ r: X Window Snapshot +

+

+ s: X Window Snapshot +

+

+ t: X Window Snapshot +

+

+ u: X Window Snapshot +

+

+ v: X Window Snapshot +

+

+ w: X Window Snapshot +

+

+ x: X Window Snapshot +

+

+ y: X Window Snapshot +

+
+

+ Monitoring +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+

+ g: X Window Snapshot +

+
+

+ Package Management +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+
+

+ Security +

+

+ a: X Window Snapshot +

+
+

+ Language Environment +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+

+ g: X Window Snapshot +

+

+ h: X Window Snapshot +

+

+ i: X Window Snapshot +

+

+ j: X Window Snapshot +

+

+ k: X Window Snapshot +

+

+ l: X Window Snapshot +

+

+ m: X Window Snapshot +

+

+ n: X Window Snapshot +

+

+ o: X Window Snapshot +

+

+ p: X Window Snapshot +

+

+ q: X Window Snapshot +

+

+ r: X Window Snapshot +

+

+ s: X Window Snapshot +

+
+

+ Office +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+
+

+ Network +

+

+ a: < WEB BROWSING > +

+

+ b: < COMMUNICATION > +

+

+ c: < MONITORING > +

+

+ d: < FILE TRANSFER > +

+

+ e: < WEB NEWS > +

+
+

+ Web Browsing +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+
+

+ Communication +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+

+ g: X Window Snapshot +

+
+

+ Monitoring +

+

+ a: X Window Snapshot +

+
+

+ File Transfer +

+

+ a: X Window Snapshot

- v: Show the current CLFSWM version + b: X Window Snapshot +

+
+

+ Web News +

+

+ a: X Window Snapshot +

+
+

+ Video +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+
+

+ Science +

+

+ a: < MATHEMATICS > +

+
+

+ Mathematics +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot

- i: < CD info menu > + d: X Window Snapshot

- F2: < Music Player Daemon (MPD) menu > + e: X Window Snapshot


- Xmms-Info-Menu + Sound

- s: Show the current xmms status + a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+

+ g: X Window Snapshot +

+

+ h: X Window Snapshot +

+

+ i: X Window Snapshot +

+

+ j: X Window Snapshot +

+

+ k: X Window Snapshot +

+

+ l: X Window Snapshot +

+

+ m: X Window Snapshot +

+

+ n: X Window Snapshot +

+

+ o: X Window Snapshot

- l: Show the current xmms playlist + p: X Window Snapshot


- Info-On-Cd-Menu + Terminal Emulators

- i: Show the current CD track + a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot

- l: Show the current CD playlist + d: X Window Snapshot


- Mpd-Menu + Viewers

- i: Show MPD informations + a: X Window Snapshot

- p: Play the previous song in the current playlist + b: X Window Snapshot

- n: Play the next song in the current playlist + c: X Window Snapshot

- t: Toggles Play/Pause, plays if stopped + d: X Window Snapshot

- y: Start playing + e: X Window Snapshot

- k: Stop the currently playing playlists + f: X Window Snapshot

- x: Seeks to +5% + g: X Window Snapshot

- w: Seeks to -5% + h: X Window Snapshot

- l: Show the current MPD playlist + i: X Window Snapshot

- s: Start sonata + j: X Window Snapshot


- Standard-Menu + File Management +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+
+

+ Text +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+
+

+ Graphics +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+
+

+ Editors +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+
+

+ Data Management +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+
+

+ Programming +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+
+

+ Tools +

+

+ a: X Window Snapshot +

+
+

+ Shells +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+
+

+ Accessibility +

+

+ a: X Window Snapshot +

+
+

+ Games +

+

+ a: < ACTION > +

+

+ b: < BOARD > +

+

+ c: < CARD > +

+

+ d: < PUZZLES > +

+

+ e: < BLOCKS > +

+

+ f: < TOYS > +

+
+

+ Action +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+
+

+ Board +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+

+ g: X Window Snapshot +

+
+

+ Card +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+
+

+ Puzzles +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+
+

+ Blocks +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+
+

+ Toys +

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +

+

+ e: X Window Snapshot +

+

+ f: X Window Snapshot +

+
+

+ Help

+

+ a: X Window Snapshot +

+

+ b: X Window Snapshot +

+

+ c: X Window Snapshot +

+

+ d: X Window Snapshot +


Child-Menu @@ -272,6 +1031,12 @@ h: Tile child in its frame (horizontal)

+ c: One column layout +

+

+ l: One line layout +

+

s: Tile Space: tile child in its frame leaving spaces between them


Modified: clfswm/doc/menu.txt ============================================================================== --- clfswm/doc/menu.txt (original) +++ clfswm/doc/menu.txt Sun Nov 8 09:05:18 2009 @@ -22,32 +22,309 @@ d: Show the current time and date p: Show current processes sorted by CPU usage m: Show current processes sorted by memory usage -x: < XMMS menu > v: Show the current CLFSWM version -i: < CD info menu > -F2: < Music Player Daemon (MPD) menu > - -Xmms-Info-Menu -s: Show the current xmms status -l: Show the current xmms playlist - -Info-On-Cd-Menu -i: Show the current CD track -l: Show the current CD playlist - -Mpd-Menu -i: Show MPD informations -p: Play the previous song in the current playlist -n: Play the next song in the current playlist -t: Toggles Play/Pause, plays if stopped -y: Start playing -k: Stop the currently playing playlists -x: Seeks to +5% -w: Seeks to -5% -l: Show the current MPD playlist -s: Start sonata Standard-Menu +a: < WINDOW MANAGERS > +b: < APPLICATIONS > +c: < GAMES > +d: < HELP > + +Window Managers +a: X Window Snapshot +b: X Window Snapshot + +Applications +a: < SYSTEM > +b: < OFFICE > +c: < NETWORK > +d: < VIDEO > +e: < SCIENCE > +f: < SOUND > +g: < TERMINAL EMULATORS > +h: < VIEWERS > +i: < FILE MANAGEMENT > +j: < TEXT > +k: < GRAPHICS > +l: < EDITORS > +m: < DATA MANAGEMENT > +n: < PROGRAMMING > +o: < TOOLS > +p: < SHELLS > +q: < ACCESSIBILITY > + +System +a: < HARDWARE > +b: < ADMINISTRATION > +c: < MONITORING > +d: < PACKAGE MANAGEMENT > +e: < SECURITY > +f: < LANGUAGE ENVIRONMENT > +g: X Window Snapshot +h: X Window Snapshot + +Hardware +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot + +Administration +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot +g: X Window Snapshot +h: X Window Snapshot +i: X Window Snapshot +j: X Window Snapshot +k: X Window Snapshot +l: X Window Snapshot +m: X Window Snapshot +n: X Window Snapshot +o: X Window Snapshot +p: X Window Snapshot +q: X Window Snapshot +r: X Window Snapshot +s: X Window Snapshot +t: X Window Snapshot +u: X Window Snapshot +v: X Window Snapshot +w: X Window Snapshot +x: X Window Snapshot +y: X Window Snapshot + +Monitoring +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot +g: X Window Snapshot + +Package Management +a: X Window Snapshot +b: X Window Snapshot + +Security +a: X Window Snapshot + +Language Environment +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot +g: X Window Snapshot +h: X Window Snapshot +i: X Window Snapshot +j: X Window Snapshot +k: X Window Snapshot +l: X Window Snapshot +m: X Window Snapshot +n: X Window Snapshot +o: X Window Snapshot +p: X Window Snapshot +q: X Window Snapshot +r: X Window Snapshot +s: X Window Snapshot + +Office +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot + +Network +a: < WEB BROWSING > +b: < COMMUNICATION > +c: < MONITORING > +d: < FILE TRANSFER > +e: < WEB NEWS > + +Web Browsing +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot + +Communication +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot +g: X Window Snapshot + +Monitoring +a: X Window Snapshot + +File Transfer +a: X Window Snapshot +b: X Window Snapshot + +Web News +a: X Window Snapshot + +Video +a: X Window Snapshot +b: X Window Snapshot + +Science +a: < MATHEMATICS > + +Mathematics +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot + +Sound +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot +g: X Window Snapshot +h: X Window Snapshot +i: X Window Snapshot +j: X Window Snapshot +k: X Window Snapshot +l: X Window Snapshot +m: X Window Snapshot +n: X Window Snapshot +o: X Window Snapshot +p: X Window Snapshot + +Terminal Emulators +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot + +Viewers +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot +g: X Window Snapshot +h: X Window Snapshot +i: X Window Snapshot +j: X Window Snapshot + +File Management +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot + +Text +a: X Window Snapshot +b: X Window Snapshot + +Graphics +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot + +Editors +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot + +Data Management +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot + +Programming +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot + +Tools +a: X Window Snapshot + +Shells +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot + +Accessibility +a: X Window Snapshot + +Games +a: < ACTION > +b: < BOARD > +c: < CARD > +d: < PUZZLES > +e: < BLOCKS > +f: < TOYS > + +Action +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot + +Board +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot +g: X Window Snapshot + +Card +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot + +Puzzles +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot + +Blocks +a: X Window Snapshot +b: X Window Snapshot + +Toys +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot +e: X Window Snapshot +f: X Window Snapshot + +Help +a: X Window Snapshot +b: X Window Snapshot +c: X Window Snapshot +d: X Window Snapshot Child-Menu r: Rename the current child @@ -94,6 +371,8 @@ Frame-Tile-Layout-Menu v: Tile child in its frame (vertical) h: Tile child in its frame (horizontal) +c: One column layout +l: One line layout s: Tile Space: tile child in its frame leaving spaces between them Frame-Tile-Dir-Layout-Menu Modified: clfswm/load.lisp ============================================================================== --- clfswm/load.lisp (original) +++ clfswm/load.lisp Sun Nov 8 09:05:18 2009 @@ -54,4 +54,9 @@ (in-package :clfswm) -(clfswm:main) +(ignore-errors + (main :read-conf-file-p t)) + +;;(produce-all-docs) + + Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Sun Nov 8 09:05:18 2009 @@ -305,9 +305,11 @@ (defun main-unprotected (&key (display (or (getenv "DISPLAY") ":0")) protocol (base-dir (directory-namestring (or *load-truename* ""))) + (read-conf-file-p t) error-msg) (setf *contrib-dir* base-dir) - (read-conf-file) + (when read-conf-file-p + (read-conf-file)) (handler-case (open-display display protocol) (xlib:access-error (c) @@ -336,12 +338,14 @@ (defun main (&key (display (or (getenv "DISPLAY") ":0")) protocol - (base-dir (directory-namestring (or *load-truename* "")))) + (base-dir (directory-namestring (or *load-truename* ""))) + (read-conf-file-p t)) (let (error-msg) (catch 'exit-clfswm (loop (handler-case (main-unprotected :display display :protocol protocol :base-dir base-dir + :read-conf-file-p read-conf-file-p :error-msg error-msg) (error (c) (let ((msg (format nil "CLFSWM Error: ~A." c))) From pbrochard at common-lisp.net Sun Nov 8 14:18:58 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sun, 08 Nov 2009 09:18:58 -0500 Subject: [clfswm-cvs] r257 - in clfswm: . contrib Message-ID: Author: pbrochard Date: Sun Nov 8 09:18:58 2009 New Revision: 257 Log: Add a Suspend/Reboot/Halt menu in contrib Added: clfswm/contrib/reboot-halt.lisp Modified: clfswm/ChangeLog Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sun Nov 8 09:18:58 2009 @@ -1,5 +1,8 @@ 2009-11-08 Philippe Brochard + * contrib/reboot-halt.lisp: Add a Suspend/Reboot/Halt menu in + contrib. + * src/clfswm.lisp (main): Add a read-conf-file-p parameter to prevent reading the configuration file (this may be useful to produce the original documentation without user modifications Added: clfswm/contrib/reboot-halt.lisp ============================================================================== --- (empty file) +++ clfswm/contrib/reboot-halt.lisp Sun Nov 8 09:18:58 2009 @@ -0,0 +1,72 @@ +;;; -------------------------------------------------------------------------- +;;; CLFSWM - FullScreen Window Manager +;;; +;;; -------------------------------------------------------------------------- +;;; Documentation: Reboot and halt menu +;;; -------------------------------------------------------------------------- +;;; +;;; (C) 2009 Philippe Brochard +;;; +;;; This program is free software; you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program; if not, write to the Free Software +;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +;;; +;;; Documentation: If you want to use this file, just add this line in +;;; your configuration file: +;;; +;;; (load-contrib "mpd.lisp") +;;; +;;; -------------------------------------------------------------------------- + +(in-package :clfswm) + +(format t "Loading Reboot/Halt code... ") + + +(defun reboot-halt-menu () + "Open the Reboot/Halt menu" + (open-menu (find-menu 'reboot-halt-menu))) + + +(defun do-with-terminal (command) + ;;(do-shell (format nil "xterm -e '~A'" command))) + (do-shell (format nil "xterm -e 'echo ~A; sleep 3'" command))) ;; test + +(defun do-suspend () + "Suspend the computer to RAM" + (do-with-terminal "sudo pm-suspend")) + +(defun do-reboot () + "Reboot the computer" + (do-with-terminal "sudo reboot")) + +(defun do-halt () + "Halt the computer" + (do-with-terminal "sudo halt")) + +(unless (find-menu 'reboot-halt-menu) + (add-sub-menu 'help-menu "Pause" 'reboot-halt-menu "Suspend/Reboot/Halt menu") + + (add-menu-key 'reboot-halt-menu "s" 'do-suspend) + (add-menu-key 'reboot-halt-menu "r" 'do-reboot) + (add-menu-key 'reboot-halt-menu "h" 'do-halt) + (add-menu-key 'reboot-halt-menu "Return" 'do-suspend) + (add-menu-key 'reboot-halt-menu "space" 'do-suspend)) + + +(defun reboot-halt-binding () + (define-main-key ("Pause") 'reboot-halt-menu)) + +(add-hook *binding-hook* 'reboot-halt-binding) + +(format t "done~%") From pbrochard at common-lisp.net Sun Nov 8 14:21:06 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sun, 08 Nov 2009 09:21:06 -0500 Subject: [clfswm-cvs] r258 - clfswm/contrib Message-ID: Author: pbrochard Date: Sun Nov 8 09:21:06 2009 New Revision: 258 Log: reboot-halt.lisp: Remove test code Modified: clfswm/contrib/reboot-halt.lisp Modified: clfswm/contrib/reboot-halt.lisp ============================================================================== --- clfswm/contrib/reboot-halt.lisp (original) +++ clfswm/contrib/reboot-halt.lisp Sun Nov 8 09:21:06 2009 @@ -39,8 +39,8 @@ (defun do-with-terminal (command) - ;;(do-shell (format nil "xterm -e '~A'" command))) - (do-shell (format nil "xterm -e 'echo ~A; sleep 3'" command))) ;; test + (do-shell (format nil "xterm -e '~A'" command))) + ;;(do-shell (format nil "xterm -e 'echo ~A; sleep 3'" command))) ;; test (defun do-suspend () "Suspend the computer to RAM" From pbrochard at common-lisp.net Wed Nov 11 13:35:18 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Wed, 11 Nov 2009 08:35:18 -0500 Subject: [clfswm-cvs] r259 - in clfswm: . src Message-ID: Author: pbrochard Date: Wed Nov 11 08:35:16 2009 New Revision: 259 Log: Begining of mouse support in info mode. Modified: clfswm/ChangeLog clfswm/src/clfswm-info.lisp clfswm/src/clfswm-menu.lisp clfswm/src/config.lisp Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Wed Nov 11 08:35:16 2009 @@ -1,3 +1,8 @@ +2009-11-11 Philippe Brochard + + * src/clfswm-info.lisp (info-mode): Begining of mouse support in + info mode. + 2009-11-08 Philippe Brochard * contrib/reboot-halt.lisp: Add a Suspend/Reboot/Halt menu in Modified: clfswm/src/clfswm-info.lisp ============================================================================== --- clfswm/src/clfswm-info.lisp (original) +++ clfswm/src/clfswm-info.lisp Wed Nov 11 08:35:16 2009 @@ -28,40 +28,67 @@ (defstruct info window gc font list ilw ilh x y max-x max-y) +(defparameter *info-selected-item* nil) + + (defun leave-info-mode (info) "Leave the info mode" (declare (ignore info)) + (setf *info-selected-item* nil) + (throw 'exit-info-loop nil)) + +(defun leave-info-mode-and-valid (info) + "Leave the info mode and valid the selected item" + (declare (ignore info)) (throw 'exit-info-loop nil)) (defun mouse-leave-info-mode (window root-x root-y info) "Leave the info mode" (declare (ignore window root-x root-y info)) + (setf *info-selected-item* nil) (throw 'exit-info-loop nil)) +(defun find-info-item-from-mouse (root-x root-y info) + (if (< (xlib:drawable-x (info-window info)) root-x + (+ (xlib:drawable-x (info-window info)) + (xlib:drawable-width (info-window info)))) + (truncate (/ (- (+ (- root-y (xlib:drawable-y (info-window info))) + (xlib:max-char-ascent (info-font info)) + (info-y info)) (info-ilh info)) (info-ilh info))) + nil)) + + +(defun set-info-item-form-mouse (root-x root-y info) + (setf *info-selected-item* (find-info-item-from-mouse root-x root-y info))) + + (defun draw-info-window (info) (labels ((print-line (line posx posy &optional (color *info-foreground*)) ;;(setf (xlib:gcontext-foreground (info-gc info)) (get-color color)) - (xlib:with-gcontext ((info-gc info) :foreground (get-color color)) - (xlib:draw-glyphs *pixmap-buffer* (info-gc info) + (xlib:with-gcontext ((info-gc info) :foreground (get-color color) + :background (if (equal posy *info-selected-item*) + (get-color *info-selected-background*) + (get-color *info-background*))) + (xlib:draw-image-glyphs *pixmap-buffer* (info-gc info) (- (+ (info-ilw info) (* posx (info-ilw info))) (info-x info)) (- (+ (* (info-ilh info) posy) (info-ilh info)) (info-y info)) (format nil "~A" line))) (+ posx (length line)))) (clear-pixmap-buffer (info-window info) (info-gc info)) (loop for line in (info-list info) - for y from 0 do - (typecase line - (cons (typecase (first line) - (cons (let ((posx 0)) - (dolist (l line) - (typecase l - (cons (setf posx (print-line (first l) posx y (second l)))) - (t (setf posx (print-line l posx y))))))) - (t (print-line (first line) 0 y (second line))))) - (t (print-line line 0 y)))) + for y from 0 + do (typecase line + (cons (typecase (first line) + (cons (let ((posx 0)) + (dolist (l line) + (typecase l + (cons (setf posx (print-line (first l) posx y (second l)))) + (t (setf posx (print-line l posx y))))))) + (t (print-line (first line) 0 y (second line))))) + (t (print-line line 0 y)))) (copy-pixmap-buffer (info-window info) (info-gc info)))) @@ -76,7 +103,8 @@ (defun set-default-info-keys () (define-info-key (#\q) 'leave-info-mode) - (define-info-key ("Return") 'leave-info-mode) + (define-info-key ("Return") 'leave-info-mode-and-valid) + (define-info-key ("space") 'leave-info-mode-and-valid) (define-info-key ("Escape") 'leave-info-mode) (define-info-key ("twosuperior") (defun info-banish-pointer (info) @@ -87,43 +115,51 @@ (defun info-next-line (info) "Move one line down" (setf (info-y info) (min (+ (info-y info) (info-ilh info)) (info-max-y info))) + (setf *info-selected-item* nil) (draw-info-window info))) (define-info-key ("Up") (defun info-previous-line (info) "Move one line up" (setf (info-y info) (max (- (info-y info) (info-ilh info)) 0)) + (setf *info-selected-item* nil) (draw-info-window info))) (define-info-key ("Left") (defun info-previous-char (info) "Move one char left" (setf (info-x info) (max (- (info-x info) (info-ilw info)) 0)) + (setf *info-selected-item* nil) (draw-info-window info))) (define-info-key ("Right") (defun info-next-char (info) "Move one char right" (setf (info-x info) (min (+ (info-x info) (info-ilw info)) (info-max-x info))) + (setf *info-selected-item* nil) (draw-info-window info))) (define-info-key ("Home") (defun info-first-line (info) "Move to first line" (setf (info-x info) 0 (info-y info) 0) + (setf *info-selected-item* nil) (draw-info-window info))) (define-info-key ("End") (defun info-end-line (info) "Move to last line" (setf (info-x info) 0 (info-y info) (- (* (length (info-list info)) (info-ilh info)) (xlib:drawable-height (info-window info)))) + (setf *info-selected-item* nil) (draw-info-window info))) (define-info-key ("Page_Down") (defun info-next-ten-lines (info) "Move ten lines down" (setf (info-y info) (min (+ (info-y info) (* (info-ilh info) 10)) (info-max-y info))) + (setf *info-selected-item* nil) (draw-info-window info))) (define-info-key ("Page_Up") (defun info-previous-ten-lines (info) "Move ten lines up" (setf (info-y info) (max (- (info-y info) (* (info-ilh info) 10)) 0)) + (setf *info-selected-item* nil) (draw-info-window info)))) (add-hook *binding-hook* 'set-default-info-keys) @@ -153,18 +189,20 @@ (defun info-mouse-next-line (window root-x root-y info) "Move one line down" - (declare (ignore window root-x root-y)) + (declare (ignore window)) (setf (info-y info) (min (+ (info-y info) (info-ilh info)) (info-max-y info))) + (set-info-item-form-mouse root-x root-y info) (draw-info-window info)) (defun info-mouse-previous-line (window root-x root-y info) "Move one line up" - (declare (ignore window root-x root-y)) + (declare (ignore window)) (setf (info-y info) (max (- (info-y info) (info-ilh info)) 0)) + (set-info-item-form-mouse root-x root-y info) (draw-info-window info)) -(defun info-mouse-motion (window root-x root-y info) +(defun info-mouse-motion-drag (window root-x root-y info) "Grab text" (declare (ignore window)) (when (and *info-start-grab-x* *info-start-grab-y*) @@ -174,12 +212,35 @@ + + + + +(defun info-mouse-select-item (window root-x root-y info) + (declare (ignore window)) + (set-info-item-form-mouse root-x root-y info) + (leave-info-mode-and-valid info)) + +(defun info-mouse-motion-click (window root-x root-y info) + (declare (ignore window)) + (let ((last *info-selected-item*)) + (set-info-item-form-mouse root-x root-y info) + (unless (equal last *info-selected-item*) + (draw-info-window info)))) + + + (defun set-default-info-mouse () - (define-info-mouse (1) 'info-begin-grab 'info-end-grab) + (if *info-click-to-select* + (define-info-mouse (1) nil 'info-mouse-select-item) + (define-info-mouse (1) 'info-begin-grab 'info-end-grab)) (define-info-mouse (2) 'mouse-leave-info-mode) + (define-info-mouse (3) 'mouse-leave-info-mode) (define-info-mouse (4) 'info-mouse-previous-line) (define-info-mouse (5) 'info-mouse-next-line) - (define-info-mouse ('motion) 'info-mouse-motion nil)) + (if *info-click-to-select* + (define-info-mouse ('motion) 'info-mouse-motion-click nil) + (define-info-mouse ('motion) 'info-mouse-motion-drag nil))) (add-hook *binding-hook* 'set-default-info-mouse) @@ -193,6 +254,7 @@ Or for colored output: a list (line_string color) Or ((1_word color) (2_word color) 3_word (4_word color)...)" (when info-list + (setf *info-selected-item* nil) (labels ((compute-size (line) (typecase line (cons (typecase (first line) @@ -252,6 +314,7 @@ (xgrab-pointer *root* 68 69) (unless keyboard-grabbed-p (xgrab-keyboard *root*)) + (wait-no-key-or-button-press) (generic-mode 'exit-info-loop :loop-function (lambda () (raise-window (info-window info))) @@ -268,7 +331,8 @@ (xlib:destroy-window window) (xlib:close-font font) (display-all-frame-info) - (wait-no-key-or-button-press)))))))) + (wait-no-key-or-button-press) + *info-selected-item*))))))) @@ -301,15 +365,23 @@ info-list) (define-key key function))))) (t (push (list (format nil "-=- ~A -=-" item) *menu-color-comment*) info-list)))) - (info-mode (nreverse info-list) :width width :height height) - (dolist (item item-list) - (when (consp item) - (let ((key (first item))) - (undefine-info-key-fun (list key))))) - (typecase action - (function (funcall action)) - (symbol (when (fboundp action) - (funcall action))))))) + (let ((selected-item (info-mode (nreverse info-list) :width width :height height))) + (dolist (item item-list) + (when (consp item) + (let ((key (first item))) + (undefine-info-key-fun (list key))))) + (when selected-item + (awhen (nth selected-item item-list) + (when (consp it) + (destructuring-bind (key function explicit-doc) (ensure-n-elems it 3) + (declare (ignore key explicit-doc)) + (typecase function + (cons (setf action (first function))) + (t (setf action function))))))) + (typecase action + (function (funcall action)) + (symbol (when (fboundp action) + (funcall action)))))))) Modified: clfswm/src/clfswm-menu.lisp ============================================================================== --- clfswm/src/clfswm-menu.lisp (original) +++ clfswm/src/clfswm-menu.lisp Wed Nov 11 08:35:16 2009 @@ -134,14 +134,17 @@ (declare (ignore args)) (setf action value) (throw 'exit-info-loop nil)))))) - (info-mode (nreverse info-list)) - (dolist (item (menu-item menu)) - (undefine-info-key-fun (list (menu-item-key item)))) - (typecase action - (menu (open-menu action (cons menu parent))) - (null (awhen (first parent) - (open-menu it (rest parent)))) - (t (when (fboundp action) - (funcall action)))))) + (let ((selected-item (info-mode (nreverse info-list)))) + (dolist (item (menu-item menu)) + (undefine-info-key-fun (list (menu-item-key item)))) + (when selected-item + (awhen (nth selected-item (menu-item menu)) + (setf action (menu-item-value it)))) + (typecase action + (menu (open-menu action (cons menu parent))) + (null (awhen (first parent) + (open-menu it (rest parent)))) + (t (when (fboundp action) + (funcall action))))))) Modified: clfswm/src/config.lisp ============================================================================== --- clfswm/src/config.lisp (original) +++ clfswm/src/config.lisp Wed Nov 11 08:35:16 2009 @@ -72,7 +72,7 @@ ;;; CONFIG: Corner actions - See in clfswm-corner.lisp for ;;; allowed functions (defparameter *corner-main-mode-left-button* - '((:top-left nil) + '((:top-left open-menu) (:top-right present-virtual-keyboard) (:bottom-right present-windows) (:bottom-left nil)) @@ -234,9 +234,14 @@ "Config(Info mode group): Info window border color") (defparameter *info-line-cursor* "white" "Config(Info mode group): Info window line cursor color color") +(defparameter *info-selected-background* "blue" + "Config(Info mode group): Info selected item background color") (defparameter *info-font-string* *default-font-string* "Config(Info mode group): Info window font string") +(defparameter *info-click-to-select* t + "Config(Info mode group): If true, click on info window select item. Otherwise, click to drag the menu") + ;;; CONFIG - Circulate string colors (defparameter *circulate-font-string* *default-font-string* "Config(Circulate mode group): Circulate string window font string") From pbrochard at common-lisp.net Wed Nov 11 14:22:45 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Wed, 11 Nov 2009 09:22:45 -0500 Subject: [clfswm-cvs] r260 - in clfswm: . src Message-ID: Author: pbrochard Date: Wed Nov 11 09:22:45 2009 New Revision: 260 Log: Add mouse support in info mode. clfswm is now usable only with the mouse Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/clfswm-info.lisp clfswm/src/clfswm-menu.lisp Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Wed Nov 11 09:22:45 2009 @@ -2,6 +2,7 @@ * src/clfswm-info.lisp (info-mode): Begining of mouse support in info mode. + (set-default-info-keys): Add cursor key support in info mode. 2009-11-08 Philippe Brochard Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Wed Nov 11 09:22:45 2009 @@ -7,8 +7,6 @@ =============== Should handle these soon. -- Mouse support in menu -> very urgent - - Show config -> list and display documentation for all tweakable global variables. [Philippe] TODO : In ~/.clfswmrc: Modified: clfswm/src/clfswm-info.lisp ============================================================================== --- clfswm/src/clfswm-info.lisp (original) +++ clfswm/src/clfswm-info.lisp Wed Nov 11 09:22:45 2009 @@ -64,17 +64,35 @@ (setf *info-selected-item* (find-info-item-from-mouse root-x root-y info))) +(defun info-y-display-coords (info posy) + (- (+ (* (info-ilh info) posy) (info-ilh info)) (info-y info))) + +(defun incf-info-selected-item (info n) + (setf *info-selected-item* + (min (if *info-selected-item* + (+ *info-selected-item* n) + 0) + (1- (or (length (info-list info)) 1))))) + +(defun decf-info-selected-item (info n) + (declare (ignore info)) + (setf *info-selected-item* + (max (if *info-selected-item* + (- *info-selected-item* n) + 0) + 0))) + + (defun draw-info-window (info) (labels ((print-line (line posx posy &optional (color *info-foreground*)) - ;;(setf (xlib:gcontext-foreground (info-gc info)) (get-color color)) (xlib:with-gcontext ((info-gc info) :foreground (get-color color) :background (if (equal posy *info-selected-item*) (get-color *info-selected-background*) (get-color *info-background*))) (xlib:draw-image-glyphs *pixmap-buffer* (info-gc info) (- (+ (info-ilw info) (* posx (info-ilw info))) (info-x info)) - (- (+ (* (info-ilh info) posy) (info-ilh info)) (info-y info)) + (info-y-display-coords info posy) (format nil "~A" line))) (+ posx (length line)))) (clear-pixmap-buffer (info-window info) (info-gc info)) @@ -114,52 +132,62 @@ (define-info-key ("Down") (defun info-next-line (info) "Move one line down" - (setf (info-y info) (min (+ (info-y info) (info-ilh info)) (info-max-y info))) - (setf *info-selected-item* nil) + (incf-info-selected-item info 1) + (when (> (info-y-display-coords info *info-selected-item*) + (+ (xlib:drawable-y (info-window info)) + (xlib:drawable-height (info-window info)))) + (setf (info-y info) (min (+ (info-y info) (info-ilh info)) (info-max-y info)))) (draw-info-window info))) (define-info-key ("Up") (defun info-previous-line (info) "Move one line up" - (setf (info-y info) (max (- (info-y info) (info-ilh info)) 0)) - (setf *info-selected-item* nil) + (decf-info-selected-item info 1) + (when (< (info-y-display-coords info *info-selected-item*) + (+ (xlib:drawable-y (info-window info)) + (info-ilh info))) + (setf (info-y info) (max (- (info-y info) (info-ilh info)) 0))) (draw-info-window info))) (define-info-key ("Left") (defun info-previous-char (info) "Move one char left" (setf (info-x info) (max (- (info-x info) (info-ilw info)) 0)) - (setf *info-selected-item* nil) (draw-info-window info))) (define-info-key ("Right") (defun info-next-char (info) "Move one char right" (setf (info-x info) (min (+ (info-x info) (info-ilw info)) (info-max-x info))) - (setf *info-selected-item* nil) (draw-info-window info))) (define-info-key ("Home") (defun info-first-line (info) "Move to first line" (setf (info-x info) 0 (info-y info) 0) - (setf *info-selected-item* nil) + (setf *info-selected-item* 0) (draw-info-window info))) (define-info-key ("End") (defun info-end-line (info) "Move to last line" (setf (info-x info) 0 (info-y info) (- (* (length (info-list info)) (info-ilh info)) (xlib:drawable-height (info-window info)))) - (setf *info-selected-item* nil) + (setf *info-selected-item* (1- (or (length (info-list info)) 1))) (draw-info-window info))) (define-info-key ("Page_Down") (defun info-next-ten-lines (info) "Move ten lines down" - (setf (info-y info) (min (+ (info-y info) (* (info-ilh info) 10)) (info-max-y info))) - (setf *info-selected-item* nil) + (incf-info-selected-item info 10) + (when (> (info-y-display-coords info *info-selected-item*) + (+ (xlib:drawable-y (info-window info)) + (xlib:drawable-height (info-window info)))) + (setf (info-y info) (min (+ (info-y info) (* (info-ilh info) 10)) (info-max-y info)))) (draw-info-window info))) (define-info-key ("Page_Up") (defun info-previous-ten-lines (info) "Move ten lines up" - (setf (info-y info) (max (- (info-y info) (* (info-ilh info) 10)) 0)) - (setf *info-selected-item* nil) + (decf-info-selected-item info 10) + (when (< (info-y-display-coords info *info-selected-item*) + (+ (xlib:drawable-y (info-window info)) + (info-ilh info))) + (setf (info-y info) (max (- (info-y info) (* (info-ilh info) 10)) 0))) (draw-info-window info)))) (add-hook *binding-hook* 'set-default-info-keys) @@ -254,7 +282,7 @@ Or for colored output: a list (line_string color) Or ((1_word color) (2_word color) 3_word (4_word color)...)" (when info-list - (setf *info-selected-item* nil) + (setf *info-selected-item* 0) (labels ((compute-size (line) (typecase line (cons (typecase (first line) @@ -350,7 +378,7 @@ (lambda (&optional args) (declare (ignore args)) (setf action function) - (throw 'exit-info-loop nil))))) + (leave-info-mode nil))))) (dolist (item item-list) (typecase item (cons (destructuring-bind (key function explicit-doc) (ensure-n-elems item 3) Modified: clfswm/src/clfswm-menu.lisp ============================================================================== --- clfswm/src/clfswm-menu.lisp (original) +++ clfswm/src/clfswm-menu.lisp Wed Nov 11 09:22:45 2009 @@ -133,7 +133,7 @@ (lambda (&optional args) (declare (ignore args)) (setf action value) - (throw 'exit-info-loop nil)))))) + (leave-info-mode nil)))))) (let ((selected-item (info-mode (nreverse info-list)))) (dolist (item (menu-item menu)) (undefine-info-key-fun (list (menu-item-key item)))) From pbrochard at common-lisp.net Thu Nov 12 21:38:57 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Thu, 12 Nov 2009 16:38:57 -0500 Subject: [clfswm-cvs] r261 - in clfswm: . contrib src Message-ID: Author: pbrochard Date: Thu Nov 12 16:38:56 2009 New Revision: 261 Log: save-configuration-variables): New function to save all configuration variables in clfswmrc. Modified: clfswm/ChangeLog clfswm/contrib/reboot-halt.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp clfswm/src/xlib-util.lisp Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Thu Nov 12 16:38:56 2009 @@ -1,3 +1,8 @@ +2009-11-12 Philippe Brochard + + * src/clfswm-util.lisp (save-configuration-variables): New + function to save all configuration variables in clfswmrc. + 2009-11-11 Philippe Brochard * src/clfswm-info.lisp (info-mode): Begining of mouse support in Modified: clfswm/contrib/reboot-halt.lisp ============================================================================== --- clfswm/contrib/reboot-halt.lisp (original) +++ clfswm/contrib/reboot-halt.lisp Thu Nov 12 16:38:56 2009 @@ -56,12 +56,9 @@ (unless (find-menu 'reboot-halt-menu) (add-sub-menu 'help-menu "Pause" 'reboot-halt-menu "Suspend/Reboot/Halt menu") - (add-menu-key 'reboot-halt-menu "s" 'do-suspend) (add-menu-key 'reboot-halt-menu "r" 'do-reboot) - (add-menu-key 'reboot-halt-menu "h" 'do-halt) - (add-menu-key 'reboot-halt-menu "Return" 'do-suspend) - (add-menu-key 'reboot-halt-menu "space" 'do-suspend)) + (add-menu-key 'reboot-halt-menu "h" 'do-halt)) (defun reboot-halt-binding () Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Thu Nov 12 16:38:56 2009 @@ -25,6 +25,23 @@ (in-package :clfswm) + +;;; Configuration file +(defun xdg-config-home () + (pathname-directory (concatenate 'string (or (getenv "XDG_CONFIG_HOME") + (getenv "HOME")) + "/"))) + +(defun conf-file-name () + (let* ((user-conf (probe-file (merge-pathnames (user-homedir-pathname) #p".clfswmrc"))) + (etc-conf (probe-file #p"/etc/clfswmrc")) + (config-user-conf (probe-file (make-pathname :directory (append (xdg-config-home) '("clfswm")) + :name "clfswmrc")))) + (or config-user-conf user-conf etc-conf))) + + + + (defun load-contrib (file) "Load a file in the contrib directory" (let ((truename (concatenate 'string *contrib-dir* "contrib/" file))) @@ -1256,3 +1273,83 @@ (#\u unhide-all-windows-in-current-child)))))) +;;; Configuration variables save + +(defun find-symbol-function (function) + (with-all-internal-symbols (symbol :clfswm) + (when (and (fboundp symbol) (equal (symbol-function symbol) function)) + (return-from find-symbol-function symbol)))) + +(defun temp-conf-file-name () + (let ((name (conf-file-name))) + (make-pathname :directory (pathname-directory name) + :name (concatenate 'string (pathname-name name) "-tmp")))) + + +(defun copy-previous-conf-file-begin (stream-in stream-out) + (loop for line = (read-line stream-in nil nil) + while line + until (zerop (or (search ";;; ### Internal variables definitions" line) -1)) + do (format stream-out "~A~%" line))) + +(defun copy-previous-conf-file-end (stream-in stream-out) + (loop for line = (read-line stream-in nil nil) + while line + until (zerop (or (search ";;; ### End of internal variables definitions" line) -1))) + (loop for line = (read-line stream-in nil nil) + while line + do (format stream-out "~A~%" line))) + + + +(defun save-variables-in-conf-file (stream) + (let ((all-groups nil) + (all-variables nil)) + (with-all-internal-symbols (symbol :clfswm) + (when (is-config-p symbol) + (pushnew (config-group symbol) all-groups :test #'string-equal) + (push (list symbol (config-group symbol)) all-variables))) + (format stream "~2&;;; ### Internal variables definitions ### ;;;~%") + (format stream ";;; ### You can edit this part when clfswm is not running ### ;;;~%") + (format stream "(in-package :clfswm)~2%") + (format stream "(setf~%") + (dolist (group all-groups) + (format stream " ;; ~A:~%" group) + (dolist (var all-variables) + (when (string-equal (second var) group) + (format stream " ~A " (first var)) + (let ((value (symbol-value (first var)))) + (cond ((or (equal value t) (equal value nil)) + (format stream "~S" value)) + ((consp value) + (format stream "(quote ~S)" value)) + ((symbolp value) + (format stream "'~S" value)) + ((functionp value) + (format stream "'~S" (find-symbol-function value))) + ((xlib:color-p value) + (format stream "(->color #x~X)" (color->rgb value))) + (t (format stream "~S" value)))) + (terpri stream))) + (format stream "~%")) + (format stream ")~%") + (format stream ";;; ### End of internal variables definitions ### ;;;~%"))) + + + + +(defun save-configuration-variables () + "Save all configuration variables in clfswmrc" + (let ((conffile (conf-file-name)) + (tempfile (temp-conf-file-name))) + (with-open-file (stream-in conffile :direction :input :if-does-not-exist :create) + (with-open-file (stream-out tempfile :direction :output :if-exists :supersede) + (copy-previous-conf-file-begin stream-in stream-out) + (save-variables-in-conf-file stream-out) + (copy-previous-conf-file-end stream-in stream-out))) + (delete-file conffile) + (rename-file tempfile conffile) + nil)) + + + Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Thu Nov 12 16:38:56 2009 @@ -265,11 +265,6 @@ -(defun xdg-config-home () - (pathname-directory (concatenate 'string (or (getenv "XDG_CONFIG_HOME") - (getenv "HOME")) - "/"))) - (defun read-conf-file () (let* ((user-conf (probe-file (merge-pathnames (user-homedir-pathname) #p".clfswmrc"))) Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Thu Nov 12 16:38:56 2009 @@ -613,6 +613,15 @@ "White") +(defun color->rgb (color) + (multiple-value-bind (r g b) + (xlib:color-rgb color) + (+ (ash (round (* 256 r)) +16) + (ash (round (* 256 g)) +8) + (round (* 256 b))))) + + + (defmacro my-character->keysyms (ch) From pbrochard at common-lisp.net Thu Nov 12 21:57:02 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Thu, 12 Nov 2009 16:57:02 -0500 Subject: [clfswm-cvs] r262 - clfswm/src Message-ID: Author: pbrochard Date: Thu Nov 12 16:57:02 2009 New Revision: 262 Log: clfswm.lisp: fixe configuration file name Modified: clfswm/src/clfswm.lisp Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Thu Nov 12 16:57:02 2009 @@ -267,11 +267,7 @@ (defun read-conf-file () - (let* ((user-conf (probe-file (merge-pathnames (user-homedir-pathname) #p".clfswmrc"))) - (etc-conf (probe-file #p"/etc/clfswmrc")) - (config-user-conf (probe-file (make-pathname :directory (append (xdg-config-home) '("clfswm")) - :name "clfswmrc"))) - (conf (or config-user-conf user-conf etc-conf))) + (let* ((conf (conf-file-name))) (if conf (handler-case (load conf) (error (c) From pbrochard at common-lisp.net Sat Nov 14 22:38:11 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 14 Nov 2009 17:38:11 -0500 Subject: [clfswm-cvs] r263 - in clfswm: . src Message-ID: Author: pbrochard Date: Sat Nov 14 17:38:10 2009 New Revision: 263 Log: Configuration menu: New menu to configure all clfswm variables while clfswm is running. Added: clfswm/src/clfswm-configuration.lisp Modified: clfswm/ChangeLog clfswm/clfswm.asd clfswm/src/clfswm-util.lisp clfswm/src/menu-def.lisp clfswm/src/tools.lisp Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sat Nov 14 17:38:10 2009 @@ -1,3 +1,8 @@ +2009-11-14 Philippe Brochard + + * src/clfswm-configuration.lisp (create-configuration-menu): New + menu to configure all clfswm variables while clfswm is running. + 2009-11-12 Philippe Brochard * src/clfswm-util.lisp (save-configuration-variables): New Modified: clfswm/clfswm.asd ============================================================================== --- clfswm/clfswm.asd (original) +++ clfswm/clfswm.asd Sat Nov 14 17:38:10 2009 @@ -65,13 +65,16 @@ :depends-on ("clfswm" "clfswm-util" "clfswm-second-mode")) (:file "clfswm-nw-hooks" :depends-on ("package" "clfswm-util" "clfswm-info" "clfswm-layout" "menu-def")) + (:file "clfswm-configuration" + :depends-on ("package" "config" "clfswm-internal" "clfswm-util" "clfswm-query" + "clfswm-menu")) + (:file "menu-def" + :depends-on ("clfswm-menu" "clfswm-configuration" "clfswm" "clfswm-util" "clfswm-info")) (:file "bindings" :depends-on ("clfswm" "clfswm-internal" "clfswm-util" "clfswm-menu")) (:file "bindings-second-mode" :depends-on ("clfswm" "clfswm-util" "clfswm-query" "bindings" "clfswm-pack" "clfswm-menu" "menu-def" - "clfswm-layout")) - (:file "menu-def" - :depends-on ("clfswm-menu" "clfswm" "clfswm-util" "clfswm-info")))))) + "clfswm-layout")))))) Added: clfswm/src/clfswm-configuration.lisp ============================================================================== --- (empty file) +++ clfswm/src/clfswm-configuration.lisp Sat Nov 14 17:38:10 2009 @@ -0,0 +1,176 @@ +;;; -------------------------------------------------------------------------- +;;; CLFSWM - FullScreen Window Manager +;;; +;;; -------------------------------------------------------------------------- +;;; Documentation: Configuration definitions and Menu generation +;;; +;;; -------------------------------------------------------------------------- +;;; +;;; (C) 2005 Philippe Brochard +;;; +;;; This program is free software; you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program; if not, write to the Free Software +;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +;;; +;;; -------------------------------------------------------------------------- + +(in-package :clfswm) + + +(defun find-configuration-variables () + (let ((all-groups nil) + (all-variables nil)) + (with-all-internal-symbols (symbol :clfswm) + (when (is-config-p symbol) + (pushnew (config-group symbol) all-groups :test #'string-equal) + (push (list symbol (config-group symbol)) all-variables))) + (values all-groups all-variables))) + + +(defun escape-conf-value (value) + (let ((value (symbol-value value))) + (cond ((or (equal value t) (equal value nil)) + (format nil "~S" value)) + ((consp value) + (format nil "(quote ~S)" value)) + ((symbolp value) + (format nil "'~S" value)) + ((functionp value) + (format nil "'~S" (find-symbol-function value))) + ((xlib:color-p value) + (format nil "(->color #x~X)" (color->rgb value))) + (t (format nil "~S" value))))) + + + +;;; Configuration variables save + +(defun find-symbol-function (function) + (with-all-internal-symbols (symbol :clfswm) + (when (and (fboundp symbol) (equal (symbol-function symbol) function)) + (return-from find-symbol-function symbol)))) + +(defun temp-conf-file-name () + (let ((name (conf-file-name))) + (make-pathname :directory (pathname-directory name) + :name (concatenate 'string (pathname-name name) "-tmp")))) + + +(defun copy-previous-conf-file-begin (stream-in stream-out) + (loop for line = (read-line stream-in nil nil) + while line + until (zerop (or (search ";;; ### Internal variables definitions" line) -1)) + do (format stream-out "~A~%" line))) + +(defun copy-previous-conf-file-end (stream-in stream-out) + (loop for line = (read-line stream-in nil nil) + while line + until (zerop (or (search ";;; ### End of internal variables definitions" line) -1))) + (loop for line = (read-line stream-in nil nil) + while line + do (format stream-out "~A~%" line))) + + + +(defun save-variables-in-conf-file (stream) + (multiple-value-bind (all-groups all-variables) + (find-configuration-variables) + (format stream "~2&;;; ### Internal variables definitions ### ;;;~%") + (format stream ";;; ### You can edit this part when clfswm is not running ### ;;;~%") + (format stream "(in-package :clfswm)~2%") + (format stream "(setf~%") + (dolist (group all-groups) + (format stream " ;; ~A:~%" group) + (dolist (var all-variables) + (when (string-equal (second var) group) + (format stream " ~A ~A~%" (first var) + (escape-conf-value (first var))))) + (format stream "~%")) + (format stream ")~%") + (format stream ";;; ### End of internal variables definitions ### ;;;~%"))) + + + + +(defun save-configuration-variables () + "Save all configuration variables in clfswmrc" + (let ((conffile (conf-file-name)) + (tempfile (temp-conf-file-name))) + (with-open-file (stream-in conffile :direction :input :if-does-not-exist :create) + (with-open-file (stream-out tempfile :direction :output :if-exists :supersede) + (copy-previous-conf-file-begin stream-in stream-out) + (save-variables-in-conf-file stream-out) + (copy-previous-conf-file-end stream-in stream-out))) + (delete-file conffile) + (rename-file tempfile conffile) + nil)) + + +;;; Configuration menu definition + +(defun group->menu (group) + (intern (string-upcase + (format nil "conf-~A" (substitute #\- #\Space group))) + :clfswm)) + +(defun query-conf-value (string original) + (labels ((warn-wrong-type (result original) + (if (equal (simple-type-of result) (simple-type-of original)) + result + (if (string-equal + (query-string + (format nil "~S and ~S are not of the same type (~A and ~A). Do you really want to use this value? (yes/no)" + result original (type-of result) (type-of original)) + "no") + "yes") + result + original)))) + (multiple-value-bind (result return) + (query-string (format nil "Configure ~A" string) original) + (let ((result-val (eval (read-from-string result))) + (original-val (eval (read-from-string original)))) + (if (member return '(:Return :Complet)) + (warn-wrong-type result-val original-val) + original-val))))) + + +(defun create-conf-function (var) + (let* ((string (remove #\* (format nil "~A" var))) + (symbol (intern (format nil "CONFIGURE-~A" string) :clfswm))) + (setf (symbol-function symbol) (lambda () + (setf (symbol-value var) (query-conf-value string (escape-conf-value var))) + (open-menu (find-menu 'configuration-menu))) + (documentation symbol 'function) (format nil "Configure ~A" string)) + symbol)) + + +(defun create-configuration-menu () + "Configuration menu" + (multiple-value-bind (all-groups all-variables) + (find-configuration-variables) + (add-menu-key 'configuration-menu "a" 'save-configuration-variables) + (loop for group in all-groups + for i from 1 + do (let ((menu (group->menu group))) + (add-sub-menu 'configuration-menu (number->char i) menu group) + (loop for var in all-variables + with j = -1 + do (when (equal (second var) group) + (add-menu-key menu (number->char (incf j)) + (create-conf-function (first var))))))))) + + + + + + Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Sat Nov 14 17:38:10 2009 @@ -1272,84 +1272,3 @@ `(,(format nil "Focus window: None") (#\u unhide-all-windows-in-current-child)))))) - -;;; Configuration variables save - -(defun find-symbol-function (function) - (with-all-internal-symbols (symbol :clfswm) - (when (and (fboundp symbol) (equal (symbol-function symbol) function)) - (return-from find-symbol-function symbol)))) - -(defun temp-conf-file-name () - (let ((name (conf-file-name))) - (make-pathname :directory (pathname-directory name) - :name (concatenate 'string (pathname-name name) "-tmp")))) - - -(defun copy-previous-conf-file-begin (stream-in stream-out) - (loop for line = (read-line stream-in nil nil) - while line - until (zerop (or (search ";;; ### Internal variables definitions" line) -1)) - do (format stream-out "~A~%" line))) - -(defun copy-previous-conf-file-end (stream-in stream-out) - (loop for line = (read-line stream-in nil nil) - while line - until (zerop (or (search ";;; ### End of internal variables definitions" line) -1))) - (loop for line = (read-line stream-in nil nil) - while line - do (format stream-out "~A~%" line))) - - - -(defun save-variables-in-conf-file (stream) - (let ((all-groups nil) - (all-variables nil)) - (with-all-internal-symbols (symbol :clfswm) - (when (is-config-p symbol) - (pushnew (config-group symbol) all-groups :test #'string-equal) - (push (list symbol (config-group symbol)) all-variables))) - (format stream "~2&;;; ### Internal variables definitions ### ;;;~%") - (format stream ";;; ### You can edit this part when clfswm is not running ### ;;;~%") - (format stream "(in-package :clfswm)~2%") - (format stream "(setf~%") - (dolist (group all-groups) - (format stream " ;; ~A:~%" group) - (dolist (var all-variables) - (when (string-equal (second var) group) - (format stream " ~A " (first var)) - (let ((value (symbol-value (first var)))) - (cond ((or (equal value t) (equal value nil)) - (format stream "~S" value)) - ((consp value) - (format stream "(quote ~S)" value)) - ((symbolp value) - (format stream "'~S" value)) - ((functionp value) - (format stream "'~S" (find-symbol-function value))) - ((xlib:color-p value) - (format stream "(->color #x~X)" (color->rgb value))) - (t (format stream "~S" value)))) - (terpri stream))) - (format stream "~%")) - (format stream ")~%") - (format stream ";;; ### End of internal variables definitions ### ;;;~%"))) - - - - -(defun save-configuration-variables () - "Save all configuration variables in clfswmrc" - (let ((conffile (conf-file-name)) - (tempfile (temp-conf-file-name))) - (with-open-file (stream-in conffile :direction :input :if-does-not-exist :create) - (with-open-file (stream-out tempfile :direction :output :if-exists :supersede) - (copy-previous-conf-file-begin stream-in stream-out) - (save-variables-in-conf-file stream-out) - (copy-previous-conf-file-end stream-in stream-out))) - (delete-file conffile) - (rename-file tempfile conffile) - nil)) - - - Modified: clfswm/src/menu-def.lisp ============================================================================== --- clfswm/src/menu-def.lisp (original) +++ clfswm/src/menu-def.lisp Sat Nov 14 17:38:10 2009 @@ -56,11 +56,14 @@ (add-sub-menu 'main "n" 'action-by-name-menu "Action by name menu") (add-sub-menu 'main "u" 'action-by-number-menu "Action by number menu") (add-sub-menu 'main "y" 'utility-menu "Utility menu") +(add-sub-menu 'main "o" 'configuration-menu "Configuration menu") (add-sub-menu 'main "m" 'clfswm-menu "CLFSWM menu") (update-menus (find-menu 'standard-menu)) +(create-configuration-menu) + (add-menu-key 'help-menu "h" 'show-global-key-binding) (add-menu-key 'help-menu "b" 'show-main-mode-key-binding) (add-menu-key 'help-menu "s" 'show-second-mode-key-binding) Modified: clfswm/src/tools.lisp ============================================================================== --- clfswm/src/tools.lisp (original) +++ clfswm/src/tools.lisp Sat Nov 14 17:38:10 2009 @@ -46,6 +46,7 @@ :setf/= :create-symbol :number->char + :simple-type-of :nth-insert :split-string :append-newline-space @@ -285,6 +286,12 @@ (defun number->char (number) (code-char (+ (char-code #\a) number))) +(defun simple-type-of (object) + (let ((type (type-of object))) + (typecase type + (cons (first type)) + (t type)))) + (defun nth-insert (n elem list) From pbrochard at common-lisp.net Sat Nov 14 22:42:31 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 14 Nov 2009 17:42:31 -0500 Subject: [clfswm-cvs] r264 - clfswm/src Message-ID: Author: pbrochard Date: Sat Nov 14 17:42:31 2009 New Revision: 264 Log: Add an information about configuration variables Modified: clfswm/src/clfswm-configuration.lisp Modified: clfswm/src/clfswm-configuration.lisp ============================================================================== --- clfswm/src/clfswm-configuration.lisp (original) +++ clfswm/src/clfswm-configuration.lisp Sat Nov 14 17:42:31 2009 @@ -87,6 +87,8 @@ (find-configuration-variables) (format stream "~2&;;; ### Internal variables definitions ### ;;;~%") (format stream ";;; ### You can edit this part when clfswm is not running ### ;;;~%") + (format stream ";;; ### And you can remove this part to revert to the ### ;;;~%") + (format stream ";;; ### original configuration variables values. ### ;;;~%") (format stream "(in-package :clfswm)~2%") (format stream "(setf~%") (dolist (group all-groups) From pbrochard at common-lisp.net Sat Nov 14 22:49:32 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 14 Nov 2009 17:49:32 -0500 Subject: [clfswm-cvs] r265 - in clfswm: . src Message-ID: Author: pbrochard Date: Sat Nov 14 17:49:32 2009 New Revision: 265 Log: TODO update. Change key order in configuration menu Modified: clfswm/TODO clfswm/src/clfswm-configuration.lisp Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Sat Nov 14 17:49:32 2009 @@ -7,16 +7,6 @@ =============== Should handle these soon. -- Show config -> list and display documentation for all tweakable global variables. [Philippe] - TODO : - In ~/.clfswmrc: - ;;;; AUTO-CONFIG - Do not edit those lines by hands: they are overwritten by CLFSWM - (defparameter *my-var* value) - ... - ;;;; AUTO-CONFIG End : You can add your configurations below this line. - Ask to change value. Check if new value type is the same as the old value. - - - Remote access to the clfswm REPL [Philippe] this can be done with net.lisp or via xprop (ie the Stumpwm way). Modified: clfswm/src/clfswm-configuration.lisp ============================================================================== --- clfswm/src/clfswm-configuration.lisp (original) +++ clfswm/src/clfswm-configuration.lisp Sat Nov 14 17:49:32 2009 @@ -160,7 +160,6 @@ "Configuration menu" (multiple-value-bind (all-groups all-variables) (find-configuration-variables) - (add-menu-key 'configuration-menu "a" 'save-configuration-variables) (loop for group in all-groups for i from 1 do (let ((menu (group->menu group))) @@ -169,7 +168,8 @@ with j = -1 do (when (equal (second var) group) (add-menu-key menu (number->char (incf j)) - (create-conf-function (first var))))))))) + (create-conf-function (first var)))))))) + (add-menu-key 'configuration-menu "*" 'save-configuration-variables)) From pbrochard at common-lisp.net Sat Nov 14 22:51:12 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 14 Nov 2009 17:51:12 -0500 Subject: [clfswm-cvs] r266 - clfswm/src Message-ID: Author: pbrochard Date: Sat Nov 14 17:51:12 2009 New Revision: 266 Log: Begin with #\a key in the configuration menu Modified: clfswm/src/clfswm-configuration.lisp Modified: clfswm/src/clfswm-configuration.lisp ============================================================================== --- clfswm/src/clfswm-configuration.lisp (original) +++ clfswm/src/clfswm-configuration.lisp Sat Nov 14 17:51:12 2009 @@ -161,7 +161,7 @@ (multiple-value-bind (all-groups all-variables) (find-configuration-variables) (loop for group in all-groups - for i from 1 + for i from 0 do (let ((menu (group->menu group))) (add-sub-menu 'configuration-menu (number->char i) menu group) (loop for var in all-variables From pbrochard at common-lisp.net Sat Nov 14 22:54:13 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 14 Nov 2009 17:54:13 -0500 Subject: [clfswm-cvs] r267 - clfswm/src Message-ID: Author: pbrochard Date: Sat Nov 14 17:54:13 2009 New Revision: 267 Log: Change save key in configuration menu Modified: clfswm/src/clfswm-configuration.lisp Modified: clfswm/src/clfswm-configuration.lisp ============================================================================== --- clfswm/src/clfswm-configuration.lisp (original) +++ clfswm/src/clfswm-configuration.lisp Sat Nov 14 17:54:13 2009 @@ -169,7 +169,7 @@ do (when (equal (second var) group) (add-menu-key menu (number->char (incf j)) (create-conf-function (first var)))))))) - (add-menu-key 'configuration-menu "*" 'save-configuration-variables)) + (add-menu-key 'configuration-menu "F2" 'save-configuration-variables)) From pbrochard at common-lisp.net Sat Nov 14 22:57:24 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 14 Nov 2009 17:57:24 -0500 Subject: [clfswm-cvs] r268 - clfswm/src Message-ID: Author: pbrochard Date: Sat Nov 14 17:57:24 2009 New Revision: 268 Log: Prevent errors while in configuration menu Modified: clfswm/src/clfswm-configuration.lisp Modified: clfswm/src/clfswm-configuration.lisp ============================================================================== --- clfswm/src/clfswm-configuration.lisp (original) +++ clfswm/src/clfswm-configuration.lisp Sat Nov 14 17:57:24 2009 @@ -139,8 +139,8 @@ original)))) (multiple-value-bind (result return) (query-string (format nil "Configure ~A" string) original) - (let ((result-val (eval (read-from-string result))) - (original-val (eval (read-from-string original)))) + (let ((result-val (ignore-errors (eval (read-from-string result)))) + (original-val (ignore-errors (eval (read-from-string original))))) (if (member return '(:Return :Complet)) (warn-wrong-type result-val original-val) original-val))))) From pbrochard at common-lisp.net Sat Nov 14 23:03:49 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 14 Nov 2009 18:03:49 -0500 Subject: [clfswm-cvs] r269 - clfswm/src Message-ID: Author: pbrochard Date: Sat Nov 14 18:03:49 2009 New Revision: 269 Log: Prevent to add a newline on each configuration variables save Modified: clfswm/src/clfswm-configuration.lisp Modified: clfswm/src/clfswm-configuration.lisp ============================================================================== --- clfswm/src/clfswm-configuration.lisp (original) +++ clfswm/src/clfswm-configuration.lisp Sat Nov 14 18:03:49 2009 @@ -85,7 +85,7 @@ (defun save-variables-in-conf-file (stream) (multiple-value-bind (all-groups all-variables) (find-configuration-variables) - (format stream "~2&;;; ### Internal variables definitions ### ;;;~%") + (format stream "~&;;; ### Internal variables definitions ### ;;;~%") (format stream ";;; ### You can edit this part when clfswm is not running ### ;;;~%") (format stream ";;; ### And you can remove this part to revert to the ### ;;;~%") (format stream ";;; ### original configuration variables values. ### ;;;~%")