-
Notifications
You must be signed in to change notification settings - Fork 1
/
init-exwm.el
49 lines (49 loc) · 2 KB
/
init-exwm.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
;; See https://github.com/ch11ng/exwm/wiki
;; https://github.com/ch11ng/exwm/wiki/Configuration-Example
(when (boundp 'use-exwm)
(setq mouse-autoselect-window nil
focus-follows-mouse nil)
;;(ido-mode 1)
(require 'exwm)
(require 'exwm-config)
;;(exwm-config-ido)
;;(exwm-config-default)
(require 'exwm-randr)
;;(add-hook 'exwm-randr-screen-change-hook
;; (lambda ()
;; (start-process-shell-command
;; "xrandr" nil "xrandr --output VGA1 --left-of LVDS1 --auto")))
(require 'exwm-systemtray)
;;(setq exwm-workspace-number 4)
;;(setq mouse-autoselect-window nil)
(global-set-key [mode-line mouse-2] 'exwm-layout-toggle-fullscreen)
(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))))
(setq exwm-input-global-keys
`(([?\s-r] . exwm-reset)
([?\s-w] . exwm-workspace-switch)
,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) .
(lambda ()
(interactive)
(exwm-workspace-switch-create ,i))))
(number-sequence 0 9))
([?\s-&] . (lambda (command)
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command command nil command)))
[s-o] . (lambda ()
(interactive)
(start-process "" nil "/usr/bin/slock"))))
(define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key)
(exwm-enable)
(exwm-randr-enable)
(exwm-systemtray-enable))