From a76167e432efa37527ef2f2698ad291aec415603 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 8 Feb 2024 09:41:34 +0400 Subject: [PATCH] add app launcher and fullscreen --- config/emacs/emacs.org | 272 +++++++++++++++++++++-------------------- 1 file changed, 139 insertions(+), 133 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 207e6611..8e668a5b 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -308,52 +308,54 @@ Cause emacs overlay lol #+end_src ** Command Autocompletion Packages #+begin_src emacs-lisp - ;; better search - (use-package swiper - ) - ;; better commands - (use-package counsel + ;; better search + (use-package swiper ) - ;; autocompletion on commands (?) - (use-package ivy - :diminish - :bind (("C-s" . swiper) - :map ivy-minibuffer-map - ("TAB" . ivy-alt-done) - ("C-l" . ivy-alt-done) - ("C-j" . ivy-next-line) - ("C-k" . ivy-previous-line) - :map ivy-switch-buffer-map - ("C-k" . ivy-previous-line) - ("C-l" . ivy-done) - ("C-d" . ivy-switch-buffer-kill) - :map ivy-reverse-i-search-map - ("C-k" . ivy-previous-line) - ("C-d" . ivy-reverse-i-search-kill)) - :demand - :config - (ivy-mode 1)) - ;; better ivy autocompletion - (use-package ivy-rich - :init - (ivy-rich-mode 1)) + ;; better commands + (use-package counsel + :custon + (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only) + ) + ;; autocompletion on commands (?) + (use-package ivy + :diminish + :bind (("C-s" . swiper) + :map ivy-minibuffer-map + ("TAB" . ivy-alt-done) + ("C-l" . ivy-alt-done) + ("C-j" . ivy-next-line) + ("C-k" . ivy-previous-line) + :map ivy-switch-buffer-map + ("C-k" . ivy-previous-line) + ("C-l" . ivy-done) + ("C-d" . ivy-switch-buffer-kill) + :map ivy-reverse-i-search-map + ("C-k" . ivy-previous-line) + ("C-d" . ivy-reverse-i-search-kill)) + :demand + :config + (ivy-mode 1)) + ;; better ivy autocompletion + (use-package ivy-rich + :init + (ivy-rich-mode 1)) - ;; ivy in the middle - (use-package ivy-posframe - :init - (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-center))) - :config - (ivy-posframe-mode 1)) + ;; ivy in the middle + (use-package ivy-posframe + :init + (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-center))) + :config + (ivy-posframe-mode 1)) - ;; counsel M+X - (use-package counsel - :bind (("M-x" . counsel-M-x) - ("C-x b" . counsel-ibuffer) - ("C-x C-f" . counsel-find-file) - :map minibuffer-local-map - ("C-r" . 'counsel-minibuffer-history)) - :config - (setq ivy-inital-inputs-alist nil)) + ;; counsel M+X + (use-package counsel + :bind (("M-x" . counsel-M-x) + ("C-x b" . counsel-ibuffer) + ("C-x C-f" . counsel-find-file) + :map minibuffer-local-map + ("C-r" . 'counsel-minibuffer-history)) + :config + (setq ivy-inital-inputs-alist nil)) #+end_src ** Custom Themes #+begin_src emacs-lisp @@ -1314,113 +1316,117 @@ Aint no way bro ** EXWM RELEASE ME #+begin_src emacs-lisp - (when (eq system-type 'gnu/linux) - (display-battery-mode) - (use-package exwm - :config + (when (eq system-type 'gnu/linux) + (display-battery-mode) + (use-package exwm + :config - ;; background - (add-hook 'exwm-init-hook (lambda () - ;; background - (call-process-shell-command "feh --bg-fill ~/background.png" nil 0) - (call-process-shell-command "~/.config/polybar/startpolybar" nil 0) - (call-process-shell-command "~/.config/picom/startpicom" nil 0) - ;; startup - (call-process-shell-command "nm-applet" nil 0) - (call-process-shell-command "blueman-applet" nil 0) - (call-process-shell-command "nextcloud" nil 0) - (call-process-shell-command "bitwarden" nil 0) - (call-process-shell-command "flameshot" nil 0) - )) - ;; startup - ;; workspaces - (setq exwm-workspace-number 5) + ;; background + ;; todo turn this info a function + (add-hook 'exwm-init-hook (lambda () + ;; background + (call-process-shell-command "feh --bg-fill ~/background.png" nil 0) + (call-process-shell-command "~/.config/polybar/startpolybar" nil 0) + (call-process-shell-command "~/.config/picom/startpicom" nil 0) + ;; startup + (call-process-shell-command "nm-applet" nil 0) + (call-process-shell-command "blueman-applet" nil 0) + (call-process-shell-command "nextcloud" nil 0) + (call-process-shell-command "bitwarden" nil 0) + (call-process-shell-command "flameshot" nil 0) + )) + ;; startup + ;; workspaces + (setq exwm-workspace-number 5) - (require 'exwm-systemtray) - (exwm-systemtray-enable) + (require 'exwm-systemtray) + (exwm-systemtray-enable) - ;; polybar - (defvar sakomacs/polybar-process nil - "Holds the process of the running Polybar instance, if any") + ;; polybar + (defvar sakomacs/polybar-process nil + "Holds the process of the running Polybar instance, if any") - (server-start) + (server-start) - (defun sakomacs/kill-panel () - (interactive) - (when sakomacs/polybar-process - (ignore-errors - (kill-process sakomacs/polybar-process))) - (setq sakomacs/polybar-process nil)) + (defun sakomacs/kill-panel () + (interactive) + (when sakomacs/polybar-process + (ignore-errors + (kill-process sakomacs/polybar-process))) + (setq sakomacs/polybar-process nil)) - (defun sakomacs/start-panel () - (interactive) - (sakomacs/kill-panel) - (setq sakomacs/polybar-process (start-process-shell-command "polybar" nil "polybar panel"))) + (defun sakomacs/start-panel () + (interactive) + (sakomacs/kill-panel) + (setq sakomacs/polybar-process (start-process-shell-command "polybar" nil "polybar panel"))) - (defun sakomacs/send-polybar-hook (module-name hook-index) - (start-process-shell-command "polybar-msg" nil (format "polybar-msg hook %s %s" module-name hook-index))) + (defun sakomacs/send-polybar-hook (module-name hook-index) + (start-process-shell-command "polybar-msg" nil (format "polybar-msg hook %s %s" module-name hook-index))) - (defun sakomacs/send-polybar-exwm-workspace () - (sakomacs/send-polybar-hook "exwm-workspace" 1)) + (defun sakomacs/send-polybar-exwm-workspace () + (sakomacs/send-polybar-hook "exwm-workspace" 1)) - ;; Update panel indicator when workspace changes - (add-hook 'exwm-workspace-switch-hook #'sakomacs/send-polybar-exwm-workspace) + ;; Update panel indicator when workspace changes + (add-hook 'exwm-workspace-switch-hook #'sakomacs/send-polybar-exwm-workspace) - ;; 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 + ;; 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) + ;; Ctrl+Q will enable the next key to be sent directly + (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) + ;; app launcher and fullscreen + (exwm-input-set-key (kbd "s-SPC") 'counsel-linux-app) + (exwm-input-set-key (kbd "s-f") 'exwm-layout-toggle-fullscreen) + ;; 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) + ;; 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))) + ;; 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) + ;; 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)))) + ) + + (use-package desktop-environment + :after exwm + :config (desktop-environment-mode) + :custom + (desktop-environment-brightness-small-increment "2%+") + (desktop-environment-brightness-small-decrement "2%-") + (desktop-environment-brightness-normal-increment "5%+") + (desktop-environment-brightness-normal-decrement "5%-")) - ;; '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)))) ) - - (use-package desktop-environment - :after exwm - :config (desktop-environment-mode) - :custom - (desktop-environment-brightness-small-increment "2%+") - (desktop-environment-brightness-small-decrement "2%-") - (desktop-environment-brightness-normal-increment "5%+") - (desktop-environment-brightness-normal-decrement "5%-")) - - ) #+end_src * Org Mode Configuration Setup ** Babel Languages