From 004b3f66d03e832dab6212f65355aff41ddc5083 Mon Sep 17 00:00:00 2001 From: Curt Spark Date: Tue, 14 Apr 2020 02:35:25 +0100 Subject: [PATCH] EXWM configuration --- config.org | 114 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 79 insertions(+), 35 deletions(-) diff --git a/config.org b/config.org index d0adf1e..b65cf5c 100644 --- a/config.org +++ b/config.org @@ -19,6 +19,13 @@ Welcome to my Emacs configuration! #+BEGIN_SRC emacs-lisp (scroll-bar-mode -1) #+END_SRC +*** Modern Fringes +#+BEGIN_SRC emacs-lisp + (use-package modern-fringes + :ensure t + :init + (modern-fringes-invert-arrows)) +#+END_SRC *** Theming #+BEGIN_SRC emacs-lisp (use-package dracula-theme @@ -40,31 +47,26 @@ All The Icons for Ivy/Counsel (all-the-icons-ivy-setup)) #+END_SRC *** Mode Line -Mode Line Configuration : +**** Spaceline #+BEGIN_SRC emacs-lisp - (setq telephone-line-lhs - '((evil . (telephone-line-evil-tag-segment)) - (accent . (telephone-line-vc-segment - telephone-line-erc-modified-channels-segment - telephone-line-process-segment)) - (nil . (telephone-line-buffer-segment)))) - (setq telephone-line-rhs - '((nil . (telephone-line-misc-info-segment)) - (accent . (telephone-line-major-mode-segment)) - (evil . (telephone-line-airline-position-segment)))) - - (setq telephone-line-primary-left-separator 'telephone-line-flat - telephone-line-secondary-left-separator 'telephone-line-flat - telephone-line-primary-right-separator 'telephone-line-flat - telephone-line-secondary-right-separator 'telephone-line-flat) - (setq telephone-line-height 20 - telephone-line-evil-use-short-tag t) -#+END_SRC -#+BEGIN_SRC emacs-lisp - (use-package telephone-line + (use-package spaceline :ensure t - :init - (telephone-line-mode)) + :config + (require 'spaceline-config) + (setq powerline-default-separator (quote arrow)) + (spaceline-spacemacs-theme)) +#+END_SRC + +Display the time on the Mode Line, this is more useful for EXWM. +#+BEGIN_SRC emacs-lisp + (setq display-time-default-load-average nil) + (display-time-mode t) +#+END_SRC +**** Diminish +With Diminish you can optionally remove some of the names of the modes in the Mode Line. +#+BEGIN_SRC emacs-lisp + (use-package diminish + :ensure t) #+END_SRC *** Emacs Dashboard Install the Emacs Dashboard : @@ -134,28 +136,70 @@ Emacs Dashboard Config : #+END_SRC ** EXWM Emacs X Window Manager -Add hashtag before + to enable -+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp (use-package exwm :ensure t :config (require 'exwm-config) (exwm-config-default)) -+END_SRC +#+END_SRC -Add hashtag before + to enable - -EXWM System Try -+BEGIN_SRC emacs-lisp +EXWM System Tray +#+BEGIN_SRC emacs-lisp (require 'exwm-systemtray) (exwm-systemtray-enable) -+END_SRC +#+END_SRC + +If not using EXWM, it will ask to replace the Window Manager with EXWM, I do not like this prompt when using Emacs on other Window Managers. +#+BEGIN_SRC emacs-lisp + (setq exwm-replace 'nil) +#+END_SRC + +Ido gets automatically enabled in the default EXWM configuration, as we're using Ivy. Let's disable it. +#+BEGIN_SRC emacs-lisp + (ido-mode -1) +#+END_SRC + +Set Number of Workspaces initially created. +#+BEGIN_SRC emacs-lisp + (setq exwm-workspace-number 10) +#+END_SRC EXWM Specific Keybindings -(global-set-key (kbd "s-e") 'evil-quit-all) -(global-set-key (kbd "s-k") 'exwm-workspace-move) -(global-set-key (kbd "s-w") 'exwm-workspace-swap) +#+BEGIN_SRC emacs-lisp + + ; Set whether workspaces wrap around or not. + (defvar exwm-workspace-switch-wrap t) + + (defun exwm/exwm-workspace-next () + "Switch to next exwm-workspace (to the right)." + (interactive) + (let* ((only-workspace? (equal exwm-workspace-number 1)) + (overflow? (= exwm-workspace-current-index (1- exwm-workspace-number)))) + (cond + (only-workspace? nil) + (overflow? (when exwm-workspace-switch-wrap + (exwm-workspace-switch 0))) + (t (exwm-workspace-switch (1+ exwm-workspace-current-index)))))) + + (defun exwm/exwm-workspace-prev () + "Switch to next exwm-workspace (to the left)." + (interactive) + (let* ((only-workspace? (equal exwm-workspace-number 1)) + (overflow? (= exwm-workspace-current-index 0))) + (cond + (only-workspace? nil) + (overflow? (when exwm-workspace-switch-wrap + (exwm-workspace-switch (1- exwm-workspace-number)))) + (t (exwm-workspace-switch (1- exwm-workspace-current-index)))))) + + (global-set-key (kbd "") 'exwm/exwm-workspace-next) + (global-set-key (kbd "") 'exwm/exwm-workspace-prev) + (global-set-key (kbd "s-e") 'evil-quit-all) + (global-set-key (kbd "s-k") 'exwm-workspace-move) + (global-set-key (kbd "s-w") 'exwm-workspace-swap) +#+END_SRC ** Dynamic Window Tiling *** Edwina Edwina is a dynamic window manager for Emacs. @@ -214,7 +258,7 @@ A recreation of the iconic Suckless Dynamic Menu. (use-package dmenu :ensure t :bind - ("s-f" . 'dmenu)) + ("s-d" . 'dmenu)) #+END_SRC ** Evil Mode #+BEGIN_SRC emacs-lisp