diff options
author | ThanosApollo <[email protected]> | 2022-10-31 15:47:20 +0200 |
---|---|---|
committer | ThanosApollo <[email protected]> | 2022-10-31 15:47:20 +0200 |
commit | 32ad12a11a92c5f864b630ef9412c7e8b9b6a3cb (patch) | |
tree | 4099285b9508c6ad80a67e56d3e5351e36fb50dc /.emacs.d/lisp/init-exwm.el | |
parent | 8e9f8e4db034a580377b67541a15db7478c85e89 (diff) |
Add lisp modules&exwm
Diffstat (limited to '.emacs.d/lisp/init-exwm.el')
-rw-r--r-- | .emacs.d/lisp/init-exwm.el | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-exwm.el b/.emacs.d/lisp/init-exwm.el new file mode 100644 index 0000000..d1dc888 --- /dev/null +++ b/.emacs.d/lisp/init-exwm.el @@ -0,0 +1,81 @@ +;;; package : EXWM configuration --- +;;; .* --- .* + +;;; Code: + + + +(defun apollo/exwm-update-class () + (exwm-workspace-rename-buffer exwm-class-name)) + +(use-package exwm + :config + (setq exwm-workspace-number 5) + ;; When window "class" updates, use it to set the buffer name + (add-hook 'exwm-update-class-hook #'apollo/exwm-update-class) + + + (start-process-shell-command + "xrandr" nil "xrandr --output DisplayPort-0 --off --output DisplayPort-1 --off --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal") + + ;; Rebind CapsLock to Ctrl + + + ;; Set the screen resolution (update this to be the correct resolution for your screen!) + (require 'exwm-randr) + (exwm-randr-enable) + ;; (start-process-shell-command "xrandr" nil "xrandr --output Virtual-1 --primary --mode 2048x1152 --pos 0x0 --rotate normal") + + ;; Load the system tray before exwm-init + (require 'exwm-systemtray) + (exwm-systemtray-enable) + + ;; These keys should always pass through to Emacs + (setq exwm-input-prefix-keys + '(?\C-x + ?\C-u + ?\C-h + ?\M-x + ?\M-` + ?\M-& + ?\M-: + ?\C-\M-j ;; Buffer list + ?\C-\ )) ;; Ctrl+Space + + ;; Ctrl+Q will enable the next key to be sent directly + (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) + + ;; Set up global key bindings. These always work, no matter the input state! + ;; Keep in mind that changing this list after EXWM initializes has no effect. + (setq exwm-input-global-keys + `( + ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard) + ([?\s-r] . exwm-reset) + + ;; Move between windows + ([s-left] . windmove-left) + ([s-right] . windmove-right) + ([s-up] . windmove-up) + ([s-down] . windmove-down) + + ;; Launch applications via shell command + ([?\s-&] . (lambda (command) + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command command nil command))) + + ;; Switch workspace + ([?\s-w] . exwm-workspace-switch) + ([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0))) + + ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9) + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + (number-sequence 0 9)))) + (exwm-enable)) + +(provide 'init-exwm) + +;;; init-exwm.el ends here |