Wikia

Sawfish

Window menu item shortcuts

773pages on
this wiki
Talk0
Browse all patches

Author Edit

Fernando Carmona Varo and Guillermo S. Romero

Synopsis Edit

The keyboard support for menu items is not very good in sawfish in my opinion, making menus kind of ankward to use if you are not using a mouse.

This patch activates some chars of the menu items to be used as shortcut keys.

for example, if you have Alt+Space as a key-binding to popup the menu, you will be able to maximize the window pressing "Alt-Space x" ...or make it be always on top pressing "Alt-Space i u". Kind of key chain shortcuts.

Also, the patch adds "Move" and "Resize" that were missing.

Patch testing Edit

  1. Copy/paste the patch listed below into some file, eg. TEST.diff.
  2. If you don't have sawfish sources yet, have one, as described get it from GIT repo.
  3. Go into the directory where sawfish sources reside, eg. cd sawfish
  4. Test if the patch applies cleanly with this command:
    patch -p1 --ignore-whitespace --dry-run < TEST.diff
    in case of problems try also: -p0 or -p2
  5. If it applies cleanly, then remove the --dry-run from above command and run it again, otherwise ask on the mailing list.
  6. Compile sawfish: ./autogen.sh && make
  7. Install it for testing, but it depends on your linux distribution.
    1. It is always better to install sawfish as your distribution package, but it is different for each distribution.
    2. So you may try make install, which will install sawifish in /usr/local/share/sawfish/ (if you have write access). But then make sure that you run the correct version and delete it from that directory afterwards, to avoid any conflicts.
  8. Se also

PS: edit this template if you feel that those instructions can be improved.

Patch Edit

Index: lisp/sawfish/wm/menus.jl
===================================================================
--- lisp/sawfish/wm/menus.jl	(revision 4251)
+++ lisp/sawfish/wm/menus.jl	(revision 4252)
@@ -83,16 +83,18 @@
   (define menu-timer nil)
 
   (defvar window-ops-menu
-    `((,(_ "Minimize") iconify-window
+    `((,(_ "Mi_nimize") iconify-window
        (insensitive . ,(lambda (w)
-			 (not (window-iconifiable-p w)))))
+                         (not (window-iconifiable-p w)))))
       (,(lambda (w)
-	  (if (window-maximized-p w)
-	      (_ "Unmaximize")
-	    (_ "Maximize"))) maximize-window-toggle
-       (insensitive . ,(lambda (w)
-			 (not (or (window-maximized-p w)
-				  (window-maximizable-p w))))))
+          (if (window-maximized-p w)
+              (_ "Unma_ximize")
+            (_ "Ma_ximize"))) maximize-window-toggle
+            (insensitive . ,(lambda (w)
+                              (not (or (window-maximized-p w)
+                                       (window-maximizable-p w))))))
+      (,(_ "_Move") move-window-interactively)
+      (,(_ "_Resize") resize-window-interactively)
       (,(_ "_Close") delete-window)
       ()
       (,(_ "_Toggle") . window-ops-toggle-menu)
@@ -100,15 +102,15 @@
       (,(_ "_Send window to")
        (,(_ "_Previous workspace") send-to-previous-workspace)
        (,(_ "_Next workspace") send-to-next-workspace)
-       (,(_ "Copy to previous") copy-to-previous-workspace)
-       (,(_ "Copy to next") copy-to-next-workspace))
-      (,(_ "Stacking")
-       (,(_ "Raise") raise-window)
-       (,(_ "Lower") lower-window)
-       (,(_ "Upper layer") raise-window-depth)
-       (,(_ "Lower layer") lower-window-depth))
-      (,(_ "Frame type") . frame-type-menu)
-      (,(_ "Frame style") . frame-style-menu)))
+       (,(_ "Copy to p_revious") copy-to-previous-workspace)
+       (,(_ "Copy to ne_xt") copy-to-next-workspace))
+      (,(_ "Stac_king")
+       (,(_ "_Raise") raise-window)
+       (,(_ "_Lower") lower-window)
+       (,(_ "_Upper layer") raise-window-depth)
+       (,(_ "Lo_wer layer") lower-window-depth))
+      (,(_ "Frame ty_pe") . frame-type-menu)
+      (,(_ "Frame sty_le") . frame-style-menu)))
 
   (defvar window-ops-toggle-menu '())

Community's reasons for inclusion or rejection Edit

Patch submitters, please vote also! Yes, obviosuly your vote will be positive, but it's the place to give your explanation why this patch is good for all Sawfish users, and why it is correct - good reasons for inclusion.

When voting anonymously please write your name, so that it can be associated with your posts on the mailing list. If you are logged in you can sign yourself by typing four tilda characters: ~~~~.

  • Yes vote: yes. - Author's vote. This is a very very simple thing but it is something that most window managers have and that I miss whenever I use sawfish, since I've got used to it. Using key chain shortcuts instead of single shortcuts allows for more keys to be used. Also, being menus, you can actually see other options and slow down looking their shortcuts if you don't remember them. -Ferk(talk!) 01:51, 21 July 2008 (UTC)
  • Yes vote: yes. (was pondering) - The idea is nice, but some of the selected keys look pretty arbitrary, and not all functions have to be bound. Normally first letters are prefered, and some others (thin, characters with descenders, vocals) are better avoided until they become the last resort (for reading clarity or spelling). Repeating is fine if in different submenus. Based in that I am considering commiting with _Move, Stac_king, _Frame type, F_rame style (I have doubts last is or even both are so important to have accelerators... then I guess In _group should be there too, similar importance than style); _Raise, _Lower, _Upper layer (vocal, but p has descender... hard choice), Lo_wer layer; Copy to p_revious and copy to ne_xt (p and n already taken). GSR 01:35, 22 July 2008 (UTC)
In my opinion, the aim of this shortcuts is to be a fast and easy to type way to operate. I've chosen these chars because they are easier and faster to touch-type. O and P and next to each other in the keyboard, I(stacking) is right next to U(upper) and O(lower), and for raising it's just I I. I think it is more important that the keys are easy to type than to use a hard to follow naming convention. In fact, I think it would be much better to be able to have a key associated that was independent from the string.. (maybe showing the shortcut in italic, between brackets) that could allow keys like C-a a M-a etc, the current behavior is even language dependant. But...well.. as long as there's available some kind of item menu keyshortcuts for this, whatever they are, I think it would be already an improvement. Thank you. -Ferk(talk!) 05:30, 22 July 2008 (UTC)
Oh! I didn't noticed the _previous thing (I thought I changed that right before comiting). Sorry. -Ferk(talk!) 05:38, 22 July 2008 (UTC)
Commited with some changes (svn r4252). Thanks for reporting the issue. GSR 21:09, 4 August 2008 (UTC)

Around Wikia's network

Random Wiki