[README] [IMPORTANT] Proposal of tuneable edge-actions (2.90)



Hi all,

as you surely noticed I did some work on ID (infinite-desktop), EF (edge-flip), added EU
(edge-utils), HS (hot-spots) and improved FC (flippers.c (sawfish.wm.edge.flippers)).

Next I want to propose the following: get rid of each of ID, EF or HS hook into
enter-flipper-hook and only have a wrapper func beeing added. I already wrote that
wrapper func locally. It allows the four edges to have different actions, while ignoring
the corners (set hot-spots-area to 0 to practically disable the corners).

To try it out you need to:

- completely remove all options for ID, HS and EF from both sawfishrc and sawfish/custom
  (well, anything but HS' *-program, so that HS still knows what to do)
- apply the attached patch to sawfish-2.90 branch and install it

Another side effect would be that the options for enabling HS, ID or EF can safely be
removed (that would also make the first adjustment above unnecessary, as they couldn't
start themselves then). Instead there should be an defcustom activate-edges, which then
inits the below function.

It's pretty cool I think:

;; fancy customized edge-actions

;; define/defun most be done *before* require of hot-spots!
( define (top-left-corner-program)
  ( jump-or-exec "Iceweasel" "iceweasel" t ) )

( define (top-right-corner-program)
  ( pager-unhide ) )

;; amarok doesn't need jump-or-exec
( defvar-setq bottom-right-corner-program "amarok" )

( define (bottom-left-corner-program)
  ( jump-or-exec "VirtualBox" "VirtualBox" t ) )

( require 'sawfish.wm.edge.util )
( require 'sawfish.wm.edge.flip )
( require 'sawfish.wm.edge.hot-spots )
( require 'sawfish.wm.edge.infinite-desktop )

(defvar-setq left-edge-func 'edge-flip)
(defvar-setq right-edge-func 'edge-flip)
(defvar-setq bottom-edge-func 'none)

(define (top-edge-func)
  ;; note that toggle-or-exec is not yet in
  ;; sawfish 2.90 -- but will be
  (toggle-or-exec "Konsole" "konsole" t))

(define (edge-action-func func edge)
  ;; simply ignore any other case
  (case func
    ((hot-spot)
     (hot-spots-hook))
    ((infinite-desktop)
     (infinite-desktop-hook))
    ((edge-flip)
     (edge-flip-enter edge))))

(define (edge-action-init)
  (let ((edge (get-active-edge)))
    ;; ignore corners, so that hot-spots works correctly
    (if (get-active-corner)
        (hot-spots-hook)
      (setq func nil)
      (cond ((eq edge 'left)
	     (if (functionp left-edge-func)
	         (funcall left-edge-func)
	       (setq func left-edge-func)))
	    ((eq edge 'right)
	     (if (functionp right-edge-func)
	         (funcall right-edge-func)
	       (setq func right-edge-func)))
	    ((eq edge 'top)
	     (if (functionp top-edge-func)
	         (funcall top-edge-func)
	       (setq func top-edge-func)))
	    ((eq edge 'bottom)
	     (if (functionp bottom-edge-func)
	         (funcall bottom-edge-func)
	       (setq func bottom-edge-func))))
      (when func
        (edge-action-func func edge)))))

;; do this
(flippers-activate t)
(add-hook 'enter-flipper-hook edge-action-init)

OK. I'm pretty sure you'll be thrilled :D

So let's start the discussion,
Chris
diff --git a/lisp/sawfish/wm/edge/flip.jl b/lisp/sawfish/wm/edge/flip.jl
index 5f6ee40..b1801c4 100644
--- a/lisp/sawfish/wm/edge/flip.jl
+++ b/lisp/sawfish/wm/edge/flip.jl
@@ -20,7 +20,8 @@
 
 (define-structure sawfish.wm.edge.flip
 
-    (export edge-flip-enable)
+    (export edge-flip-enable
+	    edge-flip-enter)
 
     (open rep
 	  rep.system
diff --git a/lisp/sawfish/wm/edge/hot-spots.jl b/lisp/sawfish/wm/edge/hot-spots.jl
index 069c6f6..1ecb6ed 100644
--- a/lisp/sawfish/wm/edge/hot-spots.jl
+++ b/lisp/sawfish/wm/edge/hot-spots.jl
@@ -20,7 +20,8 @@
 
 (define-structure sawfish.wm.edge.hot-spots
 
-    (export hot-spots-activate)
+    (export hot-spots-activate
+	    hot-spots-hook)
 
     (open rep
 	  rep.system
diff --git a/lisp/sawfish/wm/edge/infinite-desktop.jl b/lisp/sawfish/wm/edge/infinite-desktop.jl
index bb10776..ba28a22 100644
--- a/lisp/sawfish/wm/edge/infinite-desktop.jl
+++ b/lisp/sawfish/wm/edge/infinite-desktop.jl
@@ -20,7 +20,8 @@
 
 (define-structure sawfish.wm.edge.infinite-desktop
 
-    (export infinite-desktop-enable)
+    (export infinite-desktop-enable
+	    infinite-desktop-hook)
 
     (open rep
           rep.system
@@ -37,7 +38,7 @@
   (defgroup infinite-desktop "Infinite Desktop"
     :group workspace)
 
-  (defcustom infinite-desktop-p t
+  (defcustom infinite-desktop-p nil
     "\"Infinite desktop\", or smooth viewport motion with mouse (Conflicts edge-flipping)."
     :group (workspace infinite-desktop)
     :after-set (lambda () (infinite-desktop-enable))


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