diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2020-05-14 15:02:06 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2020-05-14 15:02:06 +0200 |
commit | 7666fe49247b9e38d236914c7cb46d2c9a856ab9 (patch) | |
tree | f715a6eacfc27bde100e6e3b5ba406cad241f443 /init.org | |
parent | f98a12060f8ff38571c45df290850057d79e83db (diff) |
Remove Window management stuff.
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 75 |
1 files changed, 0 insertions, 75 deletions
@@ -840,81 +840,6 @@ When writing Org-mode documents or when browsing the web with Eww I prefer to se (add-hook 'org-mode-hook #'olivetti-mode) #+END_SRC -* Window management -:PROPERTIES: -:header-args: :noweb-ref exwm :noweb yes -:END: - -Obviously, I’m using Emacs as my window manager. Here’s the default configuration: - -#+BEGIN_SRC elisp -(require 'exwm) -(require 'exwm-config) -(exwm-config-default) -#+END_SRC - -Since I’ve remapped C-t to C-x, I need to add C-t to the permitted prefix keys. I also add =s-t= to the prefix keys to ensure that it is passed to EXWM in “line mode”. - -#+BEGIN_SRC elisp -(setq exwm-input-prefix-keys '(?\C-t ?\C-x ?\C-u ?\C-h ?\M-x ?\M-` ?\M-& ?\M-:)) -#+END_SRC - -Unfortunately, C-t is now swallowed by EXWM, which means that I cannot easily open a tab in a browser any more. Not a big deal because I can send =C-t= to the application with =C-x C-x= (which is really =C-t C-t= before translation) using simulated keys. - -#+BEGIN_SRC elisp -(setq exwm-input-simulation-keys - '(([?\C-b] . [left]) - ([?\C-f] . [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 delete]) - ([?\C-x ?\C-x] . [C-t]))) -#+END_SRC - -The most generic way around this is to switch from “line-mode” (where control characters are swallowed by EXWM) to “char-mode” (where almost all characters are passed through to the application). I use =s-t= to toggle the modes. The following snippet was taken from the [[https://emacs.stackexchange.com/a/33329][Emacs stackexchange site]]. - -#+BEGIN_SRC elisp -(defun fhd/exwm-input-line-mode () - "Set exwm window to line-mode and show mode line" - (call-interactively #'exwm-input-grab-keyboard) - (exwm-layout-show-mode-line)) - -(defun fhd/exwm-input-char-mode () - "Set exwm window to char-mode and hide mode line" - (call-interactively #'exwm-input-release-keyboard) - (exwm-layout-hide-mode-line)) - -(defun fhd/exwm-input-toggle-mode () - "Toggle between line- and char-mode" - (interactive) - (with-current-buffer (window-buffer) - (when (eq major-mode 'exwm-mode) - (if (equal (cadr (cadr mode-line-process)) "line") - (fhd/exwm-input-char-mode) - (fhd/exwm-input-line-mode))))) - -(exwm-input-set-key (kbd "s-t") #'fhd/exwm-input-toggle-mode) -#+END_SRC - -To make EXWM feel more like a proper desktop environment I also use the =desktop-environment= package, which binds common keys for brightness and volume control. - -#+BEGIN_SRC elisp -(require 'desktop-environment) -(desktop-environment-mode 1) -(setq desktop-environment-brightness-get-command "light") -(setq desktop-environment-brightness-set-command "light %s") -(setq desktop-environment-brightness-get-regexp "\\([0-9.]+\\)") -(setq desktop-environment-brightness-small-increment "-A 1") -(setq desktop-environment-brightness-normal-increment "-A 5") -(setq desktop-environment-brightness-small-decrement "-U 1") -(setq desktop-environment-brightness-normal-decrement "-U 5") -#+END_SRC - * Multimedia with EMMS :PROPERTIES: :header-args: :noweb-ref emms :noweb yes |