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.

41 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 "Run")
  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. :custom (exwm-input-prefix-keys
  20. '(?\M-x
  21. ?\C-g
  22. ?\C-\ ))
  23. (exwm-input-global-keys
  24. `(([?\s-r] . exwm-reset)
  25. ,@(mapcar (lambda (i)
  26. `(,(kbd (format "s-%d" i)) .
  27. (lambda ()
  28. (interactive)
  29. (exwm-workspace-switch-create ,i))))
  30. (number-sequence 1 9))))
  31. :config (require 'exwm-randr)
  32. (exwm-randr-enable)
  33. (add-hook 'exwm-init-hook #'dotfiles/init-hook)
  34. (add-hook 'exwm-randr-screen-change-hook #'dotfiles/update-display)
  35. (dotfiles/update-display)
  36. (exwm-enable))