[sawfish] added option for displaying workspace name upon switch



commit 7483028c3536a516961d605b04ba97d88796653c
Author: chrisb <zanghar freenet de>
Date:   Sun Sep 13 20:24:38 2009 +0200

    added option for displaying workspace name upon switch

 ChangeLog                        |    7 ++++++
 OPTIONS                          |    8 ++++++
 lisp/sawfish/wm/commands/user.jl |   45 +++++++++++++++++++++++++++++++++----
 lisp/sawfish/wm/tabs/tab.jl      |    4 +-
 man/news.texi                    |    2 +
 5 files changed, 59 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3232582..d518cf2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
 2009-09-13  Christopher Bratusek <zanghar freenet de>
 	* sawfish.doap: added
 
+	* lisp/sawfish/wm/commands/user.jl: added display-workspace-name
+	                                    clipboard-preview-clip-length is now a defcustom
+					    clipboard-preview-timeout is now a defcustom
+
+	* OPTIONS
+	* man/news.texi: updated
+
 2009-09-12  Christopher Bratusek <zanghar freenet de>
 	* lisp/sawfish/wm/focus.jl: doc for focus-revert
 	                            indention improvements
diff --git a/OPTIONS b/OPTIONS
index 4dbb9d9..0b97718 100644
--- a/OPTIONS
+++ b/OPTIONS
@@ -648,3 +648,11 @@
 
 ;; (define-special-variable clipboard-preview-timeout 5
 ;;   "Maximum time to let `view-clipboard' stay running")
+
+;; display-workspace-name options
+
+;; (define-special-variable display-ws-name-on-switch nil
+;;   "Wether to display workspace name upon switch")
+
+;; (define-special-variable display-ws-name-timeout 3
+;;   "How long to display workspace name")
diff --git a/lisp/sawfish/wm/commands/user.jl b/lisp/sawfish/wm/commands/user.jl
index 681106e..06b6878 100644
--- a/lisp/sawfish/wm/commands/user.jl
+++ b/lisp/sawfish/wm/commands/user.jl
@@ -28,7 +28,8 @@
 	    some
 	    display-message-with-timeout
 	    program-available
-	    view-clipboard)
+	    view-clipboard
+	    display-workspace-name)
 
     (open rep
 	  rep.system
@@ -38,6 +39,7 @@
 	  sawfish.wm.misc
 	  sawfish.wm.custom
 	  sawfish.wm.commands
+	  sawfish.wm.workspace
 	  sawfish.wm.util.selection)
 
   (defgroup apps "Default Applications" :group misc)
@@ -68,9 +70,6 @@
       (system (format nil "%s %s >/dev/null 2>&1 </dev/null &"
                       browser-program website))))
 
-  (defvar clipboard-preview-clip-length 60)
-  (defvar clipboard-preview-timeout 5)
-
   ;; some
   ;; XXX description
   (define (some pred lst)
@@ -92,6 +91,16 @@
       (file-exists-p (concat dir "/" cmd)))
       (string-split ":" (getenv "PATH"))))
 
+  (defcustom clipboard-preview-clip-length 60
+    "Maximum length of Clipboard Preview"
+    :type number
+    :group misc)
+
+  (defcustom clipboard-preview-timeout 5
+    "How long to display Clipboard Preview"
+    :type number
+    :group misc)
+
   ;; view-clipboard
   ;; view the content of the primary x-clipboard
   (define (view-clipboard)
@@ -103,7 +112,33 @@
         (display-message-with-timeout (format nil "%s ..."
           (substring c 0 clipboard-preview-clip-length)) clipboard-preview-timeout)))))
 
+  (defcustom display-ws-name-on-switch nil
+    "Wether to display workspace name upon switch"
+    :type boolean
+    :group workspace
+    :after-set (lambda () (display-ws-name-setter)))
+
+  (defcustom display-ws-name-timeout 3
+    "How long to display workspace name"
+    :type number
+    :group workspace)
+
+  ;; display-workspace-name
+  ;; display WS name on switch
+  (define (display-workspace-name)
+    (display-message-with-timeout
+       (format nil "Entered Workspace: %s"
+         (or (nth current-workspace workspace-names)
+           (format nil (_ "Workspace %d") (1+ current-workspace))))
+             display-ws-name-timeout))
+
+  (define (display-ws-name-setter)
+    (if (eq display-ws-name-on-switch 't)
+      (add-hook 'enter-workspace-hook display-workspace-name)
+      (remove-hook 'enter-workspace-hook display-workspace-name)))
+
   ;;###autoload
   (define-command 'xterm xterm #:class 'default)
   (define-command 'browser browser #:class 'default)
-  (define-command 'view-clipboard view-clipboard #:class 'default))
+  (define-command 'view-clipboard view-clipboard #:class 'default)
+  (define-command 'display-workspace-name display-workspace-name #:class 'default))
diff --git a/lisp/sawfish/wm/tabs/tab.jl b/lisp/sawfish/wm/tabs/tab.jl
index 84d02c4..255a093 100644
--- a/lisp/sawfish/wm/tabs/tab.jl
+++ b/lisp/sawfish/wm/tabs/tab.jl
@@ -23,7 +23,7 @@
 
 (define-structure sawfish.wm.tabs.tab
 
-	(export tab-add-to-group )
+	(export tab-add-to-group)
 
 	(open rep
 	      rep.system
@@ -64,7 +64,7 @@
     :group tabs
     :type number)
 
-  (defcustom tab-raise-on-hover nil 
+  (defcustom tab-raise-on-hover nil
     "Raise Tabs on Hover"
     :group tabs
     :type boolean
diff --git a/man/news.texi b/man/news.texi
index e5decb8..e290d99 100644
--- a/man/news.texi
+++ b/man/news.texi
@@ -85,6 +85,8 @@ your system, but the later doesn't
 
 @item Improve position matcher to bind a window to a position (either @code{center} @code{east} @code{north} @code{north-east} @code{north-west} @code{south} @code{south-east} @code{south-west} @code{west}) OR to a user-given position [Jeremy Hankins]
 
+ item When entering a different Workspace, it's now possible to display the name of it (like in Enlightenment) [Christopher Bratusek]
+
 @item When GNOME Integration is loaded, don't remove @code{quit} and @code{restart} entries from menu [Christopher Bratusek]
 
 @item When GNOME Integration is loaded, append @code{Logout}- and @code{Shutdown from GNOME} entries to Session sub-menu [Christopher Bratusek]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]