|Scripts quick access edit this|
- Author: Ryan Pavlik
- Version: 1.0
- License: MIT
- Download: Window-mode.jl (upload)
- Homepage: https://github.com/rpav/sawfish-ext/
This implements a togglable "window mode" with a custom keymap for window-manipulation keys.
"Window mode" implements a modal "window editing" mode. This may be useful on some keyboards with fewer modifier keys or where it's desirable to toggle into a "window editing" mode.
For instance, if you use Focus-by-direction, bind pack and grow directions, and similar, sawfish can become quite handy to navigate via keyboard without eating a lot of "normally" global bindings.
But this is a huge hack, so watch out:
This alters the binding of global-keymap when you toggle into window mode. This means in theory it may be possible to blow away your carefully-crafted global keymap, if you try. For instance, if you toggle into window-mode, open the configuration editor, modify the new global keymap (which is now pointing at the window-mode keymap), save, and crash or kill sawfish before toggling back, you'll probably lose.
For the record, this has never happened to me. I also made Messages for just this purpose: it displays a big red "Window mode ON" in the corner of your screen, which is hopefully hard to miss. I recommend just avoiding altering bindings while window mode is on.
This requires Messages. Put that and this script in your sawfish lisp directory, and add the following to your startup file:
You will then need to bind a key to activate the mode, see below.
You can configure bindings in sawfish-config, in the Bindings section, by selecting "Window mode global keymap" at the bottom. This starts with "Super-v" bound to "Window mode toggle", which will turn the mode off. Bind any other keys you want to use while in window mode here.
To activate window mode, add a binding to the Global keymap which calls "Window mode toggle". I recommend using the same key in both maps. (I also bind it to a modifier-mouse-button combination, so I can do window manipulations easily with just a mouse and one hand on the keyboard!)