summaryrefslogtreecommitdiff
path: root/.config/emacs/bd-wm.el
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/bd-wm.el')
-rw-r--r--.config/emacs/bd-wm.el54
1 files changed, 45 insertions, 9 deletions
diff --git a/.config/emacs/bd-wm.el b/.config/emacs/bd-wm.el
index 515f9c8..328faac 100644
--- a/.config/emacs/bd-wm.el
+++ b/.config/emacs/bd-wm.el
@@ -1,14 +1,30 @@
;; -*- lexical-binding: t; -*-
+(winner-mode 1)
+
(defun bd/exwm-update-class ()
"Changes the buffer name to reflect the class name for
that buffer."
(exwm-workspace-rename-buffer exwm-class-name))
-(winner-mode 1)
+(defun bd/exwm-init-hook ()
+ "Make workspace 1 the default startup workspace."
+ (exwm-workspace-switch-create 1))
+
+(defun toggle-current-window-dedication ()
+ "Adds or revokes dedicated window status from a buffer. A
+dedicated buffer will never be automatically orphaned."
+ (interactive)
+ (let* ((window (selected-window))
+ (dedicated (window-dedicated-p window)))
+ (set-window-dedicated-p window (not dedicated))
+ (message "Window %sdedicated to %s"
+ (if dedicated "no longer " "")
+ (buffer-name))))
(use-package exwm
:config
+ (add-hook 'exwm-init-hook #'bd/exwm-init-hook)
(add-hook 'exwm-update-class-hook #'bd/exwm-update-class)
;; order is important
(require 'exwm-randr)
@@ -42,7 +58,7 @@ that buffer."
(exwm-enable)
(server-start)
:custom
- (exwm-workspace-number 10)
+ (exwm-workspace-number 10) ; puts scratch buffer everywhere
(exwm-input-prefix-keys
'(?\C-x
?\C-u
@@ -56,20 +72,40 @@ that buffer."
(exwm-input-global-keys
`(([?\s-n] . other-window)
([?\s-p] . (lambda ()
- (interactive)
- (other-window -1)))
+ (interactive)
+ (other-window -1)))
([?\s-r] . exwm-reset)
+ ([?\s-d] . toggle-current-window-dedication)
([?\s-q] . kill-current-buffer)
;; ([?\s-<f10>] . emms-pause) ; see rest of mpc commands above--mpc pause performed poorly
([?\s-x] . (lambda (command)
(interactive (list (read-shell-command "s-x ")))
(start-process-shell-command command nil command)))
-
,@(mapcar (lambda (i)
- `(,(kbd (format "s-%s" (car i))) .
+ `(,(kbd (format "s-%d" i)) .
(lambda ()
- (interactive
- (exwm-workspace-switch-create ,(car (cdr i)))))))
- '((! 0) (@ 1) (\# 2) ($ 3) (% 4) (^ 5) (& 6) (* 7) (\( 8) (\) 9)))))
+ (interactive)
+ (exwm-workspace-switch-create ,i))))
+ (number-sequence 0 9))))
+ (exwm-input-simulation-keys
+ '(([?\C-b] . [left])
+ ([?\C-f] . [right])
+ ([?\C-p] . [up])
+ ([?\C-n] . [down])
+ ([?\C-a] . [home])
+ ([?\C-e] . [end])
+ ([?\M-v] . [prior])
+ ([?\C-v] . [next])
+ ([?\C-d] . [delete])
+ ([?\C-k] . [S-end delete])))
+
+ ;; ,@(mapcar (lambda (i)
+ ;; `(,(kbd (format "s-%s" (car i))) .
+ ;; (lambda ()
+ ;; (interactive
+ ;; (exwm-workspace-switch-create ,(car (cdr i)))))))
+ ;; '((! 0) (@ 1) (\# 2) ($ 3) (% 4) (^ 5) (& 6) (* 7) (\( 8) (\) 9)))))
+ (exwm-workspace-show-all-buffers t)
+ (exwm-layout-show-all-buffers t)
(exwm-randr-workspace-monitor-plist '(0 "DVI-D-1" 2 "DVI-D-1" 4 "DVI-D-1" 6 "DVI-D-1" 8 "DVI-D-1")))