diff options
author | Thanos Apollo <[email protected]> | 2023-01-03 21:24:20 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-01-03 21:24:20 +0200 |
commit | c880bcd5c0f7e4d959193c9e5cf805771d8d00f0 (patch) | |
tree | 8585b7410ad78c93424eaa14d630df7a4d6b12cc | |
parent | f7d77a26bb36eb43f315a471979fdf0150797769 (diff) |
Add exwm-holyK-firefox
-rw-r--r-- | .emacs.d/lisp/exwm-holyK-firefox.el | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/.emacs.d/lisp/exwm-holyK-firefox.el b/.emacs.d/lisp/exwm-holyK-firefox.el new file mode 100644 index 0000000..d3e5f40 --- /dev/null +++ b/.emacs.d/lisp/exwm-holyK-firefox.el @@ -0,0 +1,32 @@ +;;; exwm-holyK-firefox --- Emacs keybinding implemention of exwm-firefox-core +;;; Author: Thanos Apollo +;;; Commentary: +;;; Code: + +(require 'exwm-firefox-core) + +(defvar exwm-firefox-class-names '("firefox-default" "firefox" "Firefox" "Nightly" "Icecat") + "The class name used for detecting if current buffer is firefox.") + +(define-minor-mode exwm-firefox-holyK-mode + "Get Emacs keybindings in Firefox with EXWM." + :lighter " Firefox/EXWM" + :keymap (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-n") 'exwm-firefox-core-down) + (define-key map (kbd "C-p") 'exwm-firefox-core-up) + (define-key map (kbd "C-f") 'exwm-firefox-core-tab-next) + (define-key map (kbd "C-b") 'exwm-firefox-core-tab-previous) + (define-key map (kbd "C-s") 'exwm-firefox-core-find) + (define-key map (kbd "C-y") 'exwm-firefox-core-paste) + (define-key map (kbd "C-c C-c") 'exwm-firefox-core-copy) + (define-key map (kbd "C-c C-n") 'exwm-firefox-core-tab-new) + (define-key map (kbd "C-c C-k") 'exwm-firefox-core-tab-close) + map)) + +(defun exwm-firefox-holyK-activate-if-firefox () + "Activates firefox-holyK-mode mode when buffer is firefox. +Firefox variant can be assigned in 'exwm-firefox-class-names`" + (interactive) + (if (member exwm-class-name exwm-firefox-class-names) + (exwm-firefox-holyK-mode 1))) + |