diff options
author | Thanos Apollo <[email protected]> | 2022-12-14 16:34:35 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2022-12-14 16:34:35 +0200 |
commit | 834977f0c2e981cc7074fd728133b2e61100ab5f (patch) | |
tree | 10df2a09cc7266ba8c6308f8698f3befa8921e06 /.exwm.el | |
parent | 64bc66735332eeea7bb0cf28fce10a034bd73234 (diff) |
exwm: redo, change keys, not major change
Diffstat (limited to '.exwm.el')
-rw-r--r-- | .exwm.el | 219 |
1 files changed, 110 insertions, 109 deletions
@@ -9,9 +9,9 @@ (display-time-mode 1) ;;Launch apps that will run in the background -;; (apollo/run-in-background "blueman-applet") + ;; (apollo/run-in-background "blueman-applet") (apollo/run-in-background "picom") -;; (apollo/run-in-background "nm-applet") + ;; (apollo/run-in-background "nm-applet") (apollo/emacs-keys) (apollo/restore-wallpaper) ) @@ -20,113 +20,114 @@ (exwm-workspace-rename-buffer exwm-class-name)) - (setq exwm-workspace-number 6) - ;; When window "class" updates, use it to set the buffer name - (add-hook 'exwm-update-class-hook #'apollo/exwm-update-class) - - ;;When EXWM starts up, run this hook - (add-hook 'exwm-init-hook #'apollo/exwm-init-hook) - (start-process-shell-command - "xrandr" nil "xrandr --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal") - - ;; Set the screen resolution - - (require 'exwm-randr) - (setq exwm-randr-workspace-output-plist '(1 "DP-1" 2 "HDMI-A-0")) - (add-hook 'exwm-randr-screen-change-hook - (lambda () - (start-process-shell-command - "xrandr" nil "xrandr --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal" ))) - (exwm-randr-enable) - - - ;; Load the system tray before exwm-init - (require 'exwm-systemtray) - (exwm-systemtray-enable) - - ;; These keys should always pass through to Emacs - (setq exwm-input-prefix-keys - '(?\C-x - ?\C-u - ?\C-h - ?\C-w - ?\M-x - ?\M-` - ?\M-& - ?\M-: - ?\s-d - ?\C-\M-j ;; Buffer list - ?\C-\ )) ;; Ctrl+Space - - ;; Ctrl+Q will enable the next key to be sent directly - (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) - - ;; Set up global key bindings. These always work, no matter the input state! - ;; Keep in mind that changing this list after EXWM initializes has no effect. - (setq exwm-input-global-keys - `( - ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard) - ([?\s-r] . exwm-reset) - - ;; Move between windows - ([C-w C-p] . windmove-left) - ([C-w C-n] . windmove-right) -; ([s-up] . windmove-up) -; ([s-down] . windmove-down) - ([C-w C-v] . split-window-right) - - ;; Launch applications via shell command - ([?\s-&] . (lambda (command) - (interactive (list (read-shell-command "$ "))) - (start-process-shell-command command nil command))) - - ;; Switch workspace - ([?\s-e] . exwm-workspace-switch) - ([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0))) - ([?\s-1] . (lambda () (interactive) (exwm-workspace-switch-create 1))) - ([?\s-2] . (lambda () (interactive) (exwm-workspace-switch-create 2))) - ([?\s-3] . (lambda () (interactive) (exwm-workspace-switch-create 3))) - ([?\s-4] . (lambda () (interactive) (exwm-workspace-switch-create 4))) - - ,@(mapcar (lambda (i) - `(,(kbd (format "s-%d" i)) . - (lambda () - (interactive) - (exwm-workspace-switch-create ,i)))) - (number-sequence 0 9)))) - - (defun exwm-enlarge-horizontally-50 () - (interactive) - (exwm-layout-enlarge-window-horizontally 50)) - - (defun exwm-shrink-horizontally-50 () - "Shrink window horizontally by 10" - (interactive) - (exwm-layout-shrink-window-horizontally 50)) - - (defun exwm-shrink-vertically-50 () - "Shrink window by 50." - (interactive) - (exwm-layout-shrink-window 50)) - - (defun exwm-enlarge-vertically-50 () - "Enlarge window by 50." - (interactive) - (exwm-layout-enlarge-window 50)) - - (exwm-input-set-key (kbd "C-c d") 'dmenu) - (exwm-input-set-key (kbd "s-<tab>") 'rofi) - (exwm-input-set-key (kbd "s-Q") 'kill-emacs) - (exwm-input-set-key (kbd "<XF86AudioRaiseVolume>") 'apollo/volume-increase) - (exwm-input-set-key (kbd "<XF86AudioLowerVolume>") 'apollo/volume-decrease) - (exwm-input-set-key (kbd "s-0") 'apollo/emacs-keys) - (exwm-input-set-key (kbd "s-9") 'apollo/greek-keyboard) - (exwm-input-set-key (kbd "C-w C-<left>") 'exwm-shrink-horizontally-50) - (exwm-input-set-key (kbd "C-w C-<right>") 'exwm-enlarge-horizontally-50) - (exwm-input-set-key (kbd "C-w C-<up>") 'exwm-shrink-vertically-50) - (exwm-input-set-key (kbd "C-w C-<up>") 'exwm-enlarge-vertically-50) - - (exwm-enable) +(setq exwm-workspace-number 6) +;; When window "class" updates, use it to set the buffer name +(add-hook 'exwm-update-class-hook #'apollo/exwm-update-class) + +;;When EXWM starts up, run this hook +(add-hook 'exwm-init-hook #'apollo/exwm-init-hook) +(start-process-shell-command + "xrandr" nil "xrandr --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal") + +;; Set the screen resolution + +(require 'exwm-randr) +(setq exwm-randr-workspace-output-plist '(1 "DP-1" 2 "HDMI-A-0")) +(add-hook 'exwm-randr-screen-change-hook + (lambda () + (start-process-shell-command + "xrandr" nil "xrandr --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal" ))) +(exwm-randr-enable) + + +;; Load the system tray before exwm-init +(require 'exwm-systemtray) +(exwm-systemtray-enable) + +;; These keys should always pass through to Emacs +(setq exwm-input-prefix-keys + '(?\C-x + ?\C-u + ?\C-h + ?\C-w + ?\M-x + ?\M-` + ?\M-& + ?\M-: + ?\s-d + ?\C-\M-j ;; Buffer list + ?\C-\ + ?\C-k + ?\C-y)) + +;; Ctrl+Q will enable the next key to be sent directly +(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) + +;; Set up global key bindings. These always work, no matter the input state! +;; Keep in mind that changing this list after EXWM initializes has no effect. +(setq exwm-input-global-keys + `( + ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard) + ([?\s-r] . exwm-reset) + + ;; Move between windows + ; ([s-up] . windmove-up) + ; ([s-down] . windmove-down) + + + ;; Launch applications via shell command + ([?\s-&] . (lambda (command) + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command command nil command))) + + ;; Switch workspace + ([?\s-e] . exwm-workspace-switch) + ([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0))) + ([?\s-1] . (lambda () (interactive) (exwm-workspace-switch-create 1))) + ([?\s-2] . (lambda () (interactive) (exwm-workspace-switch-create 2))) + ([?\s-3] . (lambda () (interactive) (exwm-workspace-switch-create 3))) + ([?\s-4] . (lambda () (interactive) (exwm-workspace-switch-create 4))) + + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + (number-sequence 0 9)))) + +(defun exwm-enlarge-horizontally-50 () + (interactive) + (exwm-layout-enlarge-window-horizontally 50)) + +(defun exwm-shrink-horizontally-50 () + "Shrink window horizontally by 10" + (interactive) + (exwm-layout-shrink-window-horizontally 50)) + +(defun exwm-shrink-vertically-50 () + "Shrink window by 50." + (interactive) + (exwm-layout-shrink-window 50)) + +(defun exwm-enlarge-vertically-50 () + "Enlarge window by 50." + (interactive) + (exwm-layout-enlarge-window 50)) + +(exwm-input-set-key (kbd "C-c d") 'dmenu) +(exwm-input-set-key (kbd "s-<tab>") 'rofi) +(exwm-input-set-key (kbd "s-Q") 'kill-emacs) +(exwm-input-set-key (kbd "<XF86AudioRaiseVolume>") 'apollo/volume-increase) +(exwm-input-set-key (kbd "<XF86AudioLowerVolume>") 'apollo/volume-decrease) +(exwm-input-set-key (kbd "s-0") 'apollo/emacs-keys) +(exwm-input-set-key (kbd "s-9") 'apollo/greek-keyboard) +(exwm-input-set-key (kbd "C-w C-<left>") 'exwm-shrink-horizontally-50) +(exwm-input-set-key (kbd "C-w C-<right>") 'exwm-enlarge-horizontally-50) +(exwm-input-set-key (kbd "C-w C-<up>") 'exwm-shrink-vertically-50) +(exwm-input-set-key (kbd "C-w C-<up>") 'exwm-enlarge-vertically-50) + + +(exwm-enable) ;;Transparency (set-frame-parameter (selected-frame) 'alpha '(90 90)) |