From e38610e2252d05dd8ee9c014f82c97ba5538840e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 4 Feb 2024 12:57:26 +0400 Subject: [PATCH] holy shit --- config/emacs/emacs.org | 60 ++++++++++++++++++++++++++++++-- modules/desktop/exwm/default.nix | 7 ++-- 2 files changed, 61 insertions(+), 6 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index cb71babf..1d908d76 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -160,9 +160,9 @@ Cause emacs overlay lol (add-hook 'emacs-startup-hook (lambda () ;;(setq gc-cons-threshold 16777216 ; 16mb - ;; this could be really bad idk - (setq gc-cons-threshold 100000000 - gc-cons-percentage 0.1))) + ;; this could be really bad idk + (setq gc-cons-threshold 100000000 + gc-cons-percentage 0.1)))) #+end_src ** Don't use GC when minibuffer is used #+begin_src emacs-lisp @@ -1310,6 +1310,60 @@ Aint no way bro (use-package docker :bind ("C-c d" . docker)) #+end_src +** EXWM +RELEASE ME +#+begin_src emacs-lisp + (when (eq system-type 'gnu/linux) + (use-package exwm + :config + ;; workspaces + (setq exwm-workspace-number 5) + + ;; always use these keys in emacs + (setq exwm-input-prefix-keys + '(?\C-x + ?\C-u + ?\C-h + ?\M-x + ?\M-` + ?\M-& + ?\M-: + ?\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 + ([s-left] . windmove-left) + ([s-right] . windmove-right) + ([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-w] . exwm-workspace-switch) + + ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9) + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + (number-sequence 0 9)))) + )) + +#+end_src * Org Mode Configuration Setup ** Babel Languages #+begin_src emacs-lisp diff --git a/modules/desktop/exwm/default.nix b/modules/desktop/exwm/default.nix index c6fca98a..1ea189ae 100644 --- a/modules/desktop/exwm/default.nix +++ b/modules/desktop/exwm/default.nix @@ -27,9 +27,9 @@ in { # https://nixos.wiki/wiki/XMonad services.xserver = { enable = true; - windowManager.exwm = { - enable = true; - }; + # windowManager.exwm = { + # enable = true; + # }; windowManager.session = let # Allow for per-host injected desktop-related Emacs configuration. @@ -45,6 +45,7 @@ in { extraConfig = pkgs.writeText "emacs-extra-config" '' (require 'exwm-config) (exwm-config-default) + (exwm-enable) ''; in singleton {