Minor edits.

This commit is contained in:
Derek Taylor
2020-12-12 09:09:31 -06:00
parent f5d841b2be
commit 07fcef736e
17 changed files with 543 additions and 365 deletions

View File

@@ -133,124 +133,6 @@
:desc "Search web for text between BEG/END"
"s w" #'eww-search-words)
(require 'exwm)
(require 'exwm-config)
(exwm-config-default)
(require 'exwm-systemtray)
(exwm-systemtray-enable)
(require 'exwm-randr)
(exwm-randr-enable)
(add-hook 'exwm-randr-screen-change-hook
(lambda ()
(start-process-shell-command
"xrandr" nil "xrandr --output DisplayPort-0 --mode 1920x1080 --pos 0x0 --rotate normal
--output DisplayPort-1 --primary --mode 1920x1080 --pos 1920x0 --rotate normal
--output HDMI-A-0 --mode 1920x1080 --pos 3840x0 --rotate normal")))
(setq exwm-workspace-number 10
exwm-randr-workspace-output-plist '(0 "DisplayPort-0"
1 "DisplayPort-1"
2 "HDMI-A-0"))
(setq exwm-input-prefix-keys '(?\M-x
?\M-:)
exwm-input-simulation-keys '(([?\s-F] . [?\C-f])
)
exwm-input-global-keys '(([?\M-\s-7] . (lambda (command)
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command command nil command)))
;; splits
([?\s-v] . evil-window-vsplit)
([?\s-z] . evil-window-split)
;; managing workspaces
([?\s-w] . exwm-workspace-switch)
([?\s-W] . exwm-workspace-swap)
([?\s-\C-w] . exwm-workspace-move)
;; essential programs
([?\s-d] . dired)
([?\s-e] . eshell)
([s-return] . dt/exwm-start-alacritty-with-fish)
([s-S-return] . dmenu)
;; killing buffers and windows
([?\s-b] . ibuffer)
([?\s-B] . kill-current-buffer)
([?\s-C] . +workspace/close-window-or-workspace)
;; change window focus with super+h,j,k,l
([?\s-h] . evil-window-left)
([?\s-j] . evil-window-next)
([?\s-k] . evil-window-prev)
([?\s-l] . evil-window-right)
;; move windows around using SUPER+SHIFT+h,j,k,l
([?\s-H] . +evil/window-move-left)
([?\s-J] . +evil/window-move-down)
([?\s-K] . +evil/window-move-up)
([?\s-L] . +evil/window-move-right)
;; move window to far left or far right with SUPER+CTRL+h,l
([?\s-\C-h] . side-left-window)
([?\s-\C-j] . side-bottom-window)
([?\s-\C-l] . side-right-window)
([?\s-\C-d] . side-window-delete-all)
([?\s-\C-r] . resize-window)
;; switch workspace with SUPER+{0-9}
([?\s-0] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
([?\s-1] . (lambda () (interactive) (exwm-workspace-switch-create 1)))
([?\s-2] . (lambda () (interactive) (exwm-workspace-switch-create 2)))
([?\s-3] . (lambda () (interactive) (exwm-workspace-switch-create 3)))
([?\s-4] . (lambda () (interactive) (exwm-workspace-switch-create 4)))
([?\s-5] . (lambda () (interactive) (exwm-workspace-switch-create 5)))
([?\s-6] . (lambda () (interactive) (exwm-workspace-switch-create 6)))
([?\s-7] . (lambda () (interactive) (exwm-workspace-switch-create 7)))
([?\s-8] . (lambda () (interactive) (exwm-workspace-switch-create 8)))
([?\s-9] . (lambda () (interactive) (exwm-workspace-switch-create 9)))
;; move window workspace with SUPER+SHIFT+{0-9}
([?\s-\)] . (lambda () (interactive) (exwm-workspace-move-window 0)))
([?\s-!] . (lambda () (interactive) (exwm-workspace-move-window 1)))
([?\s-@] . (lambda () (interactive) (exwm-workspace-move-window 2)))
([?\s-#] . (lambda () (interactive) (exwm-workspace-move-window 3)))
([?\s-$] . (lambda () (interactive) (exwm-workspace-move-window 4)))
([?\s-%] . (lambda () (interactive) (exwm-workspace-move-window 5)))
([?\s-^] . (lambda () (interactive) (exwm-workspace-move-window 6)))
([?\s-&] . (lambda () (interactive) (exwm-workspace-move-window 7)))
([?\s-*] . (lambda () (interactive) (exwm-workspace-move-window 8)))
([?\s-\(] . (lambda () (interactive) (exwm-workspace-move-window 9)))
;; SUPER+/ switches to char-mode (needed to pass commands in XWindows sometimes)
;; SUPER+? switches us back to line-mode
([?\s-/] . exwm-input-release-keyboard)
([?\s-?] . exwm-reset)
;; setting some toggle commands
([?\s-f] . exwm-floating-toggle-floating)
([?\s-m] . exwm-layout-toggle-mode-line)
([f11] . exwm-layout-toggle-fullscreen)))
(defun dt/exwm-start-alacritty-with-fish ()
(interactive)
(start-process-shell-command "alacritty" nil "alacritty -e fish"))
(defun dt/exwm-start-lxsession ()
(interactive)
(start-process-shell-command "lxsession" nil "lxsession"))
(defun dt/exwm-start-picom ()
(interactive)
(start-process-shell-command "picom" nil "picom"))
(defun dt/exwm-start-nm-applet ()
(interactive)
(start-process-shell-command "nm-applet" nil "nm-applet"))
(defun dt/exwm-start-volumeicon ()
(interactive)
(start-process-shell-command "volumeicon" nil "volumeicon"))
(after! exwm
(dt/exwm-start-lxsession)
(dt/exwm-start-picom)
(dt/exwm-start-nm-applet)
(dt/exwm-start-volumeicon)
(setq display-time-day-and-date t
display-time-format "%a %b %d, %Y (%H:%M)"
dmenu-prompt-string "RUN: ")
(display-time-mode 1))
(setq doom-font (font-spec :family "SauceCodePro Nerd Font Mono" :size 15)
doom-variable-pitch-font (font-spec :family "Ubuntu" :size 15)
doom-big-font (font-spec :family "SauceCodePro Nerd Font Mono" :size 24))

View File

@@ -13,11 +13,6 @@
- [[#emms][EMMS]]
- [[#evaluate-elisp-expressions][EVALUATE ELISP EXPRESSIONS]]
- [[#eww][EWW]]
- [[#exwm][EXWM]]
- [[#basic-requirements][BASIC REQUIREMENTS]]
- [[#keybindings][KEYBINDINGS]]
- [[#defining-functions][DEFINING FUNCTIONS]]
- [[#autostart-programs][AUTOSTART PROGRAMS]]
- [[#fonts][FONTS]]
- [[#ivy][IVY]]
- [[#ivy-posframe][IVY-POSFRAME]]
@@ -250,170 +245,6 @@ EWW is the Emacs Web Wowser, the builtin browser in Emacs. Below I set urls to
"s w" #'eww-search-words)
#+END_SRC
* EXWM
Emacs can be your window manager. You need to install the exwm package (make sure to put 'exwm' in your packages.el in Doom Emacs), and create an exwm.desktop file in /usr/share/xsessions that has 'exec=' set to 'emacs'. Emacs (and exwm) is single threaded so it sometimes does hang. This means that exwm may not be the best window manager if your tasks are resource intensive.
** BASIC REQUIREMENTS
#+begin_src emacs-lisp
(require 'exwm)
(require 'exwm-config)
(exwm-config-default)
(require 'exwm-systemtray)
(exwm-systemtray-enable)
(require 'exwm-randr)
(exwm-randr-enable)
(add-hook 'exwm-randr-screen-change-hook
(lambda ()
(start-process-shell-command
"xrandr" nil "xrandr --output DisplayPort-0 --mode 1920x1080 --pos 0x0 --rotate normal
--output DisplayPort-1 --primary --mode 1920x1080 --pos 1920x0 --rotate normal
--output HDMI-A-0 --mode 1920x1080 --pos 3840x0 --rotate normal")))
(setq exwm-workspace-number 10
exwm-randr-workspace-output-plist '(0 "DisplayPort-0"
1 "DisplayPort-1"
2 "HDMI-A-0"))
#+end_src
** KEYBINDINGS
I try to use standard vim-motion keybindings that most tiling window managers use. This should make switching between EXWM and other window managers a bit easier.
| COMMAND | DESCRIPTION | KEYBINDING |
|------------------------------+----------------------------------+-------------------|
| run-shell-command | the default run prompt | SUPER-& |
| evil-window-vsplit | vertical split | SUPER-v |
| evil-window-split | horizontal split | SUPER-z |
| exwm-workspace-switch | switch workspace | SUPER-w |
| exwm-workspace-swap | swap workspace | SUPER-W |
| exwm-workspace-move | move workspace | SUPER-CTRL-w |
| dired | dired file manager | SUPER-d |
| eshell | the eshell | SUPER-RET |
| dmenu | a better run prompt than SUPER-& | SUPER-SHIFT-RET |
| ibuffer | ibuffer lets you manage buffers | SUPER-b |
| kill-current-buffer | kill current buffer | SUPER-B |
| close-window-or-workspace | close window or workspace | SUPER-C |
| evil-window-left | change focus to window left | SUPER-h |
| evil-window-down | change focus to window down | SUPER-j |
| evil-window-up | change focus to window up | SUPER-k |
| evil-window-right | change focus to window right | SUPER-l |
| window-move-left | move window left | SUPER-H |
| window-move-down | move window down | SUPER-J |
| window-move-up | move window to up | SUPER-K |
| window-move-right | move window right | SUPER-L |
| exwm-workspace-switch-create | switch to workspace 0-9 | SUPER-(0-9) |
| exwm-workspace-move-window | move window to workspace 0-9 | SUPER-SHIFT-(0-9) |
#+begin_src emacs-lisp
(setq exwm-input-prefix-keys '(?\M-x
?\M-:)
exwm-input-simulation-keys '(([?\s-F] . [?\C-f])
)
exwm-input-global-keys '(([?\M-\s-7] . (lambda (command)
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command command nil command)))
;; splits
([?\s-v] . evil-window-vsplit)
([?\s-z] . evil-window-split)
;; managing workspaces
([?\s-w] . exwm-workspace-switch)
([?\s-W] . exwm-workspace-swap)
([?\s-\C-w] . exwm-workspace-move)
;; essential programs
([?\s-d] . dired)
([?\s-e] . eshell)
([s-return] . dt/exwm-start-alacritty-with-fish)
([s-S-return] . dmenu)
;; killing buffers and windows
([?\s-b] . ibuffer)
([?\s-B] . kill-current-buffer)
([?\s-C] . +workspace/close-window-or-workspace)
;; change window focus with super+h,j,k,l
([?\s-h] . evil-window-left)
([?\s-j] . evil-window-next)
([?\s-k] . evil-window-prev)
([?\s-l] . evil-window-right)
;; move windows around using SUPER+SHIFT+h,j,k,l
([?\s-H] . +evil/window-move-left)
([?\s-J] . +evil/window-move-down)
([?\s-K] . +evil/window-move-up)
([?\s-L] . +evil/window-move-right)
;; move window to far left or far right with SUPER+CTRL+h,l
([?\s-\C-h] . side-left-window)
([?\s-\C-j] . side-bottom-window)
([?\s-\C-l] . side-right-window)
([?\s-\C-d] . side-window-delete-all)
([?\s-\C-r] . resize-window)
;; switch workspace with SUPER+{0-9}
([?\s-0] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
([?\s-1] . (lambda () (interactive) (exwm-workspace-switch-create 1)))
([?\s-2] . (lambda () (interactive) (exwm-workspace-switch-create 2)))
([?\s-3] . (lambda () (interactive) (exwm-workspace-switch-create 3)))
([?\s-4] . (lambda () (interactive) (exwm-workspace-switch-create 4)))
([?\s-5] . (lambda () (interactive) (exwm-workspace-switch-create 5)))
([?\s-6] . (lambda () (interactive) (exwm-workspace-switch-create 6)))
([?\s-7] . (lambda () (interactive) (exwm-workspace-switch-create 7)))
([?\s-8] . (lambda () (interactive) (exwm-workspace-switch-create 8)))
([?\s-9] . (lambda () (interactive) (exwm-workspace-switch-create 9)))
;; move window workspace with SUPER+SHIFT+{0-9}
([?\s-\)] . (lambda () (interactive) (exwm-workspace-move-window 0)))
([?\s-!] . (lambda () (interactive) (exwm-workspace-move-window 1)))
([?\s-@] . (lambda () (interactive) (exwm-workspace-move-window 2)))
([?\s-#] . (lambda () (interactive) (exwm-workspace-move-window 3)))
([?\s-$] . (lambda () (interactive) (exwm-workspace-move-window 4)))
([?\s-%] . (lambda () (interactive) (exwm-workspace-move-window 5)))
([?\s-^] . (lambda () (interactive) (exwm-workspace-move-window 6)))
([?\s-&] . (lambda () (interactive) (exwm-workspace-move-window 7)))
([?\s-*] . (lambda () (interactive) (exwm-workspace-move-window 8)))
([?\s-\(] . (lambda () (interactive) (exwm-workspace-move-window 9)))
;; SUPER+/ switches to char-mode (needed to pass commands in XWindows sometimes)
;; SUPER+? switches us back to line-mode
([?\s-/] . exwm-input-release-keyboard)
([?\s-?] . exwm-reset)
;; setting some toggle commands
([?\s-f] . exwm-floating-toggle-floating)
([?\s-m] . exwm-layout-toggle-mode-line)
([f11] . exwm-layout-toggle-fullscreen)))
#+end_src
** DEFINING FUNCTIONS
Below, I define a few functions that are really just some programs that I want to be able to launch with M-x or have them autostart when logging in to EXWM.
#+begin_src emacs-lisp
(defun dt/exwm-start-alacritty-with-fish ()
(interactive)
(start-process-shell-command "alacritty" nil "alacritty -e fish"))
(defun dt/exwm-start-lxsession ()
(interactive)
(start-process-shell-command "lxsession" nil "lxsession"))
(defun dt/exwm-start-picom ()
(interactive)
(start-process-shell-command "picom" nil "picom"))
(defun dt/exwm-start-nm-applet ()
(interactive)
(start-process-shell-command "nm-applet" nil "nm-applet"))
(defun dt/exwm-start-volumeicon ()
(interactive)
(start-process-shell-command "volumeicon" nil "volumeicon"))
#+end_src
** AUTOSTART PROGRAMS
The programs I want to autostart when using EXWM. Note that I don't execute these until after EXWM has started. I also include 'display-time-mode' here because I only want it to load 'after exwm', becasue I don't want to use this unless I am in EXWM.
#+begin_src emacs-lisp
(after! exwm
(dt/exwm-start-lxsession)
(dt/exwm-start-picom)
(dt/exwm-start-nm-applet)
(dt/exwm-start-volumeicon)
(setq display-time-day-and-date t
display-time-format "%a %b %d, %Y (%H:%M)"
dmenu-prompt-string "RUN: ")
(display-time-mode 1))
#+end_src
* FONTS
Settings related to fonts within Doom Emacs:
+ 'doom-font' -- standard monospace font that is used for most things in Emacs.

View File

@@ -55,7 +55,6 @@
(package! elfeed)
(package! emms)
(package! emojify)
(package! exwm)
(package! evil-tutor)
(package! ivy-posframe)
(package! mastodon)