diff options
author | 2012-10-12 08:52:53 +0200 | |
---|---|---|
committer | 2012-10-12 08:52:53 +0200 | |
commit | 77c39ea0f082446f21981bd0876a4f1fde3c4807 (patch) | |
tree | 8843848d7c92d6be20a3e23bd22c0c9e5218022d /.sawfish/rc | |
parent | 8bcf0ae40fc2e9c6565567131218029768859839 (diff) | |
parent | 1f3bdb9e4490e20aefd7038a507aee50c76728dc (diff) | |
download | dotfiles-77c39ea0f082446f21981bd0876a4f1fde3c4807.tar.gz dotfiles-77c39ea0f082446f21981bd0876a4f1fde3c4807.zip |
Merge remote-tracking branch 'origin/master' into phoenix
Conflicts:
.config/cower/config
.emacs.d/init.el
Diffstat (limited to '.sawfish/rc')
-rw-r--r-- | .sawfish/rc | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/.sawfish/rc b/.sawfish/rc new file mode 100644 index 0000000..23fd5e6 --- /dev/null +++ b/.sawfish/rc @@ -0,0 +1,119 @@ +(setq user-apps-menu + '(("Emacs" (system "emacsclient -c &")) + ("Terminal" (system "urxvt &")))) + +(define oni:window-packing-keymap (make-keymap)) + +(bind-keys oni:window-packing-keymap + "p" 'pack-window-up + "n" 'pack-window-down + "b" 'pack-window-left + "f" 'pack-window-right) + +(define oni:window-growing-keymap (make-keymap)) + +(bind-keys oni:window-growing-keymap + "p" 'grow-window-up + "n" 'grow-window-down + "b" 'grow-window-left + "f" 'grow-window-right) + +(define oni:window-shrinking-keymap (make-keymap)) + +(bind-keys oni:window-shrinking-keymap + "p" 'shrink-window-up + "n" 'shrink-window-down + "b" 'shrink-window-left + "f" 'shrink-window-right) + +(define oni:window-yanking-keymap (make-keymap)) + +(bind-keys oni:window-yanking-keymap + "p" 'yank-window-up + "n" 'yank-window-down + "b" 'yank-window-left + "f" 'yank-window-right) + +(define oni:window-management-keymap (make-keymap)) + +(bind-keys oni:window-management-keymap + "M" 'maximize-window-toggle + "p" oni:window-packing-keymap + "g" oni:window-growing-keymap + "s" oni:window-shrinking-keymap + "y" oni:window-yanking-keymap) + +(bind-keys global-keymap + "XF86AudioPlay" '(run-shell-command "mpc toggle") + "XF86AudioStop" '(run-shell-command "mpc stop") + "XF86AudioMute" '(run-shell-command "amixer sset Master toggle") + "XF86AudioLowerVolume" '(run-shell-command "mpc volume -5") + "XF86AudioRaiseVolume" '(run-shell-command "mpc volume +5") + "XF86AudioPrev" '(run-shell-command "mpc prev") + "XF86AudioNext" '(run-shell-command "mpc next")) + +(require 'sawfish.wm.util.prompt) + +(define oni:extended-keymap (make-keymap)) + +(bind-keys oni:extended-keymap + "w" oni:window-management-keymap) + +;; (ungrab-keymap global-keymap) +(bind-keys global-keymap + "Super-!" '(run-shell-command (prompt-for-string "Run: ")) + "C-M-l" '(run-shell-command "i3lock -c \"#000000\"") + "Super-e" '(run-shell-command (getenv "EDITOR")) + "Super-w" '(run-shell-command (getenv "BROWSER")) + "Super-c" '(run-shell-command "urxvt") + "Super-TAB" 'cycle-windows + "Super-x" oni:extended-keymap + "Menu" 'popup-root-menu) +;; (grab-keymap global-keymap) + +(setq prompt-color (cons (get-color "#eeeeec") + (get-color "#252e2b"))) + +(setq default-frame-style 'naquadah) + +(require 'sawfish.wm.ext.match-window) + +(add-window-matcher '((WM_CLASS . "^Firefox/Navigator$")) + '((position . north-east))) + +(require 'rep.regexp) +(require 'sawfish.wm.commands.grow-pack) +(require 'sawfish.wm.commands.shrink-yank) + +(defun oni:emacs-main-window-p (window) + "Check wether or not WINDOW is Emacs' main window." + (let ((name (window-name window))) + (and (string-match "^emacs: " name) + (not (string= "emacs: *Sauron*" name))))) + +(defun oni:place-emacs-windows () + "Place Emacs' main, sauron and optionally speedbar windows the +way I like them." + (let ((main-window (car (filter-windows oni:emacs-main-window-p))) + (sauron-window (get-window-by-name "emacs: *Sauron*")) + (speedbar-window (get-window-by-name "^Speedbar " #:regex t))) + (move-window-to main-window 0 0) + (move-window-to sauron-window 0 0) + + (set-window-type sauron-window 'transient) + (pack-window-down sauron-window) + (grow-window-right sauron-window) + + (when speedbar-window + (move-window-to speedbar-window 0 0) + (set-window-type speedbar-window 'transient) + (yank-window-right main-window) + (grow-window-down speedbar-window)) + + (grow-window-down main-window) + (grow-window-right main-window))) + +(define-command 'oni:place-emacs-windows oni:place-emacs-windows) + +(bind-keys oni:window-management-keymap + "E" 'oni:place-emacs-windows) |