From: Amin Bandali Date: Thu, 5 Sep 2019 20:24:20 +0000 (-0400) Subject: emacs: exwm: rearrange and enable some bindings X-Git-Url: https://git.shemshak.org/~bandali/configs/commitdiff_plain/24e1e73e5492b8b8a072bd080ce446ee5697a3fd?ds=sidebyside;hp=39bee83111bd0573e021b4eafc9a3f1bd6cf0a25 emacs: exwm: rearrange and enable some bindings --- diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d4baa88..ccd55d2 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -671,46 +671,6 @@ needed." (interactive) (exwm-manage--kill-client))) - ;; Shorten 'C-c C-q' to 'C-q' - (define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key) - - ;; Line-editing shortcuts - (setq exwm-input-simulation-keys - '(;; movement - ([?\C-b] . [left]) - ([?\M-b] . [C-left]) - ([?\C-f] . [right]) - ([?\M-f] . [C-right]) - ([?\C-p] . [up]) - ([?\C-n] . [down]) - ([?\C-a] . [home]) - ([?\C-e] . [end]) - ([?\M-v] . [prior]) - ([?\C-v] . [next]) - ([?\C-d] . [delete]) - ([?\C-k] . [S-end ?\C-x]) - ;; cut/copy/paste - ([?\C-w] . [?\C-x]) - ([?\M-w] . [?\C-c]) - ([?\C-y] . [?\C-v]) - ([?\M-d] . [C-S-right ?\C-x]) - ([?\M-\d] . [C-S-left ?\C-x]) - ;; search - ([?\C-s] . [?\C-f]) - ;; escape - ([?\C-g] . [escape]))) - - ;; Enable EXWM - (exwm-enable) - - (add-hook 'exwm-init-hook #'exwm-config--fix/ido-buffer-window-other-frame) - - (require 'exwm-systemtray) - (exwm-systemtray-enable) - - (require 'exwm-randr) - (exwm-randr-enable) - ;; (exwm-input-set-key ;; (kbd "s-SPC") ;; rofi doesn't properly launch programs when started from emacs ;; (lambda () @@ -747,54 +707,63 @@ needed." (interactive) (start-process-shell-command "pamixer" nil "pamixer --allow-boost --increase 5"))) - ;; (exwm-input-set-key - ;; (kbd "") - ;; (lambda () - ;; (interactive) - ;; (start-process-shell-command "mpc" nil "mpc toggle"))) + (exwm-input-set-key + (kbd "") + (lambda () + (interactive) + (start-process-shell-command "mpc" nil "mpc toggle"))) - ;; (exwm-input-set-key - ;; (kbd "") - ;; (lambda () - ;; (interactive) - ;; (start-process-shell-command "mpc" nil "mpc prev"))) + (exwm-input-set-key + (kbd "") + (lambda () + (interactive) + (start-process-shell-command "mpc" nil "mpc prev"))) - ;; (exwm-input-set-key - ;; (kbd "") - ;; (lambda () - ;; (interactive) - ;; (start-process-shell-command "mpc" nil "mpv next"))) + (exwm-input-set-key + (kbd "") + (lambda () + (interactive) + (start-process-shell-command "mpc" nil "mpc next"))) - (defun b/exwm-pasystray () - "A command used to start pasystray." - (interactive) - (if (executable-find "pasystray") - (progn - (message "EXWM: starting pasystray ...") - (start-process-shell-command "pasystray" nil "pasystray --notify=all")) - (message "EXWM: pasystray is not installed, abort!"))) - ;; (add-hook 'exwm-init-hook #'b/exwm-pasystray) - - (defun b/exwm-nm-applet () - "A command used to start nm-applet." - (interactive) - (if (executable-find "nm-applet") - (progn - (message "EXWM: starting nm-applet ...") - (start-process-shell-command "nm-applet" nil "nm-applet")) - (message "EXWM: nm-applet is not installed, abort!"))) - ;; (add-hook 'exwm-init-hook #'b/exwm-nm-applet) - - (defun b/exwm-light-locker () - "Start light-locker to make `dm-tool lock' actually work." - (interactive) - (if (executable-find "light-locker") - (progn - (message "EXWM: starting light-locker ...") - (start-process-shell-command "light-locker" nil "light-locker --lock-on-suspend")) - (message "EXWM: light-locker is not installed, abort!"))) - ;;(add-hook 'exwm-init-hook #'b/exwm-light-locker) - ) + ;; Shorten 'C-c C-q' to 'C-q' + (define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key) + + ;; Line-editing shortcuts + (setq exwm-input-simulation-keys + '(;; movement + ([?\C-b] . [left]) + ([?\M-b] . [C-left]) + ([?\C-f] . [right]) + ([?\M-f] . [C-right]) + ([?\C-p] . [up]) + ([?\C-n] . [down]) + ([?\C-a] . [home]) + ([?\C-e] . [end]) + ([?\M-v] . [prior]) + ([?\C-v] . [next]) + ([?\C-d] . [delete]) + ([?\C-k] . [S-end ?\C-x]) + ;; cut/copy/paste + ([?\C-w] . [?\C-x]) + ([?\M-w] . [?\C-c]) + ([?\C-y] . [?\C-v]) + ([?\M-d] . [C-S-right ?\C-x]) + ([?\M-\d] . [C-S-left ?\C-x]) + ;; search + ([?\C-s] . [?\C-f]) + ;; escape + ([?\C-g] . [escape]))) + + ;; Enable EXWM + (exwm-enable) + + (add-hook 'exwm-init-hook #'exwm-config--fix/ido-buffer-window-other-frame) + + (require 'exwm-systemtray) + (exwm-systemtray-enable) + + (require 'exwm-randr) + (exwm-randr-enable)) ;; use the org-plus-contrib package to get the whole deal (use-package org-plus-contrib)