mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 16:24:18 +00:00
Added support for exwm-global-set-key
This commit is contained in:
parent
681c451b56
commit
abb292120a
4 changed files with 38 additions and 30 deletions
|
|
@ -658,7 +658,7 @@
|
|||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package switch-window)
|
||||
(global-set-key (kbd "C-x o") 'switch-window)
|
||||
(global-set-key (kbd "s-o") 'other-window)
|
||||
(exwm-global-set-key (kbd "s-o") 'other-window)
|
||||
(setq switch-window-shortcut-style 'qwerty)
|
||||
(setq switch-window-qwerty-shortcuts
|
||||
'("a" "o" "e" "u" "i" "d" "h" "t" "n" "s"))
|
||||
|
|
|
|||
|
|
@ -304,8 +304,8 @@
|
|||
(require 'exwm-background)
|
||||
(define-key *window-map* (kbd "t") 'exwm-background/window-transparency-hydra/body)
|
||||
(setq window-system-default-frame-alist `((x . ((alpha . (,exwm-background/current-transparency . 50))))))
|
||||
(global-set-key (kbd "s-v") #'exwm-background/toggle-viewing-background)
|
||||
(global-set-key (kbd "s-b") #'exwm-background/exwm-background-window) ;; TODO: Fix keybinding
|
||||
(exwm-global-set-key (kbd "s-v") #'exwm-background/toggle-viewing-background)
|
||||
(exwm-global-set-key (kbd "s-b") #'exwm-background/exwm-background-window) ;; TODO: Fix keybinding
|
||||
(define-key desktop-environment-mode-map (kbd "<S-XF86MonBrightnessDown>") #'exwm-background/decrease-transparency)
|
||||
(define-key desktop-environment-mode-map (kbd "<S-XF86MonBrightnessUp>") #'exwm-background/increase-transparency)
|
||||
(define-key *window-map* (kbd "b") #'exwm-background/exwm-background-window)
|
||||
|
|
@ -365,26 +365,24 @@
|
|||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package transpose-frame)
|
||||
|
||||
(setq exwm-input-global-keys
|
||||
`(([?\s-r] . exwm-reset)
|
||||
;; ([?\s-w] . exwm-workspace-switch)
|
||||
([?\s-l] . lock-screen)
|
||||
(,(kbd "s-c") . org-capture)
|
||||
(,(kbd "s-n") . switch-window)
|
||||
(,(kbd "s-k") . kill-this-buffer)
|
||||
(,(kbd "s-z") . resize-window)
|
||||
(,(kbd "s-s") . youtube-split)
|
||||
(,(kbd "s-n") . switch-to-next-buffer)
|
||||
(,(kbd "s-p") . switch-to-prev-buffer)
|
||||
(,(kbd "s-a") . my/toggle-keyboard)
|
||||
(,my/keymap-key . *root-map*)))
|
||||
(exwm-global-set-key (kbd "s-r") #'exwm-reset)
|
||||
(exwm-global-set-key (kbd "s-l") #'lock-screen)
|
||||
(exwm-global-set-key (kbd "s-c") #'org-capture)
|
||||
(exwm-global-set-key (kbd "s-n") #'switch-window)
|
||||
(exwm-global-set-key (kbd "s-k") #'kill-this-buffer)
|
||||
(exwm-global-set-key (kbd "s-z") #'resize-window)
|
||||
(exwm-global-set-key (kbd "s-s") #'youtube-split)
|
||||
(exwm-global-set-key (kbd "s-n") #'switch-to-next-buffer)
|
||||
(exwm-global-set-key (kbd "s-p") #'switch-to-prev-buffer)
|
||||
(exwm-global-set-key (kbd "s-a") #'my/toggle-keyboard)
|
||||
(exwm-global-set-key my/keymap-key '*root-map*)
|
||||
|
||||
(defmacro define-exwm-input-key (keybinding function)
|
||||
`(add-to-list 'exwm-input-global-keys
|
||||
(cons ,keybinding ,function)))
|
||||
|
||||
(global-set-key (kbd "s-h") 'windmove-left)
|
||||
(global-set-key (kbd "s-l") 'windmove-right)
|
||||
(exwm-global-set-key (kbd "s-h") 'windmove-left)
|
||||
(exwm-global-set-key (kbd "s-l") 'windmove-right)
|
||||
(define-key desktop-environment-mode-map (kbd "s-l") nil)
|
||||
|
||||
(defun dvorak? ()
|
||||
|
|
@ -400,10 +398,9 @@
|
|||
(set-keyboard "us")
|
||||
(set-keyboard "de neo_dvorak")))
|
||||
|
||||
(global-set-key (kbd "M-T") 'flop-frame)
|
||||
(global-set-key (kbd "C-x p") 'launch-program)
|
||||
(global-set-key (kbd "M-…") 'multi-term)
|
||||
(global-set-key (kbd "C-ü") 'undo-tree-undo)
|
||||
(exwm-global-set-key (kbd "C-x p") 'launch-program)
|
||||
(exwm-global-set-key (kbd "M-…") 'multi-term)
|
||||
(exwm-global-set-key (kbd "C-ü") 'undo-tree-undo)
|
||||
|
||||
(defun prompt-workspace (&optional prompt)
|
||||
"Prompt for a workspace, returning the workspace frame."
|
||||
|
|
|
|||
17
init.el
17
init.el
|
|
@ -24,9 +24,9 @@
|
|||
(require 'org)
|
||||
(require 'use-package)
|
||||
|
||||
;; Uncomment if want to debug
|
||||
;; (progn
|
||||
;; (toggle-debug-on-error))
|
||||
(setq use-package-always-ensure t)
|
||||
|
||||
(defvar my/enable-exwm t)
|
||||
|
||||
;; Add my modules
|
||||
|
||||
|
|
@ -36,13 +36,16 @@
|
|||
|
||||
(require 'libs)
|
||||
|
||||
(setq use-package-always-ensure t)
|
||||
(when my/enable-exwm
|
||||
(use-package exwm)
|
||||
(setq exwm-input-global-keys nil))
|
||||
|
||||
(load-file "~/.emacs.d/lisp/keymap.el")
|
||||
|
||||
(org-babel-load-file
|
||||
(expand-file-name "config-exwm.org"
|
||||
user-emacs-directory))
|
||||
(when my/enable-exwm
|
||||
(org-babel-load-file
|
||||
(expand-file-name "config-exwm.org"
|
||||
user-emacs-directory))
|
||||
|
||||
(org-babel-load-file
|
||||
(expand-file-name "config-base.org"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
(defmacro exwm-global-set-key (keybinding function)
|
||||
`(progn
|
||||
(if (boundp 'exwm-input-global-keys)
|
||||
(add-to-list 'exwm-input-global-keys
|
||||
(cons ,keybinding ,function))
|
||||
(global-set-key ,keybinding ,function))))
|
||||
|
||||
(define-prefix-command '*root-map*)
|
||||
(global-set-key (kbd "C-t") '*root-map*)
|
||||
(exwm-global-set-key (kbd "C-t") '*root-map*)
|
||||
(exwm-global-set-key (kbd "M-T") 'flop-frame)
|
||||
|
||||
(defconst my/keymap-key (kbd "C-t"))
|
||||
;; Disable C-t for all others
|
||||
|
|
|
|||
Loading…
Reference in a new issue