kkk-exwm.el 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ;;; kkk-exwm.el --- Exwm Config -*- lexical-binding: t; -*-
  2. ;; Copyright (C) 2023 Vinicius Teshima <vini.tes@pm.me>
  3. ;; Author: Vinicius Teshima <vini.tes@pm.me>
  4. ;; This program is free software; you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;; You should have received a copy of the GNU General Public License
  13. ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. ;;; Commentary:
  15. ;; Exwm Configs
  16. ;;; Code:
  17. (when (string-empty-p (shell-command-to-string "pgrep i3"))
  18. (defun kkk-exwm-run-shell-async (CMD)
  19. "Run CMD with `start-process-shell-command'."
  20. (interactive (list (read-shell-command "$ ")))
  21. (start-process-shell-command CMD nil CMD))
  22. (defun kkk-exwm-update-class ()
  23. "Change th buffer name to the name of app."
  24. (exwm-workspace-rename-buffer exwm-class-name))
  25. (use-package exwm
  26. :functions (exwm-enable exwm-workspace-rename-buffer)
  27. :defines (exwm-workspace-number exwm-input-prefix-keys exwm-mode-map
  28. exwm-class-name)
  29. :config
  30. (add-hook 'exwm-update-class-hook #'kkk-exwm-update-class)
  31. (setq exwm-workspace-number 10)
  32. ;; These keys should always pass through to Emacs
  33. (setq exwm-input-prefix-keys
  34. '(?\C-x
  35. ?\C-h
  36. ?\M-x
  37. ?\M-`
  38. ?\M-&
  39. ?\M-:
  40. ?\C-\M-j ;; Buffer list
  41. ))
  42. (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
  43. (exwm-enable))
  44. (use-package exwm-edit
  45. :after (exwm))
  46. )
  47. (provide 'kkk-exwm)
  48. ;;; kkk-exwm.el ends here