Update the window manager configuration order
This commit is contained in:
parent
29546f2b2a
commit
26932adb9f
|
@ -135,11 +135,13 @@
|
|||
(setcar native-comp-eln-load-path fg42/cache-dir))
|
||||
|
||||
(when (file-exists-p user-init-file)
|
||||
(message "[FG42]: Loading user's init file")
|
||||
(load user-init-file))
|
||||
|
||||
;; Load the customization file. In FG42 it is different than
|
||||
;; the default `user-init-file'
|
||||
(when (file-exists-p custom-file)
|
||||
(message "[FG42]: Loading user's custom file")
|
||||
(load custom-file))
|
||||
|
||||
;; From point forward we can use normal Elisp stuff without
|
||||
|
|
|
@ -79,119 +79,115 @@
|
|||
;; (height . 15))))
|
||||
|
||||
|
||||
(defun fg42/start-wm ()
|
||||
"The entry point for the WM mode."
|
||||
(interactive)
|
||||
(when-wm
|
||||
(message "[FG42]: Starting the window manager.")
|
||||
(require 'exwm-config)
|
||||
;; Set the initial number of workspaces (they can also be created later).
|
||||
(setq exwm-workspace-number 10)
|
||||
|
||||
;; All buffers created in EXWM mode are named "*EXWM*". You may want to
|
||||
;; change it in `exwm-update-class-hook' and `exwm-update-title-hook', which
|
||||
;; are run when a new X window class name or title is available. Here's
|
||||
;; some advice on this topic:
|
||||
;; + Always use `exwm-workspace-rename-buffer` to avoid naming conflict.
|
||||
;; + For applications with multiple windows (e.g. GIMP), the class names of
|
||||
;; all windows are probably the same. Using window titles for them makes
|
||||
;; more sense.
|
||||
;; In the following example, we use class names for all windows except for
|
||||
;; Java applications and GIMP.
|
||||
(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)
|
||||
([?\s-g] . keyboard-quit)
|
||||
([8388640] . other-window)
|
||||
;; 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.
|
||||
,@(mapcar (lambda (i)
|
||||
`(,(kbd (format "s-%d" i)) .
|
||||
(lambda ()
|
||||
(interactive)
|
||||
(exwm-workspace-switch-create ,i))))
|
||||
(number-sequence 0 9))
|
||||
;; Bind "s-&" to launch applications ('M-&' also works if the output
|
||||
;; buffer does not bother you).
|
||||
([?\s-d] . fg42/run)
|
||||
;; Bind "s-<f2>" to "slock", a simple X display locker.
|
||||
([s-f2] . (lambda ()
|
||||
(interactive)
|
||||
(start-process "" nil "slock")))))
|
||||
|
||||
;; To add a key binding only available in line-mode, simply define it in
|
||||
;; `exwm-mode-map'. The following example shortens 'C-c q' to 'C-q'.
|
||||
(define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key)
|
||||
|
||||
(push ?\C-c exwm-input-prefix-keys)
|
||||
|
||||
;; You can hide the minibuffer and echo area when they're not used, by
|
||||
;; uncommenting the following line.
|
||||
;;(setq exwm-workspace-minibuffer-position 'bottom)
|
||||
|
||||
;; The following example demonstrates how to use simulation keys to mimic
|
||||
;; the behavior of Emacs. The value of `exwm-input-simulation-keys` is a
|
||||
;; list of cons cells (SRC . DEST), where SRC is the key sequence you press
|
||||
;; and DEST is what EXWM actually sends to application. Note that both SRC
|
||||
;; and DEST should be key sequences (vector or string).
|
||||
(setq exwm-input-simulation-keys
|
||||
`(
|
||||
;; movement
|
||||
(,(kbd "C-b") . left)
|
||||
(,(kbd "M-b") . ,(kbd "C-<left>"))
|
||||
(,(kbd "C-f") . right)
|
||||
(,(kbd "M-f") . ,(kbd "C-<right>"))
|
||||
(,(kbd "C-p") . up)
|
||||
(,(kbd "C-n") . down)
|
||||
(,(kbd "C-a") . home)
|
||||
(,(kbd "C-e") . end)
|
||||
(,(kbd "M-v") . prior)
|
||||
(,(kbd "C-v") . next)
|
||||
(,(kbd "C-d") . delete)
|
||||
;;(,(kbs "C-k") . [S-end delete])
|
||||
;; navigation
|
||||
(,(kbd "C-c b") . ,(kbd "M-<left>"))
|
||||
(,(kbd "C-c f") . ,(kbd "M-<right>"))
|
||||
(,(kbd "C-c w") . ,(kbd "C-w"))
|
||||
(,(kbd "C-w") . ,(kbd "C-x"))
|
||||
(,(kbd "M-w") . ,(kbd "C-c"))
|
||||
(,(kbd "C-y") . ,(kbd "C-v"))
|
||||
;; search
|
||||
(,(kbd "C-s") . ,(kbd "C-f"))))
|
||||
|
||||
;; Activating the WM moder
|
||||
(exwm-enable)
|
||||
(exwm-systemtray-enable)
|
||||
(exwm-randr-enable)
|
||||
(exwm-debug)
|
||||
(message "[FG42]: Finished loading the window manager.")))
|
||||
|
||||
|
||||
(use! exwm
|
||||
"Emacs X Widnow manager."
|
||||
:commands exwm-enable
|
||||
:hook (emacs-startup . (lambda ()
|
||||
(when-wm
|
||||
(message "[FG42]: Starting the window manager.")
|
||||
;; Activating the WM moder
|
||||
(exwm-enable)
|
||||
(exwm-systemtray-enable)
|
||||
(exwm-randr-enable)
|
||||
(exwm-debug t)
|
||||
(message "[FG42]: Finished loading the window manager."))))
|
||||
:config
|
||||
(require 'exwm-config)
|
||||
;; (setq ido-enable-flex-matching t)
|
||||
|
||||
;; Setup a basic completion
|
||||
;; (icomplete-mode)
|
||||
;; (defun my-icomplete-styles ()
|
||||
;; (setq-local completion-styles '(flex initials)))
|
||||
;; (add-hook 'icomplete-minibuffer-setup-hook 'my-icomplete-styles)
|
||||
|
||||
;; (exwm-config-ido)
|
||||
|
||||
;; Set the initial number of workspaces (they can also be created later).
|
||||
(setq exwm-workspace-number 10)
|
||||
;; All buffers created in EXWM mode are named "*EXWM*". You may want to
|
||||
;; change it in `exwm-update-class-hook' and `exwm-update-title-hook', which
|
||||
;; are run when a new X window class name or title is available. Here's
|
||||
;; some advice on this topic:
|
||||
;; + Always use `exwm-workspace-rename-buffer` to avoid naming conflict.
|
||||
;; + For applications with multiple windows (e.g. GIMP), the class names of
|
||||
;; all windows are probably the same. Using window titles for them makes
|
||||
;; more sense.
|
||||
;; In the following example, we use class names for all windows except for
|
||||
;; Java applications and GIMP.
|
||||
(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)
|
||||
([?\s-g] . keyboard-quit)
|
||||
([8388640] . other-window)
|
||||
;; 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.
|
||||
,@(mapcar (lambda (i)
|
||||
`(,(kbd (format "s-%d" i)) .
|
||||
(lambda ()
|
||||
(interactive)
|
||||
(exwm-workspace-switch-create ,i))))
|
||||
(number-sequence 0 9))
|
||||
;; Bind "s-&" to launch applications ('M-&' also works if the output
|
||||
;; buffer does not bother you).
|
||||
([?\s-d] . fg42/run)
|
||||
;; Bind "s-<f2>" to "slock", a simple X display locker.
|
||||
([s-f2] . (lambda ()
|
||||
(interactive)
|
||||
(start-process "" nil "slock")))))
|
||||
|
||||
;; To add a key binding only available in line-mode, simply define it in
|
||||
;; `exwm-mode-map'. The following example shortens 'C-c q' to 'C-q'.
|
||||
(define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key)
|
||||
|
||||
(push ?\C-c exwm-input-prefix-keys)
|
||||
|
||||
;; You can hide the minibuffer and echo area when they're not used, by
|
||||
;; uncommenting the following line.
|
||||
;;(setq exwm-workspace-minibuffer-position 'bottom)
|
||||
|
||||
;; The following example demonstrates how to use simulation keys to mimic
|
||||
;; the behavior of Emacs. The value of `exwm-input-simulation-keys` is a
|
||||
;; list of cons cells (SRC . DEST), where SRC is the key sequence you press
|
||||
;; and DEST is what EXWM actually sends to application. Note that both SRC
|
||||
;; and DEST should be key sequences (vector or string).
|
||||
(setq exwm-input-simulation-keys
|
||||
`(
|
||||
;; movement
|
||||
(,(kbd "C-b") . left)
|
||||
(,(kbd "M-b") . ,(kbd "C-<left>"))
|
||||
(,(kbd "C-f") . right)
|
||||
(,(kbd "M-f") . ,(kbd "C-<right>"))
|
||||
(,(kbd "C-p") . up)
|
||||
(,(kbd "C-n") . down)
|
||||
(,(kbd "C-a") . home)
|
||||
(,(kbd "C-e") . end)
|
||||
(,(kbd "M-v") . prior)
|
||||
(,(kbd "C-v") . next)
|
||||
(,(kbd "C-d") . delete)
|
||||
;;(,(kbs "C-k") . [S-end delete])
|
||||
;; navigation
|
||||
(,(kbd "C-c b") . ,(kbd "M-<left>"))
|
||||
(,(kbd "C-c f") . ,(kbd "M-<right>"))
|
||||
(,(kbd "C-c w") . ,(kbd "C-w"))
|
||||
(,(kbd "C-w") . ,(kbd "C-x"))
|
||||
(,(kbd "M-w") . ,(kbd "C-c"))
|
||||
(,(kbd "C-y") . ,(kbd "C-v"))
|
||||
;; search
|
||||
(,(kbd "C-s") . ,(kbd "C-f"))))))
|
||||
:hook (emacs-startup . fg42/start-wm)))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue