From 2c47c722155d6c906c42e1cd2910bd66a719bc0b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 26 Nov 2013 01:36:24 +0100 Subject: Integrate window navigation with Emacs --- .stumpwmrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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") -- cgit v1.2.3-54-g00ecf