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.

43 lines
1.4 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" '(dotfiles/run :which-key "Execute")
  10. "z" '(async-shell-command :which-key "Async"))
  11. (defun dotfiles/init-hook ()
  12. (exwm-workspace-switch-create 1)
  13. (setq display-time-and-date t)
  14. (display-battery-mode 1)
  15. (display-time-mode 1))
  16. (defun dotfiles/update-display ()
  17. (dotfiles/run-in-background "autorandr --change --force"))
  18. (use-package exwm
  19. :config
  20. (require 'exwm-randr)
  21. (exwm-randr-enable)
  22. (add-hook 'exwm-init-hook #'dotfiles/init-hook)
  23. (add-hook 'exwm-randr-screen-change-hook #'dotfiles/update-display)
  24. (dotfiles/update-display)
  25. (setq exwm-input-prefix-keys
  26. '(?\M-x
  27. ?\C-g
  28. ?\C-\ )
  29. exwm-input-global-keys
  30. `(([?\s-r] . exwm-reset)
  31. ([?\s-&] . dotfiles/run)
  32. ,@(mapcar (lambda (i)
  33. `(,(kbd (format "s-%d" i)) .
  34. (lambda ()
  35. (interactive)
  36. (exwm-workspace-switch-create ,i))))
  37. (number-sequence 1 9))))
  38. (exwm-enable))