Minor edits.

This commit is contained in:
Derek Taylor
2020-11-19 21:01:05 -06:00
parent d72c0e0842
commit 46225d0e12
5 changed files with 199 additions and 17 deletions

View File

@@ -133,6 +133,87 @@
:desc "Search web for text between BEG/END"
"s w" #'eww-search-words)
(require 'exwm)
(require 'exwm-config)
(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")
exwm-input-prefix-keys '(?\M-x
?\M-:)
exwm-input-simulation-keys '(([?\s-F] . [?\C-f])
)
exwm-input-global-keys '(([?\s-&] . (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-return] . eshell)
([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)))
;; setting some toggle commands
([?\s-f] . exwm-floating-toggle-floating)
([?\s-m] . exwm-layout-toggle-mode-line)
([f11] . exwm-layout-toggle-fullscreen)))
(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,6 +13,7 @@
- [[#emms][EMMS]]
- [[#evaluate-elisp-expressions][EVALUATE ELISP EXPRESSIONS]]
- [[#eww][EWW]]
- [[#exwm][EXWM]]
- [[#fonts][FONTS]]
- [[#ivy][IVY]]
- [[#ivy-posframe][IVY-POSFRAME]]
@@ -245,6 +246,117 @@ 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.
| 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
(require 'exwm)
(require 'exwm-config)
(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")
exwm-input-prefix-keys '(?\M-x
?\M-:)
exwm-input-simulation-keys '(([?\s-F] . [?\C-f])
)
exwm-input-global-keys '(([?\s-&] . (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-return] . eshell)
([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)))
;; setting some toggle commands
([?\s-f] . exwm-floating-toggle-floating)
([?\s-m] . exwm-layout-toggle-mode-line)
([f11] . exwm-layout-toggle-fullscreen)))
#+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

@@ -54,6 +54,7 @@
(package! elfeed)
(package! emms)
(package! emojify)
(package! exwm)
(package! evil-tutor)
(package! ivy-posframe)
(package! mastodon)
@@ -61,6 +62,7 @@
(package! org-bullets)
(package! peep-dired)
(package! rainbow-mode)
(package! resize-window)
(package! sublimity)
(package! tldr)
(package! virtualenvwrapper)

View File

@@ -416,13 +416,7 @@ treeselectAction a = TS.treeselectAction a
]
, Node (TS.TSNode "+ xmonad configs" "My xmonad config files" (return ()))
[ Node (TS.TSNode "xmonad.hs" "My XMonad Main" (spawn (myEditor ++ "/home/dt/.xmonad/xmonad.hs"))) []
, Node (TS.TSNode "MyGridMenu.hs" "My XMonad GridSelect menu" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyGridMenu.hs"))) []
, Node (TS.TSNode "MyKeys.hs" "My XMonad keybindings" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyKeys.hs"))) []
, Node (TS.TSNode "MyLayouts.hs" "My XMonad layouts" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyLayouts.hs"))) []
, Node (TS.TSNode "MyPrompts.hs" "My XMonad prompts" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyPrompts.hs"))) []
, Node (TS.TSNode "MyScratchpads.hs" "My XMonad named scratchpads" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyScratchpads.hs"))) []
, Node (TS.TSNode "MyTreeMenu.hs" "My XMonad TreeSelect menu" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyTreeMenu.hs"))) []
, Node (TS.TSNode "MyVariables.hs" "My XMonad variables" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyVariables.hs"))) []
, Node (TS.TSNode "xmonadctl.hs" "The xmonadctl script" (spawn (myEditor ++ "/home/dt/.xmonad/xmonadctl.hs"))) []
]
, Node (TS.TSNode "alacritty" "alacritty terminal emulator" (spawn (myEditor ++ "/home/dt/.config/alacritty/alacritty.yml"))) []
, Node (TS.TSNode "awesome" "awesome window manager" (spawn (myEditor ++ "/home/dt/.config/awesome/rc.lua"))) []
@@ -591,9 +585,6 @@ promptList' = [ ("c", calcPrompt, "qalc") -- requires qalculate-gtk
]
#+END_SRC
#+RESULTS:
: <interactive>:48:15: error: parse error on input ]
** Custom Prompts
calcPrompt requires a cli calculator called qalcualte-gtk. You could use this as a template for other custom prompts that use command line programs that return a single line of output.
@@ -1059,6 +1050,7 @@ main = do
-- shrink, expand, next-layout, default-layout, restart-wm, xterm, kill, refresh, run,
-- focus-up, focus-down, swap-up, swap-down, swap-master, sink, quit-wm. You can run
-- "xmonadctl 0" to generate full list of commands written to ~/.xsession-errors.
-- To compile xmonadctl: ghc -dynamic xmonadctl.hs
, handleEventHook = serverModeEventHookCmd
<+> serverModeEventHook
<+> serverModeEventHookF "XMONAD_PRINT" (io . putStrLn)

View File

@@ -349,13 +349,7 @@ treeselectAction a = TS.treeselectAction a
]
, Node (TS.TSNode "+ xmonad configs" "My xmonad config files" (return ()))
[ Node (TS.TSNode "xmonad.hs" "My XMonad Main" (spawn (myEditor ++ "/home/dt/.xmonad/xmonad.hs"))) []
, Node (TS.TSNode "MyGridMenu.hs" "My XMonad GridSelect menu" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyGridMenu.hs"))) []
, Node (TS.TSNode "MyKeys.hs" "My XMonad keybindings" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyKeys.hs"))) []
, Node (TS.TSNode "MyLayouts.hs" "My XMonad layouts" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyLayouts.hs"))) []
, Node (TS.TSNode "MyPrompts.hs" "My XMonad prompts" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyPrompts.hs"))) []
, Node (TS.TSNode "MyScratchpads.hs" "My XMonad named scratchpads" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyScratchpads.hs"))) []
, Node (TS.TSNode "MyTreeMenu.hs" "My XMonad TreeSelect menu" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyTreeMenu.hs"))) []
, Node (TS.TSNode "MyVariables.hs" "My XMonad variables" (spawn (myEditor ++ "/home/dt/.xmonad/lib/Custom/MyVariables.hs"))) []
, Node (TS.TSNode "xmonadctl.hs" "The xmonadctl script" (spawn (myEditor ++ "/home/dt/.xmonad/xmonadctl.hs"))) []
]
, Node (TS.TSNode "alacritty" "alacritty terminal emulator" (spawn (myEditor ++ "/home/dt/.config/alacritty/alacritty.yml"))) []
, Node (TS.TSNode "awesome" "awesome window manager" (spawn (myEditor ++ "/home/dt/.config/awesome/rc.lua"))) []
@@ -899,6 +893,7 @@ main = do
-- shrink, expand, next-layout, default-layout, restart-wm, xterm, kill, refresh, run,
-- focus-up, focus-down, swap-up, swap-down, swap-master, sink, quit-wm. You can run
-- "xmonadctl 0" to generate full list of commands written to ~/.xsession-errors.
-- To compile xmonadctl: ghc -dynamic xmonadctl.hs
, handleEventHook = serverModeEventHookCmd
<+> serverModeEventHook
<+> serverModeEventHookF "XMONAD_PRINT" (io . putStrLn)