diff options
Diffstat (limited to '.config/emacs/bd-wm.el')
-rw-r--r-- | .config/emacs/bd-wm.el | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/.config/emacs/bd-wm.el b/.config/emacs/bd-wm.el new file mode 100644 index 0000000..515f9c8 --- /dev/null +++ b/.config/emacs/bd-wm.el @@ -0,0 +1,75 @@ +;; -*- lexical-binding: t; -*- + +(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) + +(use-package exwm + :config + (add-hook 'exwm-update-class-hook #'bd/exwm-update-class) + ;; order is important + (require 'exwm-randr) + (exwm-randr-enable) + ;; (start-process-shell-command "xrandr" nil "/home/bdunahu/.config/emacs/exwm_xrandr.sh") + (start-process-shell-command "picom" nil "picom") + (start-process-shell-command "bg" nil "set-bg") + (start-process-shell-command "xmodmap" nil "xmodmap ~/.config/xmodmap.config") + (start-process-shell-command "xrate" nil "xset r rate 250 70") + + (dolist (k '(("s-L" "slock") + ("s-B" "icecat") + ("s-<return>" "st") + ("s-O" "xdotool type $(grep -v '^#' /home/bdunahu/Personal/scripts/bookmarks.txt | dmenu -i -l 12 | awk '{print $NF}')") + ("s-P" "passmenu --type") + ("s-<f2>" "brightnessctl set 1%-") + ("s-<f3>" "brightnessctl set 1%+") + ("s-<f6>" "pactl set-sink-mute @DEFAULT_SINK@ toggle") + ("s-<f7>" "pactl set-sink-volume @DEFAULT_SINK@ -10%") + ("s-<f8>" "pactl set-sink-volume @DEFAULT_SINK@ +5%") + ("s-<f9>" "mpc prev") + ("s-<f11>" "mpc next") + ("<print>" "flameshot launcher"))) + (let ((f (lambda () (interactive) + (save-window-excursion + (start-process-shell-command (cadr k) nil (cadr k)))))) + (exwm-input-set-key (kbd (car k)) f) + (define-key exwm-mode-map (kbd (car k)) f))) + + (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) + (exwm-enable) + (server-start) + :custom + (exwm-workspace-number 10) + (exwm-input-prefix-keys + '(?\C-x + ?\C-u + ?\C-g + ?\C-h + ?\C-z + ?\M-x + ?\M-` + ?\M-& + ?\M-: )) + (exwm-input-global-keys + `(([?\s-n] . other-window) + ([?\s-p] . (lambda () + (interactive) + (other-window -1))) + ([?\s-r] . exwm-reset) + ([?\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))) . + (lambda () + (interactive + (exwm-workspace-switch-create ,(car (cdr i))))))) + '((! 0) (@ 1) (\# 2) ($ 3) (% 4) (^ 5) (& 6) (* 7) (\( 8) (\) 9))))) + + (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"))) |