I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.5 KiB

  1. (defun dotfiles/run (command)
  2. "Run an external process."
  3. (interactive (list (read-shell-command "λ ")))
  4. (start-process-shell-command command nil command))
  5. (defun dotfiles/run-in-background (command)
  6. (let ((command-parts (split-string command "[ ]+")))
  7. (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
  8. (dotfiles/leader
  9. "x" '(:ignore t :which-key "Execute")
  10. "xx" '(dotfiles/run :which-key "Run")
  11. "xb" '(dotfiles/run-in-background :which-key "Run (background)")
  12. "xz" '(async-shell-command :which-key "Async"))
  13. (defun dotfiles/init-hook ()
  14. (exwm-workspace-switch-create 1)
  15. (setq display-time-and-date t)
  16. (display-battery-mode 1)
  17. (display-time-mode 1))
  18. (defun dotfiles/update-display ()
  19. (dotfiles/run-in-background "autorandr --change --force"))
  20. (use-package exwm
  21. :config
  22. (require 'exwm-randr)
  23. (exwm-randr-enable)
  24. (add-hook 'exwm-init-hook #'dotfiles/init-hook)
  25. (add-hook 'exwm-randr-screen-change-hook #'dotfiles/update-display)
  26. (dotfiles/update-display)
  27. (setq exwm-input-prefix-keys
  28. '(?\M-x
  29. ?\C-g
  30. ?\C-\ )
  31. exwm-input-global-keys
  32. `(([?\s-r] . exwm-reset)
  33. ([?\s-&] . dotfiles/run)
  34. ,@(mapcar (lambda (i)
  35. `(,(kbd (format "s-%d" i)) .
  36. (lambda ()
  37. (interactive)
  38. (exwm-workspace-switch-create ,i))))
  39. (number-sequence 1 9))))
  40. (exwm-enable))