aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-11-26 01:36:24 +0100
committerGravatar Tom Willemse2013-11-26 01:36:24 +0100
commit2c47c722155d6c906c42e1cd2910bd66a719bc0b (patch)
treed54b671623b4ccde05bdb73f4d8bc46fea1c2d7b
parent3a37c4e6dff5daae0cbf364bcf9454f19dd95f95 (diff)
downloadstumpwm-2c47c722155d6c906c42e1cd2910bd66a719bc0b.tar.gz
stumpwm-2c47c722155d6c906c42e1cd2910bd66a719bc0b.zip
Integrate window navigation with Emacs
-rw-r--r--.stumpwmrc15
1 files changed, 15 insertions, 0 deletions
diff --git a/.stumpwmrc b/.stumpwmrc
index 55b1f7a..fccc802 100644
--- a/.stumpwmrc
+++ b/.stumpwmrc
@@ -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")