commit 64a2827a7f264069a2ccd9e4b7abfd112e29acd3 Author: pi-bot-01 Date: Thu Mar 26 01:01:07 2026 -0700 Initial commit diff --git a/exwm-init-el.el b/exwm-init-el.el new file mode 100644 index 0000000..3d4f5a7 --- /dev/null +++ b/exwm-init-el.el @@ -0,0 +1,106 @@ + +(require 'emms) +(emms-all) +(setq emms-player-list '(emms-player-mpv)) + +(require 'exwm) +(require 'exwm-config) +;; (exwm-config-default) + +;; (server-start) + +(setq exwm-workspace-number 5) + + +(add-hook 'exwm-update-class-hook + (lambda () + (unless (or (string-prefix-p "sun-awt-X11-" exwm-instance-name) + (string= "gimp" exwm-instance-name)) + (exwm-workspace-rename-buffer exwm-class-name)))) +(add-hook 'exwm-update-title-hook + (lambda () + (when (or (not exwm-instance-name) + (string-prefix-p "sun-awt-X11-" exwm-instance-name) + (string= "gimp" exwm-instance-name)) + (exwm-workspace-rename-buffer exwm-title)))) + ;; Global keybindings can be defined with `exwm-input-global-keys'. + ;; Here are a few examples: + +(setq exwm-input-global-keys + `( + ;; Bind "s-r" to exit char-mode and fullscreen mode. + ([?\s-r] . exwm-reset) + ;; Bind "s-w" to switch workspace interactively. + ([?\s-w] . exwm-workspace-switch) + ;; Bind "s-0" to "s-9" to switch to a workspace by its index. + ([?\s-W] . exwm-workspace-move-window) + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + (append (number-sequence 1 9) '(0))) + ;; Bind "s-&" to launch applications ('M-&' also works if the output + ;; buffer does not bother you). + ([?\s-&] . (lambda (command) + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command command nil command))) + ([?\s-p] . (lambda (command) + (interactive (list (read-shell-command "$ "))) + (let ((warning-minimum-level :emergency)) + (start-process-shell-command command nil command)))) + ;; ([?\s-P] . password-store-copy) + )) + +(defun vol-up () (interactive) (start-process-shell-command "sound" nil "sound up")) +(defun vol-down () (interactive) (start-process-shell-command "sound" nil "sound down")) +(defun vol-mute () (interactive) (start-process-shell-command "sound" nil "sound toggle")) +(exwm-input-set-key [?\s-f] 'exwm-layout-toggle-fullscreen) +(exwm-input-set-key (kbd "") + 'vol-up) +(exwm-input-set-key (kbd "") + 'vol-down) +(exwm-input-set-key (kbd "") + 'vol-mute) +(exwm-input-set-key (kbd "C-~") 'cb-stream-list) +(exwm-input-set-key (kbd "C-\`") 'transparency-toggle) +(exwm-input-set-key (kbd "") 'cb-kill) +(exwm-input-set-key (kbd "s-\`") 'cb-screenshot) +(exwm-input-set-key [?\s-s] 'multi-vterm) +(exwm-input-set-key [?\s-P] 'password-store-copy) + +;; (exwm-input-set-key [?\M-x] 'counsel-M-x) + +(defun xprop-set-alpha () + "set a windows opacity" + (interactive) + (shell-command "xprop -format _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0x7FFFFFFF" nil nil)) + +;; (setq exwm-input-simulation-keys +;; '( +;; ;; movement +;; ;; ([?\C-b] . [left]) +;; ;; ([?\M-b] . [C-left]) +;; ;; ([?\C-f] . [right]) +;; ;; ([?\M-f] . [C-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]) +;; ([?\C-m] . [enter]) + +;; ;; cut/paste. +;; ;; ([?\C-w] . [?\C-x]) +;; ;; ([?\M-w] . [?\C-c]) +;; ;; ([?\C-y] . [?\C-v]) + +;; ;; search +;; ([?\C-s] . [?\C-f]))) + +(exwm-enable) + +(provide 'exwm-init)