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