Merge branch 'my-remote' into 'master'

Emacs EXWM Improvements, Modeline, Time, Input Passthrough etc.

See merge request bloxiebird/linux-emacs-configuration!5
This commit is contained in:
Curt Spark 2021-03-02 00:27:22 +00:00
commit ac7b78e415
2 changed files with 94 additions and 3 deletions

View File

@ -95,12 +95,28 @@ Old theme for if you'd like to follow Xresources
;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config))
#+END_SRC
*** Custom Modeline
A custom sleek modeline which is also used in Centaur Emacs, Doom Emacs and Spacemacs.
Install and set the modeline, ensuring that it is always installed:
#+BEGIN_SRC emacs-lisp
(use-package doom-modeline
:ensure t
:init (doom-modeline-mode 1))
;; Display the current time on the modeline
(display-time 1)
#+END_SRC
*** All The Icons
All The Icons is a package to display cool icons within Emacs.
Install the package, enable it and ensure that it always is installed:
#+BEGIN_SRC emacs-lisp
(use-package all-the-icons
:ensure t)
(setq inhibit-compacting-font-caches t) ; Dont compact font caches during GC. Fixes lag on doom modeline
#+END_SRC
All The Icons Support for Ivy/Counsel. Which are autocompletion tools in emacs
@ -184,9 +200,9 @@ Install the package, enable it and ensure that it always is installed:
A mode that is similiar in functionality to pop-up-frame, however much more granular in control and toggleable as it is mode. Will stop duplicate windows from creating new frames etc.
Using simpler solution instead:
#+BEGIN_SRC emacs-lisp
+BEGIN_SRC emacs-lisp
(setq pop-up-frames t)
#+END_SRC
+END_SRC
+BEGIN_SRC emacs-lisp
(defun which-active-modes ()
@ -587,3 +603,78 @@ on how to install the Programming Language Servers that you want.
:ensure t)
;; (use-package dap-LANGUAGE) to load the dap adapter for your language
#+END_SRC
** EXWM
EXWM, The Emacs X Window Manager. As it says, it is an Emacs window
manager for the X display server. The benefits include using all your
emacs functions and fuzzy searching in tangent with X windows.
For more information on setup, you should check out `https://github.com/ch11ng/exwm/wiki`
Install the package, enable it and ensure that it always is installed, and then configure:
*** EXWM
#+BEGIN_SRC emacs-lisp
(use-package exwm
:ensure t
:config
(require 'exwm-config)
(exwm-config-default))
#+END_SRC
**** Configuration
#+BEGIN_SRC emacs-lisp
;; Systemtray
(require 'exwm-systemtray)
(exwm-systemtray-enable)
;; Mouse input/bindings
(require 'exwm-input)
;; Keybindings
(setq exwm-input-global-keys
`(;; Reset EXWM
([?\s-r] . exwm-reset)
;; EXWM Workspace Switcher
([?\s-w] . exwm-workspace-switch)
,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) .
(lambda ()
(interactive)
(exwm-workspace-switch-create ,i))))
(number-sequence 0 9))
;; Switch between char and line mode mode switcher
;; Char mode allows for practically all keybindings to be passed to the application aside from a few essential keybindings, line mode allows for emacs keybindings
([?\s-i] . exwm-input-toggle-keyboard)
;; Application Launcher
([?\s-d] . counsel-linux-app)))
;; Set all windows to open in char mode by default, allowing to pass through all key combinations
;; (add-hook 'exwm-manage-finish-hook
;; (lambda () (call-interactively #'exwm-input-release-keyboard)
;; (exwm-layout-hide-mode-line)))
;; Ido mode seems to be enabled in the default configuration, turn it back off as we are using Ivy completion instead.
(ido-mode -1)
#+END_SRC
*** Counsel Linux Application
Counsel Linux Application is an application launcher for emacs using counsel (which is ivy).
Install the package, enable it and ensure that it always is installed, and then configure:
#+BEGIN_SRC emacs-lisp
;; some customization to make the display "nicer" and include any user local .desktop files
(push (concat (getenv "HOME") "/.local/share/applications/") counsel-linux-apps-directories)
(defun ds/counsel-linux-app-format-function (name comment exec)
"Default Linux application name formatter.
NAME is the name of the application, COMMENT its comment and EXEC
the command to launch it."
(format "% -45s %s"
(propertize name 'face 'font-lock-builtin-face)
(or comment "")))
(setq counsel-linux-app-format-function #'ds/counsel-linux-app-format-function)
#+END_SRC

View File

@ -1 +1 @@
("~/.emacs.d/")
("~/.emacs.d/" "~/.emacs.d/elpa/xelb-0.18/")