5 ;; make class name the buffer name, truncating beyond 60 characters
6 (defun b/exwm-rename-buffer
()
8 (exwm-workspace-rename-buffer
9 (concat exwm-class-name
":"
10 (if (<= (length exwm-title
) 60) exwm-title
11 (concat (substring exwm-title
0 59) "...")))))
14 :hook
((exwm-update-class . b
/exwm-rename-buffer
)
15 (exwm-update-title . b
/exwm-rename-buffer
)))
17 (use-package exwm-config
20 :hook
(exwm-init . exwm-config--fix
/ido-buffer-window-other-frame
))
22 (use-package exwm-input
26 (defun b/exwm-ws-prev-index
()
27 "Return the index for the previous EXWM workspace, wrapping
29 (if (= exwm-workspace-current-index
0)
30 (1- exwm-workspace-number
)
31 (1- exwm-workspace-current-index
)))
33 (defun b/exwm-ws-next-index
()
34 "Return the index for the next EXWM workspace, wrapping
36 (if (= exwm-workspace-current-index
37 (1- exwm-workspace-number
))
39 (1+ exwm-workspace-current-index
)))
41 ;; shorten 'C-c C-q' to 'C-q'
42 (define-key exwm-mode-map
[?\C-q
] #'exwm-input-send-next-key
)
44 (setq exwm-workspace-number
4
45 exwm-input-global-keys
46 `(([?\s-R
] . exwm-reset
)
47 ([?\s-
\\] . exwm-workspace-switch
)
49 ([?\S-\s-\s
] .
(lambda (command)
51 (list (read-shell-command "➜ ")))
52 (start-process-shell-command
53 command nil command
)))
54 ([s-return
] .
(lambda ()
56 (start-process "" nil
"urxvt")))
57 ([?\C-\s-\s
] . counsel-linux-app
)
58 ([?\M-\s-\s
] .
(lambda ()
60 (start-process-shell-command
61 "rofi-pass" nil
"rofi-pass")))
62 ([?\s-h
] . windmove-left
)
63 ([?\s-j
] . windmove-down
)
64 ([?\s-k
] . windmove-up
)
65 ([?\s-l
] . windmove-right
)
66 ([?\s-H
] . windmove-swap-states-left
)
67 ([?\s-J
] . windmove-swap-states-down
)
68 ([?\s-K
] . windmove-swap-states-up
)
69 ([?\s-L
] . windmove-swap-states-right
)
70 ([?\M-\s-h
] . shrink-window-horizontally
)
71 ([?\M-\s-l
] . enlarge-window-horizontally
)
72 ([?\M-\s-k
] . shrink-window
)
73 ([?\M-\s-j
] . enlarge-window
)
74 ([?\s-\
[] .
(lambda ()
76 (exwm-workspace-switch-create
77 (b/exwm-ws-prev-index
))))
78 ([?\s-\
]] .
(lambda ()
80 (exwm-workspace-switch-create
81 (b/exwm-ws-next-index
))))
84 (exwm-workspace-move-window
85 (b/exwm-ws-prev-index
))))
88 (exwm-workspace-move-window
89 (b/exwm-ws-next-index
))))
91 `(,(kbd (format "s-%d" i
)) .
94 (exwm-workspace-switch-create ,i
))))
95 (number-sequence 0 (1- exwm-workspace-number
)))
96 ([?\s-t
] . exwm-floating-toggle-floating
)
97 ([?\s-f
] . exwm-layout-toggle-fullscreen
)
100 (kill-buffer (current-buffer))))
101 ([?\s-Q
] .
(lambda ()
103 (exwm-manage--kill-client)))
104 ([?\s-
\'] .
(lambda ()
106 (start-process-shell-command
107 "rofi-light" nil
"rofi-light")))
111 (start-process "" nil "amixer" "set" "'Master',0" "toggle")))
112 ([XF86AudioLowerVolume] .
116 "" nil "amixer" "set" "'Master',0" "5%-")))
117 ([XF86AudioRaiseVolume] .
121 "" nil "amixer" "set" "'Master',0" "5%+")))
125 (start-process "" nil "mpc" "toggle")))
129 (start-process "" nil "mpc" "prev")))
133 (start-process "" nil "mpc" "next")))
137 (start-process "" nil "dm-tool" "lock")))
138 ([\s-XF86Back] . previous-buffer)
139 ([\s-XF86Forward] . next-buffer)))
141 ;; Line-editing shortcuts
142 (setq exwm-input-simulation-keys
147 ([?\M-f] . [C-right])
155 ([?\C-k] . [S-end ?\C-x])
162 ([?\M-d] . [C-S-right ?\C-x])
163 ([?\M-\d] . [C-S-left ?\C-x])
170 ([?\C-g] . [escape]))))
172 (use-package exwm-manage
176 (exwm-manage-finish . (lambda ()
177 (when exwm-class-name
179 ((string= exwm-class-name "IceCat")
180 (exwm-input-set-local-simulation-keys
181 `(,@exwm-input-simulation-keys
182 ([?\C-\S-d] . [?\C-d]))))
183 ((string= exwm-class-name "URxvt")
184 (exwm-input-set-local-simulation-keys
185 '(([?\C-c ?\C-c] . [?\C-c])
186 ([?\C-c ?\C-u] . [?\C-u]))))
187 ((string= exwm-class-name "Zathura")
188 (exwm-input-set-local-simulation-keys
190 ([?\C-n] . [C-down])))))))))
192 (use-package exwm-randr
198 (exwm-randr-workspace-monitor-plist '(1 "VGA-1")))
200 (use-package exwm-systemtray
204 (exwm-systemtray-enable))
206 (use-package exwm-workspace)
208 (use-package exwm-edit
212 (provide 'bandali-exwm)