My personal dotfiles
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.

.exwm.el 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. (use-package exwm)
  2. (require 'exwm-config)
  3. (require 'exwm-systemtray)
  4. (exwm-systemtray-enable)
  5. (defmacro wolfe/exwm-bind (key command)
  6. `(exwm-input-set-key ,(kbd key) ,command))
  7. (defmacro wolfe/exwm-bind-lambda (key command)
  8. `(exwm-input-set-key ,(kbd key) (lambda () (interactive) ,command)))
  9. (defmacro wolfe/exwm-bind-exec (key cmd)
  10. `(wolfe/exwm-bind-lambda ,key (start-process-shell-command ,cmd nil ,cmd)))
  11. (fringe-mode 1)
  12. (display-time-mode t) ;Show the time
  13. (setq battery-mode-line-format "[%p]")
  14. (display-battery-mode t)
  15. ;; Set the initial workspace number.
  16. (setq exwm-workspace-number 4)
  17. ;; Make class name the buffer name
  18. (add-hook 'exwm-update-class-hook
  19. (lambda () (exwm-workspace-rename-buffer exwm-class-name)))
  20. ;; 's-r': Reset
  21. (wolfe/exwm-bind "s-r" #'exwm-reset)
  22. ;; 's-w': Switch workspace
  23. (wolfe/exwm-bind "s-w" #'exwm-workspace-switch)
  24. ;; 's-c': Browser
  25. (wolfe/exwm-bind-exec "s-c" "firefox-developer-edition")
  26. ;; 's-RET': Open terminal
  27. (wolfe/exwm-bind-exec "s-<return>" "urxvt")
  28. ;; 's-N': Switch to certain workspace
  29. (let ((workspace-list '("&" "[" "{" "}" "(" "=" "*" ")" "+" "]")))
  30. (dotimes (i 10)
  31. (exwm-input-set-key (kbd (format "s-%s" (nth i workspace-list)))
  32. `(lambda ()
  33. (interactive)
  34. (exwm-workspace-switch-create ,i)))))
  35. ;; 's-&': Launch application
  36. (exwm-input-set-key (kbd "s-SPC")
  37. (lambda (command)
  38. (interactive (list (read-shell-command "$ ")))
  39. (start-process-shell-command command nil command)))
  40. (exwm-input-set-simulation-keys '(([?\C-c ?\C-c] . ?\C-c)
  41. ([?\C-x ?\C-x] . ?\C-x)))
  42. (wolfe/exwm-bind-exec "<XF86MonBrightnessUp>" "xbacklight -inc 2")
  43. (wolfe/exwm-bind-exec "<XF86MonBrightnessDown>" "xbacklight -dec 2")
  44. (wolfe/exwm-bind-exec "<XF86KbdBrightnessUp>" "asus-kbd-backlight up")
  45. (wolfe/exwm-bind-exec "<XF86KbdBrightnessDown>" "asus-kbd-backlight down")
  46. (wolfe/exwm-bind-exec "<XF86AudioRaiseVolume>" "amixer -D pulse sset Master 2%+")
  47. (wolfe/exwm-bind-exec "<XF86AudioLowerVolume>" "amixer -D pulse sset Master 2%-")
  48. (wolfe/exwm-bind-exec "<XF86AudioMute>" "amixer set Master toggle")
  49. ;; Line-editing shortcuts
  50. ;;(setq exwm-input-simulation-keys
  51. ;; '(([?\C-b] . [left])
  52. ;; ([?\C-f] . [right])
  53. ;; ([?\C-p] . [up])
  54. ;; ([?\C-n] . [down])
  55. ;; ([?\C-a] . [home])
  56. ;; ([?\C-e] . [end])
  57. ;; ([?\M-v] . [prior])
  58. ;; ([?\C-v] . [next])
  59. ;; ([?\C-d] . [delete])
  60. ;; ([?\C-k] . [S-end delete]))
  61. ;; Enable EXWM
  62. (exwm-enable)