[Emacs] Improve EXWM config

Add keybind for `exwm-debug`, fix rofi keybinds

Autostart now executed through my script in bin.org

Correct argument for `:if` in `use-package` directives

Reorganize screens for current correct layout
This commit is contained in:
Lucien Cartier-Tilet 2022-03-15 18:21:56 +01:00
parent 3fa9d52ddc
commit 2c7d159e9b
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -3540,6 +3540,7 @@ mode), with the exception of ~s-RET~ which opens an eshell terminal.
(phundrak/leader-key (phundrak/leader-key
:infix "x" :infix "x"
"" '(:ignore t :which-key "EXWM") "" '(:ignore t :which-key "EXWM")
"d" #'exwm-debug
"k" #'exwm-input-send-next-key "k" #'exwm-input-send-next-key
"l" '((lambda () "l" '((lambda ()
(interactive) (interactive)
@ -3547,12 +3548,10 @@ mode), with the exception of ~s-RET~ which opens an eshell terminal.
:which-key "lock") :which-key "lock")
"r" '(:ignore t :wk "rofi") "r" '(:ignore t :wk "rofi")
"rr" '((lambda () (interactive) "rr" '((lambda () (interactive)
(with-temp-buffer (shell-command "rofi -show drun" (current-buffer) (current-buffer)))
(shell-command "rofi -show drun" (current-buffer) (current-buffer))))
:wk "drun") :wk "drun")
"rw" '((lambda () (interactive) "rw" '((lambda () (interactive)
(with-temp-buffer (shell-command "rofi -show window" (current-buffer) (current-buffer)))
(shell-command "rofi -show window" (current-buffer) (current-buffer))))
:wk "windows") :wk "windows")
"R" '(:ignore t :wk "restart") "R" '(:ignore t :wk "restart")
"Rr" #'exwm-reset "Rr" #'exwm-reset
@ -3573,33 +3572,13 @@ mode), with the exception of ~s-RET~ which opens an eshell terminal.
"RET" #'eshell-new) "RET" #'eshell-new)
#+end_src #+end_src
A couple of commands are also automatically executed: A couple of commands are also automatically executed through my
#+name: exwm-autostart-list ~autostart~ script written [[file:bin.org::#Autostart-a99e99e7][here]].
- ~mpc stop~ :: stops any music played by MPD (if any) when Emacs is #+name: exwm-autostart
launched. #+begin_src emacs-lisp :tangle no
- ~pumopm~ :: my power manager, you can see its code source [[https://labs.phundrak.com/phundrak/pumopm][here]]. (exwm/run-in-background "autostart")
- ~xss-lock plock~ :: automatically lock the desktop with my script [[file:bin.org::#Lock-635fcb38][plock]].
- ~xrdb -merge $HOME/.Xresources~ :: use the settings from my xresources
file
#+name: exwm-generate-autostarts
#+header: :exports results :tangle no
#+begin_src emacs-lisp :var autostarts=exwm-autostart-list :cache yes
(mapconcat (lambda (command)
(let* ((whitespace (rx (+ space)))
(raw-command (car (split-string (car command) "::" t whitespace)))
(command (replace-regexp-in-string (regexp-quote "~") "" raw-command)))
(format "%S" `(exwm/run-in-background ,command))))
autostarts
"\n")
#+end_src #+end_src
#+RESULTS[c480df0f806b0007d125e570ab95c7e17dc2199d]: exwm-generate-autostarts
: (exwm/run-in-background "mpc stop")
: (exwm/run-in-background "pumopm")
: (exwm/run-in-background "xss-lock plock")
: (exwm/run-in-background "xrdb -merge $HOME/.Xresources")
Finally, lets only initialize and start EXWM once functions from Finally, lets only initialize and start EXWM once functions from
exwm-randr ran, because otherwise having multiple monitors dont work. exwm-randr ran, because otherwise having multiple monitors dont work.
#+name: exwm-init #+name: exwm-init
@ -3611,7 +3590,7 @@ exwm-randr ran, because otherwise having multiple monitors dont work.
The complete configuration for the ~exwm~ package can be found below. The complete configuration for the ~exwm~ package can be found below.
#+begin_src emacs-lisp :noweb yes #+begin_src emacs-lisp :noweb yes
(use-package exwm (use-package exwm
:if (seq-contains-p command-line-args "--use-exwm") :if (seq-contains-p command-line-args "--with-exwm")
:straight (exwm :build t :straight (exwm :build t
:type git :type git
:host github :host github
@ -3635,7 +3614,7 @@ The complete configuration for the ~exwm~ package can be found below.
<<exwm-keybinds>> <<exwm-keybinds>>
<<exwm-generate-autostarts()>> <<exwm-autostart>>
<<exwm-init>>) <<exwm-init>>)
#+end_src #+end_src
@ -3646,7 +3625,7 @@ The complete configuration for the ~exwm~ package can be found below.
:END: :END:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package evil-exwm-state (use-package evil-exwm-state
:if (seq-contains-p command-line-args "--use-exwm") :if (seq-contains-p command-line-args "--with-exwm")
:defer t :defer t
:after exwm :after exwm
:straight (evil-exwm-state :build t :straight (evil-exwm-state :build t
@ -3664,7 +3643,7 @@ The complete configuration for the ~exwm~ package can be found below.
(require 'exwm-randr) (require 'exwm-randr)
(exwm/run-in-background "xwallpaper --zoom \"${cat $HOME/.cache/wallpaper}\"") (exwm/run-in-background "xwallpaper --zoom \"${cat $HOME/.cache/wallpaper}\"")
(start-process-shell-command (start-process-shell-command
"xrandr" nil "xrandr --output eDP1 --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI1 --primary --mode 2560x1080 --pos 1920x0 --rotate normal --output VIRTUAL1 --off --output DP-1-0 --off --output DP-1-1 --off") "xrandr" nil "xrandr --output eDP1 --mode 1920x1080 --pos 2560x0 --rotate normal --output HDMI1 --primary --mode 2560x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off --output DP-1-0 --off --output DP-1-1 --off")
(exwm-randr-enable) (exwm-randr-enable)
(setq exwm-randr-workspace-monitor-plist '(3 "eDP1")) (setq exwm-randr-workspace-monitor-plist '(3 "eDP1"))
#+end_src #+end_src