;;; -*- lexical-binding: t; -*- ;;; Commentary: ;;; Code: ;;;; utilities ;; desktop (use-package desktop-environment :custom (desktop-environment-screenshot-directory (xdg-user-dir "PICTURES")) (desktop-environment-screenshot-command "flameshot full") (desktop-environment-screenshot-partial-command "flameshot launcher") (desktop-environment-volume-toggle-command "pactl set-sink-mute @DEFAULT_SINK@ toggle") (desktop-environment-volume-set-command "pactl set-sink-volume @DEFAULT_SINK@ %s") (desktop-environment-volume-get-command "pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'") (desktop-environment-volume-normal-decrement "-4%") (desktop-environment-volume-normal-increment "+4%") (desktop-environment-volume-decrement-slowly "-2%") (desktop-environment-volume-increment-slowly "+2%") (desktop-environment-volume-toggle-regexp nil)) (use-package exwm :config (defun bd/exwm-update-title () "Changes the buffer name to reflect the class name for that buffer." (exwm-workspace-rename-buffer exwm-title)) (add-hook 'exwm-update-title-hook #'bd/exwm-update-title) (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) (exwm-enable) (server-start) :custom (exwm-input-prefix-keys `(?\C-x ?\C-u ?\C-g ?\C-h ?\C-z ?\C-` ?\M-x ?\M-` ?\M-& ?\M-: ,@(mapcar (lambda (i) (kbd (concat "s-" (number-to-string i)))) (number-sequence 0 9)))) (exwm-input-global-keys '(([?\s-n] . other-window) ([?\s-p] . (lambda () (interactive) (other-window -1))) ([?\s-L] . desktop-environment-lock-screen) ([f2] . desktop-environment-brightness-decrement) ([f3] . desktop-environment-toggle-mute) ([f5] . desktop-environment-volume-decrement) ([f6] . desktop-environment-volume-increment) ([f8] . desktop-environment-brightness-decrement) ([f9] . desktop-environment-brightness-increment) ([f9] . emms-previous) ([f10] . emms-next) ([print] . desktop-environment-screenshot-part) ([S-print] . desktop-environment-screenshot) ([?\s-O] . bd/visit-bookmark) ([?\s-P] . bd/password) ([?\s-r] . exwm-reset) ([?\s-d] . toggle-current-window-dedication) ([?\s-q] . kill-current-buffer) ([?\s-x] . (lambda (command) (interactive (list (read-shell-command "s-x "))) (start-process-shell-command command nil command))))) (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]) ([?\M-w] . [C-c]) ([?\C-y] . [C-v]) ([?\M-d] . [C-delete]) ([?\M-b] . [C-left]) ([?\M-f] . [C-right]) ([?\H-b] . [M-left]) ([?\H-f] . [M-right])))) (setopt tab-bar-select-tab-modifiers '(super)) (defvar new-mode-line nil) (defun set-new-mode-line () "Return the current value of my-custom-variable for the mode line." (setq new-mode-line (replace-regexp-in-string "%" "%%" (format " %s %s %s" (shell-command-to-string "/home/bdunahu/.local/bin/mail-string 2>/dev/null") (shell-command-to-string "/home/bdunahu/.local/bin/power-string 2>/dev/null") (shell-command-to-string "/home/bdunahu/.local/bin/t1-string 2>/dev/null"))))) (defvar-local bd/external-mode-line '(:eval (when new-mode-line new-mode-line))) (run-with-timer t 30 #'set-new-mode-line) (add-to-list 'global-mode-string bd/external-mode-line) (provide 'bd--exwm-windowing) ;;; bd-exwm ends here