about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--emacs9
-rw-r--r--emacs.d/early-init.el2
-rw-r--r--exwm43
3 files changed, 32 insertions, 22 deletions
diff --git a/emacs b/emacs index 5066268..26e5bbb 100644 --- a/emacs +++ b/emacs
@@ -19,7 +19,7 @@
19 (set-file-modes user-private-file #o600)) 19 (set-file-modes user-private-file #o600))
20(load user-private-file :no-error) 20(load user-private-file :no-error)
21 21
22(load-theme 'brianna :no-confirm) ; see ~/.emacs.d/brianna-theme.el 22(load-theme 'bob :no-confirm) ; see ~/.emacs.d/bob-theme.el
23(add-hook 'after-init-hook #'setup-faces) 23(add-hook 'after-init-hook #'setup-faces)
24 24
25(define-advice startup-echo-area-message (:override ()) 25(define-advice startup-echo-area-message (:override ())
@@ -495,8 +495,8 @@
495 (locate-user-emacs-file "early-init.el")) 495 (locate-user-emacs-file "early-init.el"))
496 "c" (find-user-file custom custom-file) 496 "c" (find-user-file custom custom-file)
497 "p" (find-user-file private) 497 "p" (find-user-file private)
498 "t" (find-user-file brianna 498 "t" (find-user-file bob
499 (locate-user-emacs-file "brianna-theme.el")) 499 (locate-user-emacs-file "bob-theme.el"))
500 "x" (find-user-file exwm 500 "x" (find-user-file exwm
501 (expand-file-name "~/.exwm")) 501 (expand-file-name "~/.exwm"))
502 "s" #'scratch-buffer)) 502 "s" #'scratch-buffer))
@@ -641,7 +641,7 @@
641 (^turn-off 'display-fill-column-indicator-mode)) 641 (^turn-off 'display-fill-column-indicator-mode))
642(add-hook 'prog-mode-hook #'auto-fill-mode) 642(add-hook 'prog-mode-hook #'auto-fill-mode)
643(add-hook 'prog-mode-hook #'electric-pair-local-mode) 643(add-hook 'prog-mode-hook #'electric-pair-local-mode)
644(add-to-list 'warning-suppress-types 'comp) 644(setopt warning-suppress-types '(comp))
645(context-menu-mode) 645(context-menu-mode)
646(delete-selection-mode) 646(delete-selection-mode)
647(global-goto-address-mode) 647(global-goto-address-mode)
@@ -767,6 +767,7 @@
767(setopt eshell-history-size nil) 767(setopt eshell-history-size nil)
768 768
769(keymap-global-set "C-z" #'popup-eshell) 769(keymap-global-set "C-z" #'popup-eshell)
770(keymap-global-set "C-c C-z" #'popup-eshell)
770(add-hook 'eshell-first-time-mode-hook 771(add-hook 'eshell-first-time-mode-hook
771 (defun @eshell-once () 772 (defun @eshell-once ()
772 (keymap-set eshell-mode-map "C-z" #'quit-window))) 773 (keymap-set eshell-mode-map "C-z" #'quit-window)))
diff --git a/emacs.d/early-init.el b/emacs.d/early-init.el index b2de2f2..bbf9464 100644 --- a/emacs.d/early-init.el +++ b/emacs.d/early-init.el
@@ -7,7 +7,7 @@
7(setopt default-frame-alist 7(setopt default-frame-alist
8 '((menu-bar-lines . 0) 8 '((menu-bar-lines . 0)
9 (tool-bar-lines . 0) 9 (tool-bar-lines . 0)
10 (vertical-scroll-bars) 10 ;;(vertical-scroll-bars)
11 (horizontal-scroll-bars))) 11 (horizontal-scroll-bars)))
12 12
13(when (getenv "IN_EXWM") 13(when (getenv "IN_EXWM")
diff --git a/exwm b/exwm index 0b52846..08d410f 100644 --- a/exwm +++ b/exwm
@@ -15,6 +15,17 @@
15 (start-process-shell-command 15 (start-process-shell-command
16 (format "<autostart> %s" command) " *autostart*" command)) 16 (format "<autostart> %s" command) " *autostart*" command))
17 17
18(defun run-or-raise (command &optional buffer-name)
19 "Raise BUFFER-NAME if it exists, else run COMMAND.
20BUFFER-NAME defaults to the first word of COMMAND."
21 (let ((buffer-name (or buffer-name (car (string-split command)))))
22 (if (buffer-live-p (get-buffer buffer-name))
23 (switch-to-buffer buffer-name)
24 (exwm-spawn command))))
25
26(defun ^run-or-raise (command)
27 (lambda () (interactive) (run-or-raise command)))
28
18;; Wifi info 29;; Wifi info
19(defun dBm->perc (dBm) 30(defun dBm->perc (dBm)
20 (truncate (+ (- (/ (* dBm dBm) 105.0)) 31 (truncate (+ (- (/ (* dBm dBm) 105.0))
@@ -84,6 +95,11 @@
84(setopt display-time-format "%e %a %R") 95(setopt display-time-format "%e %a %R")
85(setopt battery-mode-line-format "[🔋%b%p%]") 96(setopt battery-mode-line-format "[🔋%b%p%]")
86 97
98(display-wifi-info-mode)
99(display-battery-mode)
100(display-time-mode)
101
102;; Must come after the above
87(setopt global-mode-string 103(setopt global-mode-string
88 '("" jabber-activity-mode-string 104 '("" jabber-activity-mode-string
89 display-wifi-info-string 105 display-wifi-info-string
@@ -91,10 +107,6 @@
91 " " (:propertize ("" display-time-string) 107 " " (:propertize ("" display-time-string)
92 face tab-bar-tab))) 108 face tab-bar-tab)))
93 109
94(display-wifi-info-mode)
95(display-battery-mode)
96(display-time-mode)
97
98;;; Window management 110;;; Window management
99 111
100(after exwm-update-class-hook 112(after exwm-update-class-hook
@@ -104,21 +116,15 @@
104 116
105(setopt exwm-input-global-keys 117(setopt exwm-input-global-keys
106 `(;; Command shortcuts 118 `(;; Command shortcuts
107 ([?\s-p] . ,(^exwm-spawn "keepassxc")) 119 ([?\s-p] . ,(^run-or-raise "keepassxc"))
108 ([?\s-b] . ,(^exwm-spawn "firefox --new-tab")) 120 ([?\s-b] . ,(^run-or-raise "firefox"))
109 ;; 's-r': Reset (to line-mode). 121 ;; 's-r': Reset (to line-mode).
110 ([?\s-r] . exwm-reset) 122 ([?\s-r] . exwm-reset)
111 ;; 's-w': Switch workspace. 123 ;; 's-w': Bury buffer (I honestly don't really use workspaces)
112 ([?\s-w] . exwm-workspace-switch) 124 ([?\s-w] . bury-buffer)
125 ([?\s-o] . other-window-dwim)
113 ;; 's-&': Launch application. 126 ;; 's-&': Launch application.
114 ([?\s-&] . exwm-spawn) 127 ([?\s-&] . exwm-spawn)))
115 ;; 's-N': Switch to certain workspace.
116 ,@(mapcar (lambda (i)
117 `(,(kbd (format "s-%d" i)) .
118 (lambda ()
119 (interactive)
120 (exwm-workspace-switch-create ,i))))
121 (number-sequence 1 9))))
122 128
123(setopt exwm-input-simulation-keys 129(setopt exwm-input-simulation-keys
124 '(([?\C-b] . [left]) 130 '(([?\C-b] . [left])
@@ -130,7 +136,10 @@
130 ([?\M-v] . [prior]) 136 ([?\M-v] . [prior])
131 ([?\C-v] . [next]) 137 ([?\C-v] . [next])
132 ([?\C-d] . [delete]) 138 ([?\C-d] . [delete])
133 ([?\C-k] . [S-end delete]))) 139 ([?\C-k] . [S-end delete])
140 ([?\M-w] . [?\C-c])
141 ([?\C-w] . [?\C-x])
142 ([?\C-y] . [?\C-v])))
134 143
135;;; Startup 144;;; Startup
136 145