.sawfish/rc

This commit is contained in:
Tom Willemsen 2012-11-20 01:13:19 +01:00
parent 916245c018
commit 9c426f266e

View file

@ -5,6 +5,8 @@
(require 'sawfish.wm.ext.match-window) (require 'sawfish.wm.ext.match-window)
(require 'sawfish.wm.util.display-window) (require 'sawfish.wm.util.display-window)
(require 'sawfish.wm.util.prompt) (require 'sawfish.wm.util.prompt)
(require 'sawfish.wm.util.window-order)
(require 'sawfish.wm.commands.x-cycle)
(define oni:window-packing-keymap (make-keymap)) (define oni:window-packing-keymap (make-keymap))
(define oni:window-growing-keymap (make-keymap)) (define oni:window-growing-keymap (make-keymap))
@ -43,17 +45,24 @@ way I like them."
(define-command 'oni:place-emacs-windows oni:place-emacs-windows) (define-command 'oni:place-emacs-windows oni:place-emacs-windows)
(defun oni:run-or-raise (command class) (defun oni:run-or-raise (command #!key id name class role)
"Either run COMMAND, or if a window with class CLASS is found, "Either run COMMAND, or if a window with class CLASS is found,
raise it." raise it."
(let ((w (get-window-by-class class))) (let* ((windows (filter
(if w (lambda (x)
(display-window w) (and (or (not id) (equal (window-id x) id))
(or (not name (equal (window-name x) name)))
(or (not class) (equal (window-class x) class))
(or (not role) (equal (window-role x) role))))
(window-order)))
(first (car windows))
(w (if (equal first (input-focus)) (last windows) first)))
(if w (display-window w)
(run-shell-command command)))) (run-shell-command command))))
(setq default-frame-style 'naquadah) (setq default-frame-style 'naquadah)
(setq prompt-color (cons (get-color "#eeeeec") (setq prompt-color (cons (get-color "#eeeeec")
(get-color "#252e2b"))) (get-color "#111113")))
(setq user-apps-menu (setq user-apps-menu
'(("Emacs" (system "emacsclient -c &")) '(("Emacs" (system "emacsclient -c &"))
("Terminal" (system "urxvt &")))) ("Terminal" (system "urxvt &"))))
@ -103,14 +112,18 @@ raise it."
"w" oni:window-management-keymap) "w" oni:window-management-keymap)
;; (ungrab-keymap global-keymap) ;; (ungrab-keymap global-keymap)
(bind-keys global-keymap (bind-keys
global-keymap
"Super-!" '(run-shell-command (prompt-for-string "Run: ")) "Super-!" '(run-shell-command (prompt-for-string "Run: "))
"C-M-l" '(run-shell-command "i3lock -c \"#000000\"") "C-M-l" '(run-shell-command "i3lock -c \"#000000\"")
"Super-e" '(oni:run-or-raise (getenv "EDITOR") "Emacs") "Super-e" '(oni:run-or-raise (getenv "EDITOR") #:class "Emacs")
"Super-E" '(run-shell-command (getenv "EDITOR")) "Super-E" '(run-shell-command (getenv "EDITOR"))
"Super-w" '(run-shell-command (getenv "BROWSER")) "Super-w" '(oni:run-or-raise (getenv "BROWSER") #:class "Conkeror")
"Super-c" '(run-shell-command "urxvt") "Super-W" '(run-shell-command (getenv "BROWSER"))
"Super-c" '(oni:run-or-raise "urxvt" #:class "URxvt")
"Super-C" '(run-shell-command "urxvt")
"Super-TAB" 'cycle-windows "Super-TAB" 'cycle-windows
"C-Super-TAB" 'cycle-class
"Super-x" oni:extended-keymap "Super-x" oni:extended-keymap
"Super-f" 'pack-window-right "Super-f" 'pack-window-right
"Super-b" 'pack-window-left "Super-b" 'pack-window-left