diff options
author | Tom Willemse | 2013-11-26 01:36:24 +0100 |
---|---|---|
committer | Tom Willemse | 2013-11-26 01:36:24 +0100 |
commit | 2c47c722155d6c906c42e1cd2910bd66a719bc0b (patch) | |
tree | d54b671623b4ccde05bdb73f4d8bc46fea1c2d7b | |
parent | 3a37c4e6dff5daae0cbf364bcf9454f19dd95f95 (diff) | |
download | stumpwm-2c47c722155d6c906c42e1cd2910bd66a719bc0b.tar.gz stumpwm-2c47c722155d6c906c42e1cd2910bd66a719bc0b.zip |
Integrate window navigation with Emacs
-rw-r--r-- | .stumpwmrc | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -104,6 +104,17 @@ (when mpd-was-playing-p (sb-ext:run-program "/usr/bin/mpc" '("play") :wait nil)))) +(defcommand emacs-move-focus (dir) ((:direction "Direction: ")) + "Move focus in direction DIR. + +If the current window is an Emacs window, let it handle the event +itself." + (let ((cw (current-window))) + (if (and cw (string= (window-class cw) "Emacs")) + (send-fake-key + cw (kbd (format nil "S-~a" (string-capitalize dir)))) + (move-focus dir)))) + (defcommand run-emacs () () "Open Emacs" (run-shell-command *emacs-program*)) @@ -197,6 +208,10 @@ Run `*lock-screen-hook*' before locking it and run (define-key *top-map* (kbd "XF86AudioPlay") "exec mpc toggle") (define-key *top-map* (kbd "XF86AudioPrev") "exec mpc prev") (define-key *top-map* (kbd "XF86AudioRaiseVolume") "exec mpc volume +5") +(define-key *top-map* (kbd "S-Down") "emacs-move-focus down") +(define-key *top-map* (kbd "S-Left") "emacs-move-focus left") +(define-key *top-map* (kbd "S-Right") "emacs-move-focus right") +(define-key *top-map* (kbd "S-Up") "emacs-move-focus up") (define-key *root-map* (kbd "c") "raise-urxvt") (define-key *root-map* (kbd "C") "run-urxvt") |