mirror of
https://github.com/SqrtMinusOne/sqrtminusone.github.io.git
synced 2025-12-10 15:53:03 +03:00
upd
This commit is contained in:
parent
7957ec52bc
commit
88ff4927f9
8 changed files with 2682 additions and 969 deletions
|
|
@ -99,8 +99,8 @@ fi
|
|||
Use Guix fontconfig. Necessary for nix apps
|
||||
|
||||
```sh
|
||||
if [ -d "$HOME/.guix-extra-profiles/desktop" ]; then
|
||||
export FONTCONFIG_PATH="$HOME/.guix-extra-profiles/desktop/desktop/etc/fonts"
|
||||
if [ -d "$HOME/.guix-extra-profiles/desktop-misc" ]; then
|
||||
export FONTCONFIG_PATH="$HOME/.guix-extra-profiles/desktop-misc/desktop-misc/etc/fonts"
|
||||
fi
|
||||
```
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -20,6 +20,22 @@ Parts prefixed with (OFF) are not used, but kept for historic purposes. For some
|
|||
- [Fonts](#fonts)
|
||||
- [Themes](#themes)
|
||||
- [Device-specific settings](#device-specific-settings)
|
||||
- [EXWM](#exwm)
|
||||
- [Xsession](#xsession)
|
||||
- [Startup apps](#startup-apps)
|
||||
- [Moving windows](#moving-windows)
|
||||
- [Resizing windows](#resizing-windows)
|
||||
- [App shortcuts](#app-shortcuts)
|
||||
- [Move workspace to another monitor](#move-workspace-to-another-monitor)
|
||||
- [Switch to the opposite monitor](#switch-to-the-opposite-monitor)
|
||||
- [Switching buffers](#switching-buffers)
|
||||
- [Add all EXWM buffers to current perspective](#add-all-exwm-buffers-to-current-perspective)
|
||||
- [Revive perspectives](#revive-perspectives)
|
||||
- [Locking up](#locking-up)
|
||||
- [Keybindings](#keybindings)
|
||||
- [Pinentry](#pinentry)
|
||||
- [Modeline](#modeline)
|
||||
- [EXWM config](#exwm-config)
|
||||
- [i3wm](#i3wm)
|
||||
- [General settings](#general-settings)
|
||||
- [Managing windows](#managing-windows)
|
||||
|
|
@ -50,6 +66,7 @@ Parts prefixed with (OFF) are not used, but kept for historic purposes. For some
|
|||
- [ipstack-vpn](#ipstack-vpn)
|
||||
- [weather](#weather)
|
||||
- [aw-afk](#aw-afk)
|
||||
- [pomm](#pomm)
|
||||
- [sun](#sun)
|
||||
- [SEP](#sep)
|
||||
- [TSEP](#tsep)
|
||||
|
|
@ -68,8 +85,8 @@ Parts prefixed with (OFF) are not used, but kept for historic purposes. For some
|
|||
- [Scripts](#scripts)
|
||||
- [Buku bookmarks](#buku-bookmarks)
|
||||
- [Man pages](#man-pages)
|
||||
- [Emojis](#emojis)
|
||||
- [pass](#pass)
|
||||
- [emojis](#emojis)
|
||||
- [Flameshot](#flameshot)
|
||||
- [dunst](#dunst)
|
||||
- [keynav](#keynav)
|
||||
|
|
@ -95,6 +112,7 @@ Parts prefixed with (OFF) are not used, but kept for historic purposes. For some
|
|||
- [ActivityWatch](#activitywatch)
|
||||
- [PulseEffects](#pulseeffects)
|
||||
- [xsettingsd](#xsettingsd)
|
||||
- [nm-applet](#nm-applet)
|
||||
- [Discord rich presence](#discord-rich-presence)
|
||||
- [Polkit Authentication agent](#polkit-authentication-agent)
|
||||
- [Xmodmap](#xmodmap)
|
||||
|
|
@ -251,6 +269,546 @@ fi
|
|||
```
|
||||
|
||||
|
||||
## EXWM {#exwm}
|
||||
|
||||
Settings for [Emacs X Window Manager](https://github.com/ch11ng/exwm), a tiling WM implemented in Emacs Lisp.
|
||||
|
||||
References:
|
||||
|
||||
- [EXWM Wiki](https://github.com/ch11ng/exwm/wiki)
|
||||
- [Emacs From Scratch config](https://github.com/daviwil/emacs-from-scratch/blob/master/Desktop.org)
|
||||
|
||||
|
||||
### Xsession {#xsession}
|
||||
|
||||
First things first, Emacs has to be launched as a window manager. On a more conventional system, I'd create a .desktop file in some system folder that can be seen by a login manager, but in the case of Guix, it's a bit more complicated, because all such folders are not meant to be changed manually.
|
||||
|
||||
However, GDM, the login manager that seems to default on Guix, launches `~/.xsession` on the startup if it's present, which is just fine for my purposes.
|
||||
|
||||
```sh
|
||||
# Source .profile
|
||||
. ~/.profile
|
||||
|
||||
# Disable access control for the current user
|
||||
xhost +SI:localuser:$USER
|
||||
|
||||
# Fix for Java applications
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
|
||||
# Apply XResourses
|
||||
xrdb -merge ~/.Xresources
|
||||
|
||||
# Turn off the system bell
|
||||
xset -b
|
||||
|
||||
# Use i3lock as a screen locker
|
||||
xss-lock -- i3lock &
|
||||
|
||||
# Some apps that have to be launched only once.
|
||||
picom &
|
||||
# nm-applet &
|
||||
dunst &
|
||||
copyq &
|
||||
|
||||
# Run the Emacs startup script as a session.
|
||||
# exec dbus-launch --exit-with-session ~/.emacs.d/run-exwm.sh
|
||||
exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.emacs.d/desktop.el
|
||||
```
|
||||
|
||||
|
||||
### Startup apps {#startup-apps}
|
||||
|
||||
Now that Emacs is launched, it is necessary to set up the EXWM-specific parts of config.
|
||||
|
||||
I want to launch some apps from EXWM instead of the Xsession file for two purposes:
|
||||
|
||||
- the app may need to have the entire desktop environment set up
|
||||
- or it may need to be restarted if Emacs is killed.
|
||||
|
||||
As of now, these are polybar, feh and, shepherd:
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/exwm-run-polybar ()
|
||||
(call-process "~/bin/polybar.sh"))
|
||||
|
||||
(defun my/exwm-set-wallpaper ()
|
||||
(call-process-shell-command "feh --bg-fill ~/Pictures/wallpaper.jpg"))
|
||||
|
||||
(defun my/exwm-run-shepherd ()
|
||||
(when (string-empty-p (shell-command-to-string "pgrep -u pavel shepherd"))
|
||||
(call-process "shepherd")))
|
||||
```
|
||||
|
||||
|
||||
### Moving windows {#moving-windows}
|
||||
|
||||
My functions for managing windows. I initially wrote these to mimic the i3 behavior for my Emacs + i3 integration, but I want to try to keep them for the EXWM config as well to make the transition less painful.
|
||||
|
||||
A predicate which checks whether there is space in the given direction:
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/exwm-direction-exists-p (dir)
|
||||
(cl-some (lambda (dir)
|
||||
(let ((win (windmove-find-other-window dir)))
|
||||
(and win (not (window-minibuffer-p win)))))
|
||||
(pcase dir
|
||||
('width '(left right))
|
||||
('height '(up down)))))
|
||||
```
|
||||
|
||||
And a function to move windows with the following behavior:
|
||||
|
||||
- if there is space in the required direction, move the Emacs window there;
|
||||
- if there is no space in the required direction, but space in two orthogonal directions, move the Emacs window so that there is no more space in the orthogonal directions;
|
||||
|
||||
<!--listend-->
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/exwm-move-window (dir)
|
||||
(let ((other-window (windmove-find-other-window dir))
|
||||
(other-direction (my/exwm-direction-exists-p
|
||||
(pcase dir
|
||||
('up 'width)
|
||||
('down 'width)
|
||||
('left 'height)
|
||||
('right 'height)))))
|
||||
(cond
|
||||
((and other-window (not (window-minibuffer-p other-window)))
|
||||
(window-swap-states (selected-window) other-window))
|
||||
(other-direction
|
||||
(evil-move-window dir)))))
|
||||
```
|
||||
|
||||
|
||||
### Resizing windows {#resizing-windows}
|
||||
|
||||
Something like this also goes for resizing windows. I'm used to the i3 "mode" for this functionality, and this seems to be a sensible approach.
|
||||
|
||||
```emacs-lisp
|
||||
(use-package transient
|
||||
:straight t)
|
||||
|
||||
(setq my/exwm-resize-value 5)
|
||||
|
||||
(defun my/exwm-resize-window (dir kind &optional value)
|
||||
(unless value
|
||||
(setq value my/exwm-resize-value))
|
||||
(pcase kind
|
||||
('shrink
|
||||
(pcase dir
|
||||
('width
|
||||
(evil-window-decrease-width value))
|
||||
('height
|
||||
(evil-window-decrease-height value))))
|
||||
('grow
|
||||
(pcase dir
|
||||
('width
|
||||
(evil-window-increase-width value))
|
||||
('height
|
||||
(evil-window-increase-height value))))))
|
||||
|
||||
(defhydra my/exwm-resize-hydra (:color pink :hint nil :foreign-keys run)
|
||||
"
|
||||
^Resize^
|
||||
_l_: Increase width _h_: Decrease width _j_: Increase height _k_: Decrease height
|
||||
|
||||
_=_: Balance "
|
||||
("h" (lambda () (interactive) (my/exwm-resize-window 'width 'shrink)))
|
||||
("j" (lambda () (interactive) (my/exwm-resize-window 'height 'grow)))
|
||||
("k" (lambda () (interactive) (my/exwm-resize-window 'height 'shrink)))
|
||||
("l" (lambda () (interactive) (my/exwm-resize-window 'width 'grow)))
|
||||
("=" balance-windows)
|
||||
("q" nil "quit" :color blue))
|
||||
```
|
||||
|
||||
|
||||
### App shortcuts {#app-shortcuts}
|
||||
|
||||
Also, a transient for shortcuts for the most frequent apps.
|
||||
|
||||
I wanted to make the interactive lambda a macro, but this doesn't seem to work the way I expect, so the code has a bit of duplication.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/run-in-background (command)
|
||||
(let ((command-parts (split-string command "[ ]+")))
|
||||
(apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
|
||||
|
||||
(transient-define-prefix my/exwm-apps ()
|
||||
["Apps"
|
||||
("t" "Termnial (Alacritty)" (lambda () (interactive) (my/run-in-background "alacritty")))
|
||||
("b" "Browser (Firefox)" (lambda () (interactive) (my/run-in-background "firefox")))
|
||||
("v" "VK" (lambda () (interactive) (my/run-in-background "vk")))
|
||||
("s" "Slack" (lambda () (interactive) (my/run-in-background "slack-wrapper")))
|
||||
("d" "Discord" (lambda () (interactive) (my/run-in-background "flatpak run com.discordapp.Discord")))
|
||||
("q" "Quit" transient-quit-one)])
|
||||
```
|
||||
|
||||
|
||||
### Move workspace to another monitor {#move-workspace-to-another-monitor}
|
||||
|
||||
A function to move the current workspace to another monitor.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/exwm-workspace-switch-monitor ()
|
||||
(interactive)
|
||||
(if (plist-get exwm-randr-workspace-monitor-plist exwm-workspace-current-index)
|
||||
(setq exwm-randr-workspace-monitor-plist
|
||||
(map-delete exwm-randr-workspace-monitor-plist exwm-workspace-current-index))
|
||||
(setq exwm-randr-workspace-monitor-plist
|
||||
(plist-put exwm-randr-workspace-monitor-plist
|
||||
exwm-workspace-current-index
|
||||
my/exwm-another-monitor)))
|
||||
(exwm-randr-refresh))
|
||||
```
|
||||
|
||||
|
||||
### Switch to the opposite monitor {#switch-to-the-opposite-monitor}
|
||||
|
||||
Store the information about which workspace is available on which monitor.
|
||||
|
||||
```emacs-lisp
|
||||
(setq my/exwm-monitor-workspace '())
|
||||
|
||||
(defun my/exwm-get-current-monitor ()
|
||||
(let* ((info (shell-command-to-string "xdotool getmouselocation --shell | head -n 1"))
|
||||
(coord (string-to-number (substring info 2))))
|
||||
(if (> coord 1920) 1 0)))
|
||||
|
||||
(defun my/exwm-update-current-monitor ()
|
||||
(setf (alist-get (my/exwm-get-current-monitor) my/exwm-monitor-workspace)
|
||||
exwm-workspace-current-index))
|
||||
|
||||
(add-hook 'exwm-workspace-switch-hook
|
||||
#'my/exwm-update-current-monitor)
|
||||
```
|
||||
|
||||
Switch to the opposite monitor.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/exwm-switch-to-other-monitor ()
|
||||
(interactive)
|
||||
(let* ((current (my/exwm-get-current-monitor))
|
||||
(other (seq-some
|
||||
(lambda (m)
|
||||
(and (not (= (car m) current)) (cdr m)))
|
||||
my/exwm-monitor-workspace)))
|
||||
(exwm-workspace-switch other)))
|
||||
```
|
||||
|
||||
|
||||
### Switching buffers {#switching-buffers}
|
||||
|
||||
A single perspective usually has only a handful of EXWM buffers, so here is a function to cycle them.
|
||||
|
||||
Those buffers that are visible in another window are highlighted blue and skipped. The current buffer is highlighted yellow.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/cycle-persp-exwm-buffers (dir)
|
||||
(let* ((current (current-buffer))
|
||||
(ignore-rx (persp--make-ignore-buffer-rx))
|
||||
(visible-buffers '())
|
||||
(exwm-data
|
||||
(cl-loop for buf in (persp-current-buffers)
|
||||
for is-another = (and (get-buffer-window buf) (not (eq current buf)))
|
||||
if (and (buffer-live-p buf)
|
||||
(eq 'exwm-mode (buffer-local-value 'major-mode buf))
|
||||
(not (string-match-p ignore-rx (buffer-name buf))))
|
||||
collect buf into all-buffers
|
||||
and if (not is-another) collect buf into cycle-buffers
|
||||
finally (return (list all-buffers cycle-buffers))))
|
||||
(all-buffers (nth 0 exwm-data))
|
||||
(cycle-buffers (nth 1 exwm-data))
|
||||
(current-pos (or (cl-position current cycle-buffers) -1)))
|
||||
(if (seq-empty-p cycle-buffers)
|
||||
(message "No EXWM buffers to cycle!")
|
||||
(let* ((next-pos (% (+ current-pos (length cycle-buffers)
|
||||
(if (eq dir 'forward) 1 -1))
|
||||
(length cycle-buffers)))
|
||||
(next-buffer (nth next-pos cycle-buffers)))
|
||||
(switch-to-buffer next-buffer)
|
||||
(message
|
||||
"%s"
|
||||
(mapconcat
|
||||
(lambda (buf)
|
||||
(let ((name (string-replace "EXWM :: " "" (buffer-name buf))))
|
||||
(cond
|
||||
((eq (current-buffer) buf)
|
||||
(concat
|
||||
"["
|
||||
(propertize name 'face `(foreground-color . ,(doom-color 'yellow)))
|
||||
"]"))
|
||||
((not (member buf cycle-buffers))
|
||||
(concat
|
||||
"["
|
||||
(propertize name 'face `(foreground-color . ,(doom-color 'blue)))
|
||||
"]"))
|
||||
(t (format " %s " name)))))
|
||||
all-buffers
|
||||
" "))))))
|
||||
```
|
||||
|
||||
|
||||
### Add all EXWM buffers to current perspective {#add-all-exwm-buffers-to-current-perspective}
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/add-exwm-buffers-to-current-perspective ()
|
||||
(interactive)
|
||||
(let ((ignore-rx (persp--make-ignore-buffer-rx)))
|
||||
(cl-loop for buf in (buffer-list)
|
||||
if (and (buffer-live-p buf)
|
||||
(eq 'exwm-mode (buffer-local-value 'major-mode buf))
|
||||
(not (string-match-p ignore-rx (buffer-name buf))))
|
||||
do (persp-add-buffer (buffer-name buf)))))
|
||||
```
|
||||
|
||||
|
||||
### Revive perspectives {#revive-perspectives}
|
||||
|
||||
Occasionally the current perspective gets screwed up after a popup. This function attempts to fix it.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/exwm-revive-perspectives ()
|
||||
"Make perspectives in the current frame not killed."
|
||||
(interactive)
|
||||
(let ((to-switch nil))
|
||||
(maphash
|
||||
(lambda (_ v)
|
||||
(setf (persp-killed v) nil)
|
||||
(unless to-switch
|
||||
(setq to-switch v)))
|
||||
(frame-parameter nil 'persp--hash))
|
||||
(when to-switch
|
||||
(persp-switch (persp-name to-switch)))))
|
||||
```
|
||||
|
||||
|
||||
### Locking up {#locking-up}
|
||||
|
||||
Run i3lock.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/exwm-lock ()
|
||||
(interactive)
|
||||
(my/run-in-background "i3lock -f -i /home/pavel/Pictures/lock-wallpaper.png"))
|
||||
```
|
||||
|
||||
|
||||
### Keybindings {#keybindings}
|
||||
|
||||
Setting keybindings for EXWM. This actually has to be in the `:config` block of the `use-package` form, that is it has to be run after EXWM is loaded, so I use noweb to put this block in the correct place.
|
||||
|
||||
First, some prefixes for keybindings that are always passed to EXWM instead of the X application in `line-mode`:
|
||||
|
||||
```emacs-lisp
|
||||
(setq exwm-input-prefix-keys
|
||||
`(?\C-x
|
||||
?\C-w
|
||||
?\M-x
|
||||
?\M-u))
|
||||
```
|
||||
|
||||
Also other local keybindings, that are also available only in `line-mode`:
|
||||
|
||||
```emacs-lisp
|
||||
(defmacro my/app-command (command)
|
||||
`(lambda () (interactive) (my/run-in-background ,command)))
|
||||
|
||||
(general-define-key
|
||||
:keymaps '(exwm-mode-map)
|
||||
"C-q" 'exwm-input-send-next-key
|
||||
"<print>" (my/app-command "flameshot gui")
|
||||
"M-x" 'counsel-M-x
|
||||
"M-SPC" (general-key "SPC"))
|
||||
```
|
||||
|
||||
Simulation keys.
|
||||
|
||||
```emacs-lisp
|
||||
(setq exwm-input-simulation-keys `((,(kbd "M-w") . ,(kbd "C-w"))
|
||||
(,(kbd "M-c") . ,(kbd "C-c"))))
|
||||
```
|
||||
|
||||
And keybindings that are available in both `char-mode` and `line-mode`:
|
||||
|
||||
```emacs-lisp
|
||||
(setq exwm-input-global-keys
|
||||
`(
|
||||
;; Reset to line-mode
|
||||
(,(kbd "s-R") . exwm-reset)
|
||||
|
||||
;; Switch windows
|
||||
(,(kbd "s-<left>"). windmove-left)
|
||||
(,(kbd "s-<right>") . windmove-right)
|
||||
(,(kbd "s-<up>") . windmove-up)
|
||||
(,(kbd "s-<down>") . windmove-down)
|
||||
|
||||
(,(kbd "s-h"). windmove-left)
|
||||
(,(kbd "s-l") . windmove-right)
|
||||
(,(kbd "s-k") . windmove-up)
|
||||
(,(kbd "s-j") . windmove-down)
|
||||
|
||||
;; Moving windows
|
||||
(,(kbd "s-H") . (lambda () (interactive) (my/exwm-move-window 'left)))
|
||||
(,(kbd "s-L") . (lambda () (interactive) (my/exwm-move-window 'right)))
|
||||
(,(kbd "s-K") . (lambda () (interactive) (my/exwm-move-window 'up)))
|
||||
(,(kbd "s-J") . (lambda () (interactive) (my/exwm-move-window 'down)))
|
||||
|
||||
;; Fullscreen
|
||||
(,(kbd "s-f") . exwm-layout-toggle-fullscreen)
|
||||
|
||||
;; Quit
|
||||
(,(kbd "s-Q") . evil-quit)
|
||||
|
||||
;; Split windows
|
||||
(,(kbd "s-s") . evil-window-vsplit)
|
||||
(,(kbd "s-v") . evil-window-hsplit)
|
||||
|
||||
;; Switch perspectives
|
||||
(,(kbd "s-,") . persp-prev)
|
||||
(,(kbd "s-.") . persp-next)
|
||||
|
||||
;; Switch buffers
|
||||
(,(kbd "s-e") . persp-ivy-switch-buffer)
|
||||
|
||||
;; Resize windows
|
||||
(,(kbd "s-r") . my/exwm-resize-hydra/body)
|
||||
|
||||
;; Apps & stuff
|
||||
(,(kbd "s-p") . ,(my/app-command "rofi -modi drun,run -show drun"))
|
||||
(,(kbd "s-;") . my/exwm-apps)
|
||||
(,(kbd "s--") . ,(my/app-command "rofi-pass"))
|
||||
(,(kbd "s-=") . ,(my/app-command "rofimoji"))
|
||||
|
||||
;; Basic controls
|
||||
(,(kbd "<XF86AudioRaiseVolume>") . ,(my/app-command "ponymix increase 5 --max-volume 150"))
|
||||
(,(kbd "<XF86AudioLowerVolume>") . ,(my/app-command "ponymix decrease 5 --max-volume 150"))
|
||||
(,(kbd "<XF86AudioMute>") . ,(my/app-command "ponymix toggle"))
|
||||
|
||||
(,(kbd "<XF86AudioPlay>") . ,(my/app-command "mpc toggle"))
|
||||
(,(kbd "<XF86AudioPause>") . ,(my/app-command "mpc pause"))
|
||||
(,(kbd "<print>") . ,(my/app-command "flameshot gui"))
|
||||
|
||||
;; Switch workspace
|
||||
(,(kbd "s-q") . my/exwm-switch-to-other-monitor)
|
||||
(,(kbd "s-w") . exwm-workspace-switch)
|
||||
(,(kbd "s-W") . exwm-workspace-move-window)
|
||||
(,(kbd "s-<tab>") . my/exwm-workspace-switch-monitor)
|
||||
|
||||
;; Cycle EXWM windows in the current perspective
|
||||
(,(kbd "s-[") . (lambda () (interactive) (my/cycle-persp-exwm-buffers 'backward)))
|
||||
(,(kbd "s-]") . (lambda () (interactive) (my/cycle-persp-exwm-buffers 'forward)))
|
||||
(,(kbd "s-o") . ,(my/app-command "rofi -show window"))
|
||||
|
||||
;; '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))))
|
||||
```
|
||||
|
||||
|
||||
### Pinentry {#pinentry}
|
||||
|
||||
The GUI pinentry doesn't work too well with EXWM because of issues with popup windows, so we will use the Emacs one.
|
||||
|
||||
```emacs-lisp
|
||||
(use-package pinentry
|
||||
:straight t
|
||||
:after (exwm)
|
||||
:config
|
||||
(setenv "GPG_AGENT_INFO" nil) ;; use emacs pinentry
|
||||
(setq auth-source-debug t)
|
||||
|
||||
(setq epg-gpg-program "gpg2") ;; not necessary
|
||||
(require 'epa-file)
|
||||
(epa-file-enable)
|
||||
(setq epa-pinentry-mode 'loopback)
|
||||
(setq epg-pinentry-mode 'loopback)
|
||||
(pinentry-start)
|
||||
(my/run-in-background "gpgconf --reload gpg-agent"))
|
||||
```
|
||||
|
||||
```vim
|
||||
default-cache-ttl 3600
|
||||
max-cache-ttl 3600
|
||||
allow-emacs-pinentry
|
||||
allow-loopback-pinentry
|
||||
```
|
||||
|
||||
|
||||
### Modeline {#modeline}
|
||||
|
||||
Show current workspace in the modeline.
|
||||
|
||||
```emacs-lisp
|
||||
(defvar my/exwm-mode-line-info "")
|
||||
|
||||
(add-to-list 'mode-line-misc-info
|
||||
'(:eval my/exwm-mode-line-info))
|
||||
|
||||
(defun my/exwm-mode-line-info-update ()
|
||||
(setq my/exwm-mode-line-info
|
||||
(concat
|
||||
"["
|
||||
(propertize (funcall exwm-workspace-index-map exwm-workspace-current-index)
|
||||
'face
|
||||
`(foreground-color . ,(doom-color 'yellow)))
|
||||
"]"))
|
||||
(force-mode-line-update))
|
||||
|
||||
(add-hook 'exwm-workspace-switch-hook #'my/exwm-mode-line-info-update)
|
||||
```
|
||||
|
||||
|
||||
### EXWM config {#exwm-config}
|
||||
|
||||
And the EXWM config itself.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/exwm-init ()
|
||||
(exwm-workspace-switch 1)
|
||||
|
||||
(my/exwm-run-polybar)
|
||||
(my/exwm-set-wallpaper)
|
||||
(my/exwm-run-shepherd)
|
||||
;; (with-eval-after-load 'perspective
|
||||
;; (my/exwm-setup-perspectives))
|
||||
)
|
||||
|
||||
(defun my/exwm-update-class ()
|
||||
(exwm-workspace-rename-buffer (format "EXWM :: %s" exwm-class-name)))
|
||||
|
||||
(use-package exwm
|
||||
:straight t
|
||||
:config
|
||||
(setq exwm-workspace-number 5)
|
||||
(add-hook 'exwm-init-hook #'my/exwm-init)
|
||||
(add-hook 'exwm-update-class-hook #'my/exwm-update-class)
|
||||
|
||||
(require 'exwm-randr)
|
||||
(exwm-randr-enable)
|
||||
(start-process-shell-command "xrandr" nil "~/bin/scripts/screen-layout")
|
||||
(when (string= (system-name) "indigo")
|
||||
(setq my/exwm-another-monitor "DVI-D-0")
|
||||
(setq exwm-randr-workspace-monitor-plist `(2 ,my/exwm-another-monitor 3 ,my/exwm-another-monitor)))
|
||||
|
||||
(setq exwm-workspace-warp-cursor t)
|
||||
(setq mouse-autoselect-window t)
|
||||
(setq focus-follows-mouse t)
|
||||
|
||||
<<exwm-monitor-config>>
|
||||
<<exwm-keybindings>>
|
||||
<<exwm-mode-line-config>>
|
||||
|
||||
(set-frame-parameter (selected-frame) 'alpha '(90 . 90))
|
||||
(add-to-list 'default-frame-alist '(alpha . (90 . 90)))
|
||||
|
||||
(exwm-enable))
|
||||
```
|
||||
|
||||
|
||||
## i3wm {#i3wm}
|
||||
|
||||
| Guix dependency | Disabled |
|
||||
|
|
@ -688,7 +1246,8 @@ Keybindings to launch [rofi](https://github.com/davatorium/rofi). For more detai
|
|||
```vim
|
||||
bindsym $mod+d exec "rofi -modi 'drun,run' -show drun"
|
||||
bindsym $mod+b exec --no-startup-id rofi-buku-mine
|
||||
bindsym $mod+minus exec rofi-pass; mode default
|
||||
bindsym $mod+minus exec rofi-pass
|
||||
bindsym $mod+equal exec rofimoji
|
||||
|
||||
bindsym $mod+apostrophe mode "rofi"
|
||||
|
||||
|
|
@ -894,9 +1453,9 @@ exec "xmodmap ~/.Xmodmap"
|
|||
|
||||
## Polybar {#polybar}
|
||||
|
||||
| Guix dependency | Description |
|
||||
|-----------------|-------------|
|
||||
| polybar | statusbar |
|
||||
| Category | Guix dependency | Description |
|
||||
|-----------------|-----------------|-------------|
|
||||
| desktop-polybar | polybar | statusbar |
|
||||
|
||||
[Polybar](https://github.com/polybar/polybar) is a nice-looking, WM-agnostic statusbar program.
|
||||
|
||||
|
|
@ -956,13 +1515,13 @@ declare -A BLOCKS=(
|
|||
["eDP"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP battery SEP sun aw-afk date TSEP"
|
||||
["eDP-1"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP battery SEP sun aw-afk date TSEP"
|
||||
["DVI-D-0"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP"
|
||||
["HDMI-A-0"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP sun aw-afk date TSEP"
|
||||
["HDMI-A-0"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP weather SEP pomm sun aw-afk date TSEP"
|
||||
)
|
||||
|
||||
# Geolocation for some modules
|
||||
export LOC="SPB"
|
||||
|
||||
export IPSTACK_API_KEY=$(pass show My_Online/APIs/ipstack | head -n 1)
|
||||
# export IPSTACK_API_KEY=$(pass show My_Online/APIs/ipstack | head -n 1)
|
||||
|
||||
pkill polybar
|
||||
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||
|
|
@ -1090,11 +1649,11 @@ If you want to copy something, you can go to the [bin/polybar](bin/polybar/) fol
|
|||
|
||||
#### ipstack-vpn {#ipstack-vpn}
|
||||
|
||||
| Guix dependency | Description |
|
||||
|-----------------|-------------------------|
|
||||
| bind:utils | Provides dig |
|
||||
| curl | |
|
||||
| jq | util to work with JSONs |
|
||||
| Category | Guix dependency | Description |
|
||||
|-----------------|-----------------|-------------------------|
|
||||
| desktop-polybar | bind:utils | Provides dig |
|
||||
| desktop-polybar | curl | |
|
||||
| desktop-polybar | jq | util to work with JSONs |
|
||||
|
||||
A module to get a country of the current IP and openvpn status. Uses [ipstack](https://ipstack.com/) API.
|
||||
|
||||
|
|
@ -1164,9 +1723,9 @@ interval = 1200
|
|||
|
||||
Prints out a current uptime and non-AFK time from [ActivityWatch](https://github.com/ActivityWatch) server
|
||||
|
||||
| Guix dependency |
|
||||
|-----------------|
|
||||
| dateutils |
|
||||
| Category | Guix dependency |
|
||||
|-----------------|-----------------|
|
||||
| desktop-polybar | dateutils |
|
||||
|
||||
```bash
|
||||
afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_$(hostname)/events?limit=1" -H "accept: application/json")
|
||||
|
|
@ -1190,11 +1749,30 @@ interval = 60
|
|||
```
|
||||
|
||||
|
||||
#### pomm {#pomm}
|
||||
|
||||
Pomodoro module.
|
||||
|
||||
```bash
|
||||
if ps -e | grep emacs >> /dev/null; then
|
||||
emacsclient --eval "(if (boundp 'pomm-current-mode-line-string) pomm-current-mode-line-string \"\") " | xargs echo -e
|
||||
fi
|
||||
```
|
||||
|
||||
```ini
|
||||
[module/pomm]
|
||||
type = custom/script
|
||||
exec = /home/pavel/bin/polybar/pomm.sh
|
||||
interval = 1
|
||||
format-underline = ${colors.green-lighter}
|
||||
```
|
||||
|
||||
|
||||
#### sun {#sun}
|
||||
|
||||
| Guix dependency |
|
||||
|-----------------|
|
||||
| sunwait |
|
||||
| Category | Guix dependency |
|
||||
|-----------------|-----------------|
|
||||
| desktop-polybar | sunwait |
|
||||
|
||||
Prints out the time of sunrise/sunset. Uses [sunwait](https://github.com/risacher/sunwait)
|
||||
|
||||
|
|
@ -1520,9 +2098,9 @@ ramp-capacity-4 =
|
|||
|
||||
## Rofi {#rofi}
|
||||
|
||||
| Guix dependency |
|
||||
|-----------------|
|
||||
| rofi |
|
||||
| Category | Guix dependency |
|
||||
|--------------|-----------------|
|
||||
| desktop-rofi | rofi |
|
||||
|
||||
[rofi](https://github.com/davatorium/rofi) is another dynamic menu generator. It can act as dmenu replacement but offers a superset of dmenu's features.
|
||||
|
||||
|
|
@ -1741,12 +2319,19 @@ fi
|
|||
```
|
||||
|
||||
|
||||
#### Emojis {#emojis}
|
||||
|
||||
| Category | Guix dependency |
|
||||
|--------------|-----------------|
|
||||
| desktop-rofi | python-rofimoji |
|
||||
|
||||
|
||||
#### pass {#pass}
|
||||
|
||||
| Guix dependency |
|
||||
|-----------------|
|
||||
| rofi-pass |
|
||||
| xset |
|
||||
| Category | Guix dependency |
|
||||
|--------------|-----------------|
|
||||
| desktop-rofi | rofi-pass |
|
||||
| desktop-rofi | xset |
|
||||
|
||||
A nice [pass frontend for Rofi](https://github.com/carnager/rofi-pass), which is even packaged for Guix.
|
||||
|
||||
|
|
@ -1758,13 +2343,6 @@ clip=both
|
|||
```
|
||||
|
||||
|
||||
#### emojis {#emojis}
|
||||
|
||||
| Guix dependency |
|
||||
|-----------------|
|
||||
| rofi-emoji |
|
||||
|
||||
|
||||
## Flameshot {#flameshot}
|
||||
|
||||
| Guix dependency |
|
||||
|
|
@ -2331,12 +2909,12 @@ wintypes:
|
|||
|
||||
## Zathura {#zathura}
|
||||
|
||||
| Guix dependency |
|
||||
|---------------------|
|
||||
| zathura |
|
||||
| zathura-ps |
|
||||
| zathura-pdf-poppler |
|
||||
| zathura-djvu |
|
||||
| Category | Guix dependency |
|
||||
|----------|-------------------|
|
||||
| office | zathura |
|
||||
| office | zathura-ps |
|
||||
| office | zathura-pdf-mupdf |
|
||||
| office | zathura-djvu |
|
||||
|
||||
[Zathura](https://pwmt.org/projects/zathura/) is a pdf viewer with vim-like keybindings. One of my favorite features is an ability to invert the document colors.
|
||||
|
||||
|
|
@ -2352,6 +2930,26 @@ map <C-r> set recolor false
|
|||
map <C-R> set recolor true
|
||||
```
|
||||
|
||||
For some reason zathura doesn't pick up the plugin directory, so I make a wrapper that sets the directory up:
|
||||
|
||||
```bash
|
||||
zathura -p ~/.guix-extra-profiles/office/office/lib/zathura $@
|
||||
```
|
||||
|
||||
```conf-desktop
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=Zathura
|
||||
Exec=/home/pavel/bin/zathura-wrapper %U
|
||||
```
|
||||
|
||||
Add the following like to the `mimeapps.list`
|
||||
|
||||
```text
|
||||
application/pdf=zathura-wrapper.desktop
|
||||
```
|
||||
|
||||
|
||||
## Various software {#various-software}
|
||||
|
||||
|
|
@ -2459,6 +3057,30 @@ LaTeX
|
|||
<<packages("latex")>>))
|
||||
```
|
||||
|
||||
Desktop Misc
|
||||
|
||||
```scheme
|
||||
(specifications->manifest
|
||||
'(
|
||||
<<packages("desktop-misc")>>))
|
||||
```
|
||||
|
||||
Desktop polybar
|
||||
|
||||
```scheme
|
||||
(specifications->manifest
|
||||
'(
|
||||
<<packages("desktop-polybar")>>))
|
||||
```
|
||||
|
||||
Desktop rofi
|
||||
|
||||
```scheme
|
||||
(specifications->manifest
|
||||
'(
|
||||
<<packages("desktop-rofi")>>))
|
||||
```
|
||||
|
||||
|
||||
### Flatpak {#flatpak}
|
||||
|
||||
|
|
@ -2661,6 +3283,18 @@ aw-watcher-window
|
|||
```
|
||||
|
||||
|
||||
### nm-applet {#nm-applet}
|
||||
|
||||
```scheme
|
||||
(define nm-applet
|
||||
(make <service>
|
||||
#:provides '(nm-applet)
|
||||
#:respawn? #t
|
||||
#:start (make-forkexec-constructor '("nm-applet"))
|
||||
#:stop (make-kill-destructor)))
|
||||
```
|
||||
|
||||
|
||||
### Discord rich presence {#discord-rich-presence}
|
||||
|
||||
References:
|
||||
|
|
@ -2687,7 +3321,7 @@ Launch an authentication agent. Necessary for stuff like `pkexec`. I suspect I'm
|
|||
(make <service>
|
||||
#:provides '(polkit-gnome)
|
||||
#:respawn? #t
|
||||
#:start (make-forkexec-constructor '("/home/pavel/.guix-extra-profiles/desktop/desktop/libexec/polkit-gnome-authentication-agent-1"))
|
||||
#:start (make-forkexec-constructor '("/home/pavel/.guix-extra-profiles/desktop-misc/desktop-misc/libexec/polkit-gnome-authentication-agent-1"))
|
||||
#:stop (make-kill-destructor)))
|
||||
```
|
||||
|
||||
|
|
@ -2747,7 +3381,8 @@ Register services
|
|||
polkit-gnome
|
||||
vpn
|
||||
davmail
|
||||
xmodmap)
|
||||
xmodmap
|
||||
nm-applet)
|
||||
```
|
||||
|
||||
Daemonize shepherd
|
||||
|
|
@ -2759,7 +3394,7 @@ Daemonize shepherd
|
|||
Run services
|
||||
|
||||
```scheme
|
||||
(for-each start '(mpd mpd-watcher mcron aw-server aw-watcher-afk aw-watcher-window pulseeffects xsettingsd discord-rich-presence polkit-gnome davmail xmodmap))
|
||||
(for-each start '(mpd mpd-watcher mcron aw-server aw-watcher-afk aw-watcher-window pulseeffects xsettingsd discord-rich-presence polkit-gnome davmail xmodmap nm-applet))
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -2774,29 +3409,28 @@ Run services
|
|||
|
||||
Other desktop programs I use are listed below.
|
||||
|
||||
| Guix dependency | Description |
|
||||
|------------------------|-------------------------------------------|
|
||||
| xprop | Tool to display properties of X windows |
|
||||
| arandr | GUI to xrandr |
|
||||
| light | Control screen brightness |
|
||||
| ponymix | Control PulseAudio CLI |
|
||||
| pavucontrol | Control PulseAudio GUI |
|
||||
| network-manager-applet | Applet to manage network connections |
|
||||
| feh | Image viewer. Used to set background |
|
||||
| copyq | Clipboard manager |
|
||||
| xmodmap | Program to modify keybindings on X server |
|
||||
| thunar | My preferred GUI file manager |
|
||||
| keepassxc | My preferred password manager |
|
||||
| telegram-desktop | telegram client |
|
||||
| xdg-utils | gives xdg-open and stuff |
|
||||
| gnome-font-viewer | view fonts |
|
||||
| qbittorrent | torrent client |
|
||||
| fontconfig | |
|
||||
| polkit-gnome | Polkit authentication agent |
|
||||
| anydesk | Remote desktop software |
|
||||
| gnome-disk-utility | Manage disks |
|
||||
| gparted | Manage partitions |
|
||||
| xev | Test input |
|
||||
| Category | Guix dependency | Description |
|
||||
|--------------|------------------------|-------------------------------------------|
|
||||
| desktop-misc | xprop | Tool to display properties of X windows |
|
||||
| desktop-misc | arandr | GUI to xrandr |
|
||||
| desktop-misc | light | Control screen brightness |
|
||||
| desktop-misc | ponymix | Control PulseAudio CLI |
|
||||
| desktop-misc | pavucontrol | Control PulseAudio GUI |
|
||||
| desktop-misc | network-manager-applet | Applet to manage network connections |
|
||||
| desktop-misc | xmodmap | Program to modify keybindings on X server |
|
||||
| desktop-misc | fontconfig | |
|
||||
| desktop-misc | polkit-gnome | Polkit authentication agent |
|
||||
| desktop-misc | feh | Image viewer. Used to set background |
|
||||
| desktop-misc | copyq | Clipboard manager |
|
||||
| desktop-misc | thunar | My preferred GUI file manager |
|
||||
| desktop-misc | telegram-desktop | telegram client |
|
||||
| desktop-misc | xdg-utils | gives xdg-open and stuff |
|
||||
| desktop-misc | gnome-font-viewer | view fonts |
|
||||
| desktop-misc | qbittorrent | torrent client |
|
||||
| desktop-misc | anydesk | Remote desktop software |
|
||||
| desktop-misc | gnome-disk-utility | Manage disks |
|
||||
| desktop-misc | gparted | Manage partitions |
|
||||
| desktop-misc | xev | Test input |
|
||||
|
||||
<a id="code-snippet--packages"></a>
|
||||
```emacs-lisp
|
||||
|
|
|
|||
|
|
@ -4,11 +4,8 @@ author = ["Pavel"]
|
|||
draft = false
|
||||
+++
|
||||
|
||||
> One day we won't hate one another, no young boy will march to war and I will clean up my Emacs config. But that day isn't today.
|
||||
|
||||
My [Emacs](https://www.gnu.org/software/emacs/) configuration.
|
||||
|
||||
As with other files in the repo, parts prefixed with (OFF) are not used but kept for historic purposes.
|
||||
\#+begin\_quote
|
||||
One day we won't hate one another, no young boy will march to war and I will clean up my Emacs config. But that day isn'.
|
||||
|
||||
<div class="ox-hugo-toc toc">
|
||||
<div></div>
|
||||
|
|
@ -89,7 +86,12 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
|
|||
- [<span class="org-todo done OFF">OFF</span> (OFF) Tab bar](#off--tab-bar)
|
||||
- [Setup](#setup)
|
||||
- [My title](#my-title)
|
||||
- [Modeline](#modeline)
|
||||
- [Doom Modeline](#doom-modeline)
|
||||
- [<span class="org-todo done OFF">OFF</span> (OFF) Spaceline](#off--spaceline)
|
||||
- [Perspectives](#perspectives)
|
||||
- [EXWM workspace](#exwm-workspace)
|
||||
- [Debug](#debug)
|
||||
- [My theme](#my-theme)
|
||||
- [Font stuff](#font-stuff)
|
||||
- [Ligatures](#ligatures)
|
||||
- [Icons](#icons)
|
||||
|
|
@ -379,7 +381,8 @@ The following is true if Emacs is meant to be used with TRAMP over slow ssh. Tak
|
|||
(setq my/slow-ssh
|
||||
(or
|
||||
(string= (getenv "IS_TRAMP") "true")
|
||||
(string= (system-name) "dev-digital")))
|
||||
(string= (system-name) "dev-digital")
|
||||
(string= (system-name) "violet")))
|
||||
```
|
||||
|
||||
The following is true is Emacs is ran on a remote server where I don't need stuff like my org workflow
|
||||
|
|
@ -387,7 +390,8 @@ The following is true is Emacs is ran on a remote server where I don't need stuf
|
|||
```emacs-lisp
|
||||
(setq my/remote-server
|
||||
(or (string= (getenv "IS_REMOTE") "true")
|
||||
(string= (system-name) "dev-digital")))
|
||||
(string= (system-name) "dev-digital")
|
||||
(string= (system-name) "violet")))
|
||||
```
|
||||
|
||||
And the following is true if Emacs is run from termux on Android.
|
||||
|
|
@ -503,8 +507,8 @@ I have some variables which I don't commit to the repo, e.g. my current location
|
|||
|
||||
```emacs-lisp
|
||||
(let ((private-file (expand-file-name "private.el" user-emacs-directory)))
|
||||
(when (file-exists-p private-file)
|
||||
(load-file private-file)))
|
||||
|
||||
(load-file private-file))
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -1593,11 +1597,12 @@ References:
|
|||
(general-imap "C-SPC" 'company-complete)
|
||||
```
|
||||
|
||||
A company frontend with nice icons.
|
||||
A company frontend with nice icons. Disabled since the base company got icons support and since company-box has some issues with spaceline.
|
||||
|
||||
```emacs-lisp
|
||||
(use-package company-box
|
||||
:straight t
|
||||
:disabled
|
||||
:if (and (display-graphic-p) (not my/lowpower))
|
||||
:after (company)
|
||||
:hook (company-mode . company-box-mode))
|
||||
|
|
@ -1874,11 +1879,11 @@ Also, a hook allows me to change doom-theme more or less at will, although I do
|
|||
|
||||
```emacs-lisp
|
||||
(unless my/is-termux
|
||||
(deftheme my-theme)
|
||||
(deftheme my-theme-1)
|
||||
|
||||
(defun my/update-my-theme (&rest _)
|
||||
(custom-theme-set-faces
|
||||
'my-theme
|
||||
'my-theme-1
|
||||
`(tab-bar-tab ((t (
|
||||
:background ,(doom-color 'bg)
|
||||
:foreground ,(doom-color 'yellow)
|
||||
|
|
@ -1895,12 +1900,24 @@ Also, a hook allows me to change doom-theme more or less at will, although I do
|
|||
`(epe-pipeline-time-face ((t (:foreground ,(doom-color 'yellow)))))
|
||||
`(epe-pipeline-user-face ((t (:foreground ,(doom-color 'red)))))
|
||||
`(elfeed-search-tag-face ((t (:foreground ,(doom-color 'yellow)))))
|
||||
`(notmuch-wash-cited-text ((t (:foreground ,(doom-color 'yellow))))))
|
||||
`(notmuch-wash-cited-text ((t (:foreground ,(doom-color 'yellow)))))
|
||||
`(spaceline-evil-emacs ((t :background ,(doom-color 'bg)
|
||||
:foreground ,(doom-color 'fg))))
|
||||
`(spaceline-evil-insert ((t :background ,(doom-color 'green)
|
||||
:foreground ,(doom-color 'base0))))
|
||||
`(spaceline-evil-motion ((t :background ,(doom-color 'magenta)
|
||||
:foreground ,(doom-color 'base0))))
|
||||
`(spaceline-evil-normal ((t :background ,(doom-color 'blue)
|
||||
:foreground ,(doom-color 'base0))))
|
||||
`(spaceline-evil-replace ((t :background ,(doom-color 'yellow)
|
||||
:foreground ,(doom-color 'base0))))
|
||||
`(spaceline-evil-visual ((t :background ,(doom-color 'grey)
|
||||
:foreground ,(doom-color 'base0)))))
|
||||
(custom-theme-set-variables
|
||||
'my-theme
|
||||
'my-theme-1
|
||||
`(aweshell-invalid-command-color ,(doom-color 'red))
|
||||
`(aweshell-valid-command-color ,(doom-color 'green)))
|
||||
(enable-theme 'my-theme))
|
||||
(enable-theme 'my-theme-1))
|
||||
|
||||
(advice-add 'load-theme :after #'my/update-my-theme)
|
||||
(when (fboundp 'doom-color)
|
||||
|
|
@ -2082,10 +2099,12 @@ Prepend tab name with the shortened projectile project title
|
|||
```
|
||||
|
||||
|
||||
### Modeline {#modeline}
|
||||
### Doom Modeline {#doom-modeline}
|
||||
|
||||
A modeline from Doom Emacs.
|
||||
|
||||
A big advantage of this package is that it just works out of the box and does not require much customization. For now I opted out of it in favour of spaceline because I want to have a more powerline-ish look.
|
||||
|
||||
References:
|
||||
|
||||
- [Doom Modeline](https://github.com/seagle0128/doom-modeline)
|
||||
|
|
@ -2095,9 +2114,12 @@ References:
|
|||
```emacs-lisp
|
||||
(use-package doom-modeline
|
||||
:straight t
|
||||
;; :if (not (display-graphic-p))
|
||||
:init
|
||||
(setq doom-modeline-env-enable-python nil)
|
||||
(setq doom-modeline-env-enable-go nil)
|
||||
(setq doom-modeline-buffer-encoding 'nondefault)
|
||||
(setq doom-modeline-hud t)
|
||||
:config
|
||||
(doom-modeline-mode 1)
|
||||
(setq doom-modeline-minor-modes nil)
|
||||
|
|
@ -2105,6 +2127,126 @@ References:
|
|||
```
|
||||
|
||||
|
||||
### <span class="org-todo done OFF">OFF</span> (OFF) Spaceline {#off--spaceline}
|
||||
|
||||
A modeline from Spacemacs. It provides a different look than Doom modeline, but also needs to be tuned more.
|
||||
|
||||
```emacs-lisp
|
||||
(use-package spaceline
|
||||
:straight t
|
||||
:disabled
|
||||
:config
|
||||
<<spaceline-conf>>)
|
||||
```
|
||||
|
||||
|
||||
#### Perspectives {#perspectives}
|
||||
|
||||
Definining a bunch of custom powerline segments. First, a list of perspectives.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/format-perspective-list ()
|
||||
(format "[%s]"
|
||||
(let ((curr (persp-current-name)))
|
||||
(mapconcat
|
||||
(lambda (name)
|
||||
(if (string-equal name curr)
|
||||
(propertize
|
||||
name
|
||||
'face
|
||||
'persp-selected-face)
|
||||
name))
|
||||
(persp-names)
|
||||
"|"))))
|
||||
|
||||
(defvar my/spaceline-persp-list "")
|
||||
|
||||
(defun my/persp-update-advice (&rest _)
|
||||
(setq my/spaceline-persp-list (my/format-perspective-list)))
|
||||
|
||||
(advice-add #'persp-update-modestring :after #'my/persp-update-advice)
|
||||
(add-hook 'buffer-list-update-hook #'my/persp-update-advice)
|
||||
(add-hook 'find-file-hook #'my/persp-update-advice)
|
||||
|
||||
(spaceline-define-segment perspective
|
||||
"Perspective.el"
|
||||
my/spaceline-persp-list)
|
||||
```
|
||||
|
||||
|
||||
#### EXWM workspace {#exwm-workspace}
|
||||
|
||||
Current EXWM workspace. The variable is being set in the EXWM config, the segment just displays it.
|
||||
|
||||
```emacs-lisp
|
||||
(defvar my/exwm-mode-line-info-no-props "")
|
||||
|
||||
(spaceline-define-segment exwm
|
||||
my/exwm-mode-line-info-no-props)
|
||||
```
|
||||
|
||||
|
||||
#### Debug {#debug}
|
||||
|
||||
Indicators for `debug-on-error` and `debug-on-quit`.
|
||||
|
||||
```emacs-lisp
|
||||
(spaceline-define-segment debug-on-error
|
||||
(when debug-on-error
|
||||
(propertize
|
||||
""
|
||||
'face 'warning
|
||||
'local-map (let ((map (make-sparse-keymap)))
|
||||
(define-key map
|
||||
[mode-line mouse-1]
|
||||
#'toggle-debug-on-error)
|
||||
map))))
|
||||
|
||||
(spaceline-define-segment debug-on-quit
|
||||
(when debug-on-quit
|
||||
(propertize
|
||||
""
|
||||
'face 'error
|
||||
'local-map (let ((map (make-sparse-keymap)))
|
||||
(define-key map
|
||||
[mode-line mouse-1]
|
||||
#'toggle-debug-on-quit)
|
||||
map))))
|
||||
```
|
||||
|
||||
|
||||
#### My theme {#my-theme}
|
||||
|
||||
And a custom spaceline config with segments I like.
|
||||
|
||||
```emacs-lisp
|
||||
(require 'spaceline-config)
|
||||
|
||||
(spaceline-compile
|
||||
"my"
|
||||
'((evil-state :priority 100 :face (spaceline-highlight-face-evil-state))
|
||||
(buffer-modified :priority 50)
|
||||
(version-control :priority 25 :when active)
|
||||
(buffer-id :priority 90))
|
||||
'(;; (global)
|
||||
(exwm :when active)
|
||||
(perspective :when active)
|
||||
(flycheck-error :when active)
|
||||
(flycheck-warning :when active)
|
||||
(debug-on-error :when active)
|
||||
(debug-on-quit :when active)
|
||||
(major-mode :when active :priority 90)
|
||||
(selection-info :priority 95)
|
||||
(line-column :when active :priority 99)
|
||||
(hud :when active :priority 99)))
|
||||
|
||||
(spaceline-ml-my)
|
||||
|
||||
(setq-default mode-line-format '("%e" (:eval (spaceline-ml-my))))
|
||||
(setq mode-line-format '("%e" (:eval (spaceline-ml-my))))
|
||||
```
|
||||
|
||||
|
||||
### Font stuff {#font-stuff}
|
||||
|
||||
|
||||
|
|
@ -3588,7 +3730,16 @@ References:
|
|||
`(("d" "default" plain "%?"
|
||||
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
|
||||
:unnarrowed t)))
|
||||
(require 'org-roam-protocol))
|
||||
(require 'org-roam-protocol)
|
||||
(general-define-key
|
||||
:keymaps 'org-roam-mode-map
|
||||
:states '(normal)
|
||||
"TAB" #'magit-section-toggle
|
||||
"q" #'quit-window
|
||||
"k" #'magit-section-backward
|
||||
"j" #'magit-section-forward
|
||||
"gr" #'revert-buffer
|
||||
"RET" #'org-roam-buffer-visit-thing))
|
||||
|
||||
(my-leader-def
|
||||
:infix "or"
|
||||
|
|
@ -4287,6 +4438,8 @@ References:
|
|||
;; (csharp-mode . lsp)
|
||||
)
|
||||
:commands lsp
|
||||
:init
|
||||
(setq lsp-keymap-prefix nil)
|
||||
:config
|
||||
(setq lsp-idle-delay 1)
|
||||
(setq lsp-eslint-server-command '("node" "/home/pavel/.emacs.d/.cache/lsp/eslint/unzipped/extension/server/out/eslintServer.js" "--stdio"))
|
||||
|
|
@ -6259,14 +6412,14 @@ Also a function to automatically adjust these colors with the Doom theme.
|
|||
```emacs-lisp
|
||||
(defun my/update-my-theme-elfeed (&rest _)
|
||||
(custom-theme-set-faces
|
||||
'my-theme
|
||||
'my-theme-1
|
||||
`(elfeed-videos-entry ((t :foreground ,(doom-color 'red))))
|
||||
`(elfeed-twitter-entry ((t :foreground ,(doom-color 'blue))))
|
||||
`(elfeed-emacs-entry ((t :foreground ,(doom-color 'magenta))))
|
||||
`(elfeed-music-entry ((t :foreground ,(doom-color 'green))))
|
||||
`(elfeed-podcasts-entry ((t :foreground ,(doom-color 'yellow))))
|
||||
`(elfeed-blogs-entry ((t :foreground ,(doom-color 'orange)))))
|
||||
(enable-theme 'my-theme))
|
||||
(enable-theme 'my-theme-1))
|
||||
|
||||
(advice-add 'load-theme :after #'my/update-my-theme-elfeed)
|
||||
(when (fboundp 'doom-color)
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
|
|||
- [ivy-rich](#ivy-rich)
|
||||
- [prescient](#prescient)
|
||||
- [Keybindings](#keybindings)
|
||||
- [<span class="org-todo done OFF">OFF</span> (OFF) Helm](#off--helm)
|
||||
- [Treemacs](#treemacs)
|
||||
- [Helper functions](#helper-functions)
|
||||
- [Custom icons](#custom-icons)
|
||||
|
|
@ -92,7 +91,6 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
|
|||
- [My title](#my-title)
|
||||
- [Modeline](#modeline)
|
||||
- [Font stuff](#font-stuff)
|
||||
- [Emojis](#emojis)
|
||||
- [Ligatures](#ligatures)
|
||||
- [Icons](#icons)
|
||||
- [Highlight todo](#highlight-todo)
|
||||
|
|
@ -172,7 +170,12 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
|
|||
- [Keybindings](#keybindings)
|
||||
- [Flycheck](#flycheck)
|
||||
- [Tree Sitter](#tree-sitter)
|
||||
- [<span class="org-todo done OFF">OFF</span> (OFF) DAP](#off--dap)
|
||||
- [DAP](#dap)
|
||||
- [Controls](#controls)
|
||||
- [UI Fixes](#ui-fixes)
|
||||
- [Helper functions](#helper-functions)
|
||||
- [Improved stack frame switching](#improved-stack-frame-switching)
|
||||
- [Debug templates](#debug-templates)
|
||||
- [<span class="org-todo done OFF">OFF</span> (OFF) TabNine](#off--tabnine)
|
||||
- [<span class="org-todo done OFF">OFF</span> (OFF) Code Compass](#off--code-compass)
|
||||
- [Dependencies](#dependencies)
|
||||
|
|
@ -277,11 +280,9 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
|
|||
- [proced](#proced)
|
||||
- [Guix](#guix)
|
||||
- [Productivity](#productivity)
|
||||
- [Pomidor](#pomidor)
|
||||
- [pomm](#pomm)
|
||||
- [<span class="org-todo done OFF">OFF</span> (OFF) Pomidor](#off--pomidor)
|
||||
- [Calendar](#calendar)
|
||||
- [<span class="org-todo done OFF">OFF</span> (OFF) EAF](#off--eaf)
|
||||
- [Installation](#installation)
|
||||
- [Config](#config)
|
||||
- [Fun](#fun)
|
||||
- [Discord integration](#discord-integration)
|
||||
- [Snow](#snow)
|
||||
|
|
@ -719,6 +720,7 @@ Basic evil configuration.
|
|||
pass
|
||||
calendar
|
||||
dired
|
||||
ivy
|
||||
debug
|
||||
guix
|
||||
calc
|
||||
|
|
@ -805,7 +807,12 @@ Using the `SPC` key as a leader key, like in Doom Emacs or Spacemacs.
|
|||
:prefix "SPC"
|
||||
:states '(normal motion emacs))
|
||||
|
||||
(general-def :states '(normal motion emacs) "SPC" nil)
|
||||
(general-def :states '(normal motion emacs)
|
||||
"SPC" nil
|
||||
"M-SPC" (general-key "SPC"))
|
||||
|
||||
(general-def :states '(insert)
|
||||
"M-SPC" (general-key "SPC" :state 'normal))
|
||||
|
||||
(my-leader-def "?" 'which-key-show-top-level)
|
||||
(my-leader-def "E" 'eval-expression)
|
||||
|
|
@ -1028,7 +1035,7 @@ So here is a simple predicate which checks whether there is space in the given d
|
|||
|
||||
```emacs-lisp
|
||||
(defun my/emacs-i3-direction-exists-p (dir)
|
||||
(some (lambda (dir)
|
||||
(cl-some (lambda (dir)
|
||||
(let ((win (windmove-find-other-window dir)))
|
||||
(and win (not (window-minibuffer-p win)))))
|
||||
(pcase dir
|
||||
|
|
@ -1388,6 +1395,10 @@ References:
|
|||
;; ivy-resume
|
||||
;; ivy--restore-session
|
||||
lsp-ivy-workspace-symbol
|
||||
dap-switch-stack-frame
|
||||
my/dap-switch-stack-frame
|
||||
dap-switch-session
|
||||
dap-switch-thread
|
||||
counsel-grep
|
||||
;; counsel-find-file
|
||||
counsel-git-grep
|
||||
|
|
@ -1439,69 +1450,12 @@ References:
|
|||
```
|
||||
|
||||
|
||||
### <span class="org-todo done OFF">OFF</span> (OFF) Helm {#off--helm}
|
||||
|
||||
Config for the Helm incremental completion framework. I switched to Ivy some time ago, but keep the configuration just in case.
|
||||
|
||||
```emacs-lisp
|
||||
(use-package helm
|
||||
:init
|
||||
(require 'helm-config)
|
||||
(setq helm-split-window-in-side-p t)
|
||||
(setq helm-move-to-line-cycle-in-source t)
|
||||
:straight t
|
||||
:config
|
||||
(helm-mode 1)
|
||||
(helm-autoresize-mode 1))
|
||||
|
||||
(use-package helm-ag
|
||||
:straight t)
|
||||
|
||||
(use-package helm-rg
|
||||
:straight t)
|
||||
|
||||
(general-nmap
|
||||
:keymaps 'helm-ag-mode-map
|
||||
"RET" 'helm-ag-mode-jump
|
||||
"M-RET" 'helm-ag-mode-jump-other-window)
|
||||
|
||||
(general-nmap
|
||||
:keymaps 'helm-occur-mode-map
|
||||
"RET" 'helm-occur-mode-goto-line
|
||||
"M-RET" 'helm-occur-mode-goto-line-ow)
|
||||
|
||||
(general-define-key "M-x" 'helm-M-x)
|
||||
(my-leader-def
|
||||
"fb" 'helm-buffers-list
|
||||
"fs" 'helm-lsp-workspace-symbol
|
||||
"fw" 'helm-lsp-global-workspace-symbol
|
||||
"fc" 'helm-show-kill-ring
|
||||
;; "fa" 'helm-do-ag-project-root
|
||||
"fm" 'helm-bookmarks
|
||||
"ff" 'project-find-file
|
||||
"fe" 'conda-env-activate)
|
||||
|
||||
(my-leader-def "s" 'helm-occur)
|
||||
(my-leader-def "SPC" 'helm-resume)
|
||||
|
||||
(general-define-key
|
||||
:keymaps 'helm-map
|
||||
"C-j" 'helm-next-line
|
||||
"C-k" 'helm-previous-line)
|
||||
|
||||
(general-define-key
|
||||
:keymaps '(helm-find-files-map helm-locate-map)
|
||||
"C-h" 'helm-find-files-up-one-level
|
||||
"C-l" 'helm-execute-persistent-action)
|
||||
|
||||
(general-imap
|
||||
"C-y" 'helm-show-kill-ring)
|
||||
;; (general-nmap "C-p" 'project-find-file)
|
||||
```
|
||||
|
||||
|
||||
### Treemacs {#treemacs}
|
||||
|
||||
| Type | Note |
|
||||
|------|--------------------------------------------------------|
|
||||
| TODO | Enable modeline only for particular treemacs instances |
|
||||
|
||||
[Treemacs](https://github.com/Alexander-Miller/treemacs) calls itself a tree layout file explorer, but looks more like a project and workspace management system.
|
||||
|
||||
Integrates with evil, magit, projectile and perspective. The latter is particularly great - each perspective can have its own treemacs workspace!
|
||||
|
|
@ -2154,21 +2108,6 @@ References:
|
|||
### Font stuff {#font-stuff}
|
||||
|
||||
|
||||
#### Emojis {#emojis}
|
||||
|
||||
| Note | Type |
|
||||
|------|-----------------------------------------------------------|
|
||||
| TODO | Figure out how to display emojis without prettify symbols |
|
||||
|
||||
```emacs-lisp
|
||||
(use-package emojify
|
||||
:straight t
|
||||
:if (and (display-graphic-p) (not (or my/lowpower my/is-termux)))
|
||||
:disabled
|
||||
:hook (after-init . global-emojify-mode))
|
||||
```
|
||||
|
||||
|
||||
#### Ligatures {#ligatures}
|
||||
|
||||
Ligature setup for the JetBrainsMono font.
|
||||
|
|
@ -2761,6 +2700,10 @@ Use the built-in org mode.
|
|||
(add-hook 'org-mode-hook
|
||||
(lambda ()
|
||||
(rainbow-delimiters-mode -1)))
|
||||
(require 'org-tempo)
|
||||
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
||||
(add-to-list 'org-structure-template-alist '("py" . "src python"))
|
||||
(add-to-list 'org-structure-template-alist '("sq" . "src sql"))
|
||||
<<org-crypt-setup>>
|
||||
(unless my/is-termux
|
||||
<<org-lang-setup>>)
|
||||
|
|
@ -3179,6 +3122,12 @@ Refile targets
|
|||
Settings for Org capture mode. The goal here is to have a non-disruptive process to capture various ideas.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/generate-inbox-note-name ()
|
||||
(format
|
||||
"%s/inbox-notes/%s.org"
|
||||
org-directory
|
||||
(format-time-string "%Y%m%d%H%M%S")))
|
||||
|
||||
(setq org-capture-templates
|
||||
`(("i" "Inbox" entry (file "inbox.org")
|
||||
,(concat "* TODO %?\n"
|
||||
|
|
@ -3191,7 +3140,10 @@ Settings for Org capture mode. The goal here is to have a non-disruptive process
|
|||
("f" "elfeed" entry (file "inbox.org")
|
||||
,(concat "* TODO %:elfeed-entry-title\n"
|
||||
"/Entered on/ %U\n"
|
||||
"%a\n"))))
|
||||
"%a\n"))
|
||||
("n" "note" entry (file my/generate-inbox-note-name)
|
||||
,(concat "* %?\n"
|
||||
"/Entered on/ %U"))))
|
||||
```
|
||||
|
||||
Effort estimation
|
||||
|
|
@ -3640,7 +3592,7 @@ References:
|
|||
|
||||
(my-leader-def
|
||||
:infix "or"
|
||||
"r" '(:which-key "org-roam")
|
||||
"" '(:which-key "org-roam")
|
||||
"i" 'org-roam-node-insert
|
||||
"r" 'org-roam-node-find
|
||||
"g" 'org-roam-graph
|
||||
|
|
@ -3729,8 +3681,9 @@ As of now, this package loads Helm on start. To avoid this, I have to exclude He
|
|||
(general-define-key
|
||||
:keymaps 'bibtex-mode-map
|
||||
"M-RET" 'org-ref-bibtex-hydra/body)
|
||||
(add-to-list 'orhc-candidate-formats
|
||||
'("online" . " |${=key=}| ${title} ${url}")))
|
||||
;; (add-to-list 'orhc-candidate-formats
|
||||
;; '("online" . " |${=key=}| ${title} ${url}"))
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -4322,6 +4275,7 @@ References:
|
|||
:if (not (or my/slow-ssh my/is-termux my/remote-server))
|
||||
:hook (
|
||||
(typescript-mode . lsp)
|
||||
(js-mode . lsp)
|
||||
(vue-mode . lsp)
|
||||
(go-mode . lsp)
|
||||
(svelte-mode . lsp)
|
||||
|
|
@ -4462,11 +4416,11 @@ References:
|
|||
```
|
||||
|
||||
|
||||
#### <span class="org-todo done OFF">OFF</span> (OFF) DAP {#off--dap}
|
||||
#### DAP {#dap}
|
||||
|
||||
An Emacs client for Debugger Adapter Protocol.
|
||||
|
||||
I don't use it now, because there are debuggers I like more for the technologies I'm currently using.
|
||||
As of time of this writing, I mostly debug TypeScript, so the main competitor is Chrome Inspector for node.js.
|
||||
|
||||
References:
|
||||
|
||||
|
|
@ -4477,12 +4431,13 @@ References:
|
|||
```emacs-lisp
|
||||
(use-package dap-mode
|
||||
:straight t
|
||||
:defer t
|
||||
:commands (dap-debug)
|
||||
:init
|
||||
(setq lsp-enable-dap-auto-configure nil)
|
||||
:config
|
||||
|
||||
(setq dap-ui-variable-length 100)
|
||||
(setq dap-auto-show-output nil)
|
||||
(require 'dap-node)
|
||||
(dap-node-setup)
|
||||
|
||||
|
|
@ -4494,30 +4449,251 @@ References:
|
|||
(dap-mode 1)
|
||||
(dap-ui-mode 1)
|
||||
(dap-tooltip-mode 1)
|
||||
(tooltip-mode 1)
|
||||
(dap-ui-controls-mode 1))
|
||||
(tooltip-mode 1))
|
||||
```
|
||||
|
||||
(my-leader-def
|
||||
:infix "d"
|
||||
"d" 'dap-debug
|
||||
"b" 'dap-breakpoint-toggle
|
||||
"c" 'dap-breakpoint-condition
|
||||
"wl" 'dap-ui-locals
|
||||
"wb" 'dap-ui-breakpoints
|
||||
"wr" 'dap-ui-repl
|
||||
"ws" 'dap-ui-sessions
|
||||
"we" 'dap-ui-expressions)
|
||||
|
||||
(my-leader-def
|
||||
:infix "d"
|
||||
:keymaps 'dap-mode-map
|
||||
"h" 'dap-hydra)
|
||||
##### Controls {#controls}
|
||||
|
||||
I don't like some keybindings in the built-in hydra, and there seems to be no easy way to modify the existing hydra, so I create my own. I tried to use transient, but the transient buffer seems to conflict with special buffers of DAP, and hydra does not.
|
||||
|
||||
Also, I want the hydra to toggle UI windows instead of just opening them, so here is macro that defines such functions:
|
||||
|
||||
```emacs-lisp
|
||||
(with-eval-after-load 'dap-mode
|
||||
(defmacro my/define-dap-ui-window-toggler (name)
|
||||
`(defun ,(intern (concat "my/dap-ui-toggle-" name)) ()
|
||||
,(concat "Toggle DAP " name "buffer")
|
||||
(interactive)
|
||||
(if-let (window (get-buffer-window ,(intern (concat "dap-ui--" name "-buffer"))))
|
||||
(quit-window nil window)
|
||||
(,(intern (concat "dap-ui-" name))))))
|
||||
|
||||
(my/define-dap-ui-window-toggler "locals")
|
||||
(my/define-dap-ui-window-toggler "expressions")
|
||||
(my/define-dap-ui-window-toggler "sessions")
|
||||
(my/define-dap-ui-window-toggler "breakpoints")
|
||||
(my/define-dap-ui-window-toggler "repl"))
|
||||
```
|
||||
|
||||
And here is the hydra:
|
||||
|
||||
```emacs-lisp
|
||||
(defhydra my/dap-hydra (:color pink :hint nil :foreign-keys run)
|
||||
"
|
||||
^Stepping^ ^UI^ ^Switch^ ^Breakpoints^ ^Debug^ ^Expressions
|
||||
^^^^^^^^------------------------------------------------------------------------------------------------------------------------------------------
|
||||
_n_: Next _uc_: Controls _ss_: Session _bb_: Toggle _dd_: Debug _ee_: Eval
|
||||
_i_: Step in _ue_: Expressions _st_: Thread _bd_: Delete _dr_: Debug recent _er_: Eval region
|
||||
_o_: Step out _ul_: Locals _sf_: Stack frame _ba_: Add _dl_: Debug last _es_: Eval thing at point
|
||||
_c_: Continue _ur_: REPL _su_: Up stack frame _bc_: Set condition _de_: Edit debug template _ea_: Add expression
|
||||
_r_: Restart frame _uo_: Output _sd_: Down stack frame _bh_: Set hit count _Q_: Disconnect _ed_: Remove expression
|
||||
_us_: Sessions _sF_: Stack frame filtered _bl_: Set log message _eu_: Refresh expressions
|
||||
_ub_: Breakpoints "
|
||||
|
||||
("n" dap-next)
|
||||
("i" dap-step-in)
|
||||
("o" dap-step-out)
|
||||
("c" dap-continue)
|
||||
("r" dap-restart-frame)
|
||||
("uc" dap-ui-controls-mode)
|
||||
("ue" my/dap-ui-toggle-expressions)
|
||||
("ul" my/dap-ui-toggle-locals)
|
||||
("ur" my/dap-ui-toggle-repl)
|
||||
("uo" dap-ui-go-to-output-buffer)
|
||||
("us" my/dap-ui-toggle-sessions)
|
||||
("ub" my/dap-ui-toggle-breakpoints)
|
||||
("ss" dap-switch-session)
|
||||
("st" dap-switch-thread)
|
||||
("sf" dap-switch-stack-frame)
|
||||
("sF" my/dap-switch-stack-frame)
|
||||
("su" dap-up-stack-frame)
|
||||
("sd" dap-down-stack-frame)
|
||||
("bb" dap-breakpoint-toggle)
|
||||
("ba" dap-breakpoint-add)
|
||||
("bd" dap-breakpoint-delete)
|
||||
("bc" dap-breakpoint-condition)
|
||||
("bh" dap-breakpoint-hit-condition)
|
||||
("bl" dap-breakpoint-log-message)
|
||||
("dd" dap-debug)
|
||||
("dr" dap-debug-recent)
|
||||
("dl" dap-debug-last)
|
||||
("de" dap-debug-edit-template)
|
||||
("ee" dap-eval)
|
||||
("ea" dap-ui-expressions-add)
|
||||
("er" dap-eval-region)
|
||||
("es" dap-eval-thing-at-point)
|
||||
("ed" dap-ui-expressions-remove)
|
||||
("eu" dap-ui-expressions-refresh)
|
||||
("q" nil "quit" :color blue)
|
||||
("Q" dap-disconnect :color red))
|
||||
|
||||
(my-leader-def "d" #'my/dap-hydra/body)
|
||||
```
|
||||
|
||||
|
||||
##### UI Fixes {#ui-fixes}
|
||||
|
||||
There are some problems with DAP UI in my setup.
|
||||
|
||||
First, DAP uses Treemacs buffers quite extensively, and they hide the doom modeline for some reason, so I can't tell which buffer is active and can't see borders between buffers.
|
||||
|
||||
Second, lines are truncated in some strange way, but calling `toggle-truncate-lines` seems to fix that.
|
||||
|
||||
So I define a macro that creates a function that I can further use in an advice.
|
||||
|
||||
```emacs-lisp
|
||||
(defvar my/dap-mode-buffer-fixed nil)
|
||||
|
||||
(with-eval-after-load 'dap-mode
|
||||
(defmacro my/define-dap-tree-buffer-fixer (buffer-var buffer-name)
|
||||
`(defun ,(intern (concat "my/fix-dap-ui-" buffer-name "-buffer")) (&rest _)
|
||||
(with-current-buffer ,buffer-var
|
||||
(unless my/dap-mode-buffer-fixed
|
||||
(toggle-truncate-lines 1)
|
||||
(doom-modeline-set-modeline 'info)
|
||||
(setq-local my/dap-mode-buffer-fixed t)))))
|
||||
|
||||
(my/define-dap-tree-buffer-fixer dap-ui--locals-buffer "locals")
|
||||
(my/define-dap-tree-buffer-fixer dap-ui--expressions-buffer "expressions")
|
||||
(my/define-dap-tree-buffer-fixer dap-ui--sessions-buffer "sessions")
|
||||
(my/define-dap-tree-buffer-fixer dap-ui--breakpoints-buffer "breakpoints")
|
||||
|
||||
(advice-add 'dap-ui-locals :after #'my/fix-dap-ui-locals-buffer)
|
||||
(advice-add 'dap-ui-expressions :after #'my/fix-dap-ui-expressions-buffer)
|
||||
(advice-add 'dap-ui-sessions :after #'my/fix-dap-ui-sessions-buffer)
|
||||
(advice-add 'dap-ui-breakpoints :after #'my/fix-dap-ui-breakpoints-buffer))
|
||||
```
|
||||
|
||||
|
||||
##### Helper functions {#helper-functions}
|
||||
|
||||
Some helper functions that make debugging with DAP easier.
|
||||
|
||||
DAP seems to mess with window parameters from time to time. This function clears "bad" window parameters.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/clear-bad-window-parameters ()
|
||||
"Clear window parameters that interrupt my workflow."
|
||||
(interactive)
|
||||
(let ((window (get-buffer-window (current-buffer))))
|
||||
(set-window-parameter window 'no-delete-other-windows nil)))
|
||||
```
|
||||
|
||||
A function to kill a value from a treemacs node.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/dap-yank-value-at-point (node)
|
||||
(interactive (list (treemacs-node-at-point)))
|
||||
(kill-new (message (plist-get (button-get node :item) :value))))
|
||||
```
|
||||
|
||||
A function to open a value from a treemacs node in a new buffer.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/dap-display-value (node)
|
||||
(interactive (list (treemacs-node-at-point)))
|
||||
(let ((value (plist-get (button-get node :item) :value)))
|
||||
(when value
|
||||
(let ((buffer (generate-new-buffer "dap-value")))
|
||||
(with-current-buffer buffer
|
||||
(insert value))
|
||||
(select-window (display-buffer buffer))))))
|
||||
```
|
||||
|
||||
|
||||
##### Improved stack frame switching {#improved-stack-frame-switching}
|
||||
|
||||
One significant improvement over Chrome Inspector for my particular stack is an ability to filter the stack frame list, for instance to see only frames that relate to my current project.
|
||||
|
||||
So, here are functions that customize the filters:
|
||||
|
||||
```emacs-lisp
|
||||
(with-eval-after-load 'dap-mode
|
||||
(setq my/dap-stack-frame-filters
|
||||
`(("node_modules,node:internal" . ,(rx (or "node_modules" "node:internal")))
|
||||
("node_modules" . ,(rx (or "node_modules")))
|
||||
("node:internal" . ,(rx (or "node:internal")))))
|
||||
|
||||
(setq my/dap-stack-frame-current-filter (cdar my/dap-stack-frame-filters))
|
||||
|
||||
(defun my/dap-stack-frame-filter-set ()
|
||||
(interactive)
|
||||
(setq my/dap-stack-frame-current-filter
|
||||
(cdr
|
||||
(assoc
|
||||
(completing-read "Filter: " my/dap-stack-frame-filters)
|
||||
my/dap-stack-frame-filters))))
|
||||
|
||||
(defun my/dap-stack-frame-filter (frame)
|
||||
(when-let (path (dap--get-path-for-frame frame))
|
||||
(not (string-match my/dap-stack-frame-current-filter path)))))
|
||||
```
|
||||
|
||||
And here is a version of `dap-switch-stack-frame` that uses the said filter.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/dap-switch-stack-frame ()
|
||||
"Switch stackframe by selecting another stackframe stackframes from current thread."
|
||||
(interactive)
|
||||
(when (not (dap--cur-session))
|
||||
(error "There is no active session"))
|
||||
|
||||
(-if-let (thread-id (dap--debug-session-thread-id (dap--cur-session)))
|
||||
(-if-let (stack-frames
|
||||
(gethash
|
||||
thread-id
|
||||
(dap--debug-session-thread-stack-frames (dap--cur-session))))
|
||||
(let* ((index 0)
|
||||
(stack-framces-filtered
|
||||
(-filter
|
||||
#'my/dap-stack-frame-filter
|
||||
stack-frames))
|
||||
(new-stack-frame
|
||||
(dap--completing-read
|
||||
"Select active frame: "
|
||||
stack-framces-filtered
|
||||
(-lambda ((frame &as &hash "name"))
|
||||
(if-let (frame-path (dap--get-path-for-frame frame))
|
||||
(format "%s: %s (in %s)"
|
||||
(cl-incf index) name frame-path)
|
||||
(format "%s: %s" (cl-incf index) name)))
|
||||
nil
|
||||
t)))
|
||||
(dap--go-to-stack-frame (dap--cur-session) new-stack-frame))
|
||||
(->> (dap--cur-session)
|
||||
dap--debug-session-name
|
||||
(format "Current session %s is not stopped")
|
||||
error))
|
||||
(error "No thread is currently active %s" (dap--debug-session-name (dap--cur-session)))))
|
||||
```
|
||||
|
||||
|
||||
##### Debug templates {#debug-templates}
|
||||
|
||||
Some debug templates I frequently use.
|
||||
|
||||
```emacs-lisp
|
||||
(with-eval-after-load 'dap-mode
|
||||
(dap-register-debug-template
|
||||
"Node::Nest.js"
|
||||
(list :type "node"
|
||||
:request "attach"
|
||||
:name "Node::Attach"
|
||||
:port 9229
|
||||
:outFiles ["${workspaceFolder}/dist/**/*.js"]
|
||||
:sourceMaps t
|
||||
:program "${workspaceFolder}/src/app.ts"))
|
||||
(dap-register-debug-template
|
||||
"Node::Babel"
|
||||
(list :type "node"
|
||||
:request "attach"
|
||||
:name "Node::Attach"
|
||||
:port 9229
|
||||
:program "${workspaceFolder}/dist/bin/www.js")))
|
||||
|
||||
```
|
||||
|
||||
|
||||
#### <span class="org-todo done OFF">OFF</span> (OFF) TabNine {#off--tabnine}
|
||||
|
||||
|
|
@ -6078,6 +6254,25 @@ Setting up custom faces for certain tags to make the feed look a bit nicer.
|
|||
(unread elfeed-search-unread-title-face))))
|
||||
```
|
||||
|
||||
Also a function to automatically adjust these colors with the Doom theme.
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/update-my-theme-elfeed (&rest _)
|
||||
(custom-theme-set-faces
|
||||
'my-theme
|
||||
`(elfeed-videos-entry ((t :foreground ,(doom-color 'red))))
|
||||
`(elfeed-twitter-entry ((t :foreground ,(doom-color 'blue))))
|
||||
`(elfeed-emacs-entry ((t :foreground ,(doom-color 'magenta))))
|
||||
`(elfeed-music-entry ((t :foreground ,(doom-color 'green))))
|
||||
`(elfeed-podcasts-entry ((t :foreground ,(doom-color 'yellow))))
|
||||
`(elfeed-blogs-entry ((t :foreground ,(doom-color 'orange)))))
|
||||
(enable-theme 'my-theme))
|
||||
|
||||
(advice-add 'load-theme :after #'my/update-my-theme-elfeed)
|
||||
(when (fboundp 'doom-color)
|
||||
(my/update-my-theme-elfeed))
|
||||
```
|
||||
|
||||
|
||||
##### elfeed-score {#elfeed-score}
|
||||
|
||||
|
|
@ -6263,7 +6458,7 @@ script-opts=ytdl_hook-ytdl_path=yt-dlp
|
|||
It seems a bit strange to keep the MPV config in this file, but I don't use the program outside Emacs.
|
||||
|
||||
```emacs-lisp
|
||||
(add-to-list 'emms-player-list 'emms-player-mpv t)
|
||||
(add-to-list 'emms-player-list 'emms-player-mpv)
|
||||
```
|
||||
|
||||
Also a custom regex. My demands for MPV include running `yt-dlp`, so there is a regex that matches youtube.com or some of the video formats.
|
||||
|
|
@ -6753,7 +6948,7 @@ The actual service definitions are in the `~/.emacs.d/prodigy.org`, which tangle
|
|||
:straight t
|
||||
:commands (prodigy)
|
||||
:init
|
||||
(my-leader-def "ap" 'prodigy)
|
||||
(my-leader-def "aP" 'prodigy)
|
||||
:config
|
||||
(when (not (boundp 'my/docker-directories))
|
||||
(load (concat user-emacs-directory "prodigy-config")))
|
||||
|
|
@ -6811,7 +7006,7 @@ Tecosaur's plugin to make beautiful code screenshots.
|
|||
|
||||
```emacs-lisp
|
||||
(use-package screenshot
|
||||
:straight (:repo "tecosaur/screenshot" :host github :files ("screenshot.el"))
|
||||
:straight (:repo "tecosaur/screenshot" :host github :files ("screenshot.el") :commit "f8204e82dc0c1158c401735d36a143e6f6d24cf5")
|
||||
:if (display-graphic-p)
|
||||
:commands (screenshot)
|
||||
:init
|
||||
|
|
@ -6849,13 +7044,33 @@ An Emacs package to help managing GNU Guix.
|
|||
### Productivity {#productivity}
|
||||
|
||||
|
||||
#### Pomidor {#pomidor}
|
||||
#### pomm {#pomm}
|
||||
|
||||
My package for doing Pomodoro timer.
|
||||
|
||||
```emacs-lisp
|
||||
(use-package pomm
|
||||
:straight (:host github :repo "SqrtMinusOne/pomm.el" :files (:defaults "resources"))
|
||||
;; :straight (:local-repo "~/Code/Emacs/pomm" :files (:defaults "resources"))
|
||||
:init
|
||||
(my-leader-def "ap" #'pomm)
|
||||
:config
|
||||
(setq alert-default-style 'libnotify)
|
||||
(add-hook 'pomm-on-tick-hook 'pomm-update-mode-line-string)
|
||||
(add-hook 'pomm-on-status-changed-hook 'pomm-update-mode-line-string))
|
||||
```
|
||||
|
||||
|
||||
#### <span class="org-todo done OFF">OFF</span> (OFF) Pomidor {#off--pomidor}
|
||||
|
||||
A simple pomodoro technique timer.
|
||||
|
||||
Disabled it in favour of my own package.
|
||||
|
||||
```emacs-lisp
|
||||
(use-package pomidor
|
||||
:straight t
|
||||
:disabled
|
||||
:commands (pomidor)
|
||||
:init
|
||||
(my-leader-def "aP" #'pomidor)
|
||||
|
|
@ -6889,37 +7104,6 @@ Emacs' built-in calendar. Can even calculate sunrise and sunset times.
|
|||
```
|
||||
|
||||
|
||||
### <span class="org-todo done OFF">OFF</span> (OFF) EAF {#off--eaf}
|
||||
|
||||
[Emacs Application Framework](https://github.com/manateelazycat/emacs-application-framework) provides a way to integrate PyQt applications with Emacs.
|
||||
|
||||
I've made it work, but don't find any uses cases for me at the moment
|
||||
|
||||
|
||||
#### Installation {#installation}
|
||||
|
||||
Requirements: Node >= 14
|
||||
|
||||
```bash
|
||||
pip install qtconsole markdown qrcode[pil] PyQt5 PyQtWebEngine
|
||||
```
|
||||
|
||||
|
||||
#### Config {#config}
|
||||
|
||||
```emacs-lisp
|
||||
(use-package eaf
|
||||
:straight (:host github :repo "manateelazycat/emacs-application-framework" :files ("*"))
|
||||
:init
|
||||
(use-package epc :defer t :straight t)
|
||||
(use-package ctable :defer t :straight t)
|
||||
(use-package deferred :defer t :straight t)
|
||||
:config
|
||||
(require 'eaf-evil)
|
||||
(setq eaf-evil-leader-key "SPC"))
|
||||
```
|
||||
|
||||
|
||||
### Fun {#fun}
|
||||
|
||||
|
||||
|
|
@ -6929,6 +7113,28 @@ Integration with Discord. Shows which file is being edited in Emacs.
|
|||
|
||||
In order for this to work in Guix, a service is necessary - [Discord rich presence]({{< relref "Desktop" >}}).
|
||||
|
||||
Some functions to override the displayed message:
|
||||
|
||||
```emacs-lisp
|
||||
(defun my/elcord-mask-buffer-name (name)
|
||||
(cond
|
||||
((string-match-p (rx bos (? "CAPTURE-") (= 14 num) "-" (* not-newline) ".org" eos) name)
|
||||
"<ORG-ROAM>")
|
||||
((string-match-p (rx bos (+ num) "-" (+ num) "-" (+ num) ".org" eos) name)
|
||||
"<ORG-JOURNAL>")
|
||||
((string-match-p (rx bos "EXWM") name)
|
||||
"<EXWM>")
|
||||
(t name)))
|
||||
|
||||
(defun my/elcord-buffer-details-format-functions ()
|
||||
(format "Editing %s" (my/elcord-mask-buffer-name (buffer-name))))
|
||||
|
||||
(defun my/elcord-update-presence-mask-advice (r)
|
||||
(list (my/elcord-mask-buffer-name (nth 0 r)) (nth 1 r)))
|
||||
```
|
||||
|
||||
And the package configuration:
|
||||
|
||||
```emacs-lisp
|
||||
(use-package elcord
|
||||
:straight t
|
||||
|
|
@ -6938,11 +7144,9 @@ In order for this to work in Guix, a service is necessary - [Discord rich presen
|
|||
(not my/slow-ssh)
|
||||
(not my/remote-server))
|
||||
:config
|
||||
(elcord-mode)
|
||||
(add-to-list 'elcord-boring-buffers-regexp-list
|
||||
(rx bos (+ num) "-" (+ num) "-" (+ num) ".org" eos))
|
||||
(add-to-list 'elcord-boring-buffers-regexp-list
|
||||
(rx bos (= 14 num) "-" (* not-newline) ".org" eos)))
|
||||
(setq elcord-buffer-details-format-function #'my/elcord-buffer-details-format-functions)
|
||||
(advice-add 'elcord--try-update-presence :filter-args #'my/elcord-update-presence-mask-advice)
|
||||
(elcord-mode))
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -59,11 +59,8 @@
|
|||
<hr>
|
||||
<div id="content">
|
||||
<div class="container">
|
||||
<blockquote>
|
||||
<p>One day we won’t hate one another, no young boy will march to war and I will clean up my Emacs config. But that day isn’t today.</p>
|
||||
</blockquote>
|
||||
<p>My <a href="https://www.gnu.org/software/emacs/">Emacs</a> configuration.</p>
|
||||
<p>As with other files in the repo, parts prefixed with (OFF) are not used but kept for historic purposes.</p>
|
||||
<p>#+begin_quote
|
||||
One day we won’t hate one another, no young boy will march to war and I will clean up my Emacs config. But that day isn'.</p>
|
||||
<div class="ox-hugo-toc toc">
|
||||
<div></div>
|
||||
<div class="heading">Table of Contents</div>
|
||||
|
|
@ -188,7 +185,15 @@
|
|||
<li><a href="#my-title">My title</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#modeline">Modeline</a></li>
|
||||
<li><a href="#doom-modeline">Doom Modeline</a></li>
|
||||
<li><a href="#off--spaceline"><span class="org-todo done OFF">OFF</span> (OFF) Spaceline</a>
|
||||
<ul>
|
||||
<li><a href="#perspectives">Perspectives</a></li>
|
||||
<li><a href="#exwm-workspace">EXWM workspace</a></li>
|
||||
<li><a href="#debug">Debug</a></li>
|
||||
<li><a href="#my-theme">My theme</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#font-stuff">Font stuff</a>
|
||||
<ul>
|
||||
<li><a href="#ligatures">Ligatures</a></li>
|
||||
|
|
@ -562,11 +567,13 @@
|
|||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/slow-ssh
|
||||
(or
|
||||
(string= (getenv <span style="color:#e6db74">"IS_TRAMP"</span>) <span style="color:#e6db74">"true"</span>)
|
||||
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">"dev-digital"</span>)))
|
||||
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">"dev-digital"</span>)
|
||||
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">"violet"</span>)))
|
||||
</code></pre></div><p>The following is true is Emacs is ran on a remote server where I don’t need stuff like my org workflow</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/remote-server
|
||||
(or (string= (getenv <span style="color:#e6db74">"IS_REMOTE"</span>) <span style="color:#e6db74">"true"</span>)
|
||||
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">"dev-digital"</span>)))
|
||||
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">"dev-digital"</span>)
|
||||
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">"violet"</span>)))
|
||||
</code></pre></div><p>And the following is true if Emacs is run from termux on Android.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/is-termux (string-match-p (rx (<span style="color:#a6e22e">*</span> nonl) <span style="color:#e6db74">"com.termux"</span> (<span style="color:#a6e22e">*</span> nonl)) (getenv <span style="color:#e6db74">"HOME"</span>)))
|
||||
</code></pre></div><p>Also, I sometimes need to know if a program is running inside Emacs (say, inside a terminal emulator). To do that, I set the following environment variable:</p>
|
||||
|
|
@ -624,8 +631,8 @@
|
|||
</code></pre></div><h3 id="private-config">Private config</h3>
|
||||
<p>I have some variables which I don’t commit to the repo, e.g. my current location. They are stored in <code>private.el</code></p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(let ((private-file (<span style="color:#a6e22e">expand-file-name</span> <span style="color:#e6db74">"private.el"</span> user-emacs-directory)))
|
||||
(when (<span style="color:#a6e22e">file-exists-p</span> private-file)
|
||||
(load-file private-file)))
|
||||
|
||||
(load-file private-file))
|
||||
</code></pre></div><h3 id="no-littering">No littering</h3>
|
||||
<p>By default Mmacs and its packages create a lot files in <code>.emacs.d</code> and in other places. <a href="https://github.com/emacscollective/no-littering">no-littering</a> is a collective effort to redirect all of that to two folders in <code>user-emacs-directory</code>.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package no-littering
|
||||
|
|
@ -1391,9 +1398,10 @@
|
|||
(setq company-show-numbers <span style="color:#66d9ef">t</span>))
|
||||
|
||||
(general-imap <span style="color:#e6db74">"C-SPC"</span> <span style="color:#e6db74">'company-complete</span>)
|
||||
</code></pre></div><p>A company frontend with nice icons.</p>
|
||||
</code></pre></div><p>A company frontend with nice icons. Disabled since the base company got icons support and since company-box has some issues with spaceline.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package company-box
|
||||
:straight <span style="color:#66d9ef">t</span>
|
||||
:disabled
|
||||
:if (and (display-graphic-p) (not my/lowpower))
|
||||
:after (company)
|
||||
:hook (company-mode <span style="color:#f92672">.</span> company-box-mode))
|
||||
|
|
@ -1567,11 +1575,11 @@
|
|||
<p>A custom theme is necessary because if one calls <code>custom-set-faces</code> and <code>custom-set-variables</code> in code, whenever a variable is changed and saved in a customize buffer, data from all calls of these functions is saved as well.</p>
|
||||
<p>Also, a hook allows me to change doom-theme more or less at will, although I do that only to switch to a light theme once in a blue moon.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(unless my/is-termux
|
||||
(deftheme my-theme)
|
||||
(deftheme my-theme-1)
|
||||
|
||||
(defun my/update-my-theme (<span style="color:#66d9ef">&rest</span> _)
|
||||
(custom-theme-set-faces
|
||||
<span style="color:#e6db74">'my-theme</span>
|
||||
<span style="color:#e6db74">'my-theme-1</span>
|
||||
<span style="color:#f92672">`</span>(tab-bar-tab ((<span style="color:#66d9ef">t</span> (
|
||||
:background <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'bg</span>)
|
||||
:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'yellow</span>)
|
||||
|
|
@ -1588,12 +1596,24 @@
|
|||
<span style="color:#f92672">`</span>(epe-pipeline-time-face ((<span style="color:#66d9ef">t</span> (:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'yellow</span>)))))
|
||||
<span style="color:#f92672">`</span>(epe-pipeline-user-face ((<span style="color:#66d9ef">t</span> (:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'red</span>)))))
|
||||
<span style="color:#f92672">`</span>(elfeed-search-tag-face ((<span style="color:#66d9ef">t</span> (:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'yellow</span>)))))
|
||||
<span style="color:#f92672">`</span>(notmuch-wash-cited-text ((<span style="color:#66d9ef">t</span> (:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'yellow</span>))))))
|
||||
<span style="color:#f92672">`</span>(notmuch-wash-cited-text ((<span style="color:#66d9ef">t</span> (:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'yellow</span>)))))
|
||||
<span style="color:#f92672">`</span>(spaceline-evil-emacs ((<span style="color:#66d9ef">t</span> :background <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'bg</span>)
|
||||
:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'fg</span>))))
|
||||
<span style="color:#f92672">`</span>(spaceline-evil-insert ((<span style="color:#66d9ef">t</span> :background <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'green</span>)
|
||||
:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'base0</span>))))
|
||||
<span style="color:#f92672">`</span>(spaceline-evil-motion ((<span style="color:#66d9ef">t</span> :background <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'magenta</span>)
|
||||
:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'base0</span>))))
|
||||
<span style="color:#f92672">`</span>(spaceline-evil-normal ((<span style="color:#66d9ef">t</span> :background <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'blue</span>)
|
||||
:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'base0</span>))))
|
||||
<span style="color:#f92672">`</span>(spaceline-evil-replace ((<span style="color:#66d9ef">t</span> :background <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'yellow</span>)
|
||||
:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'base0</span>))))
|
||||
<span style="color:#f92672">`</span>(spaceline-evil-visual ((<span style="color:#66d9ef">t</span> :background <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'grey</span>)
|
||||
:foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'base0</span>)))))
|
||||
(custom-theme-set-variables
|
||||
<span style="color:#e6db74">'my-theme</span>
|
||||
<span style="color:#e6db74">'my-theme-1</span>
|
||||
<span style="color:#f92672">`</span>(aweshell-invalid-command-color <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'red</span>))
|
||||
<span style="color:#f92672">`</span>(aweshell-valid-command-color <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'green</span>)))
|
||||
(enable-theme <span style="color:#e6db74">'my-theme</span>))
|
||||
(enable-theme <span style="color:#e6db74">'my-theme-1</span>))
|
||||
|
||||
(advice-add <span style="color:#e6db74">'load-theme</span> :after <span style="color:#a6e22e">#'</span>my/update-my-theme)
|
||||
(when (<span style="color:#a6e22e">fboundp</span> <span style="color:#e6db74">'doom-color</span>)
|
||||
|
|
@ -1720,8 +1740,9 @@
|
|||
(replace-regexp-in-string <span style="color:#e6db74">"<.*>"</span> <span style="color:#e6db74">""</span> (tab-bar-tab-name-current-with-count))))))
|
||||
|
||||
(setq tab-bar-tab-name-function <span style="color:#a6e22e">#'</span>my/tab-bar-name-function)
|
||||
</code></pre></div><h3 id="modeline">Modeline</h3>
|
||||
</code></pre></div><h3 id="doom-modeline">Doom Modeline</h3>
|
||||
<p>A modeline from Doom Emacs.</p>
|
||||
<p>A big advantage of this package is that it just works out of the box and does not require much customization. For now I opted out of it in favour of spaceline because I want to have a more powerline-ish look.</p>
|
||||
<p>References:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/seagle0128/doom-modeline">Doom Modeline</a></li>
|
||||
|
|
@ -1729,13 +1750,106 @@
|
|||
<!--listend-->
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package doom-modeline
|
||||
:straight <span style="color:#66d9ef">t</span>
|
||||
<span style="color:#75715e">;; :if (not (display-graphic-p))</span>
|
||||
:init
|
||||
(setq doom-modeline-env-enable-python <span style="color:#66d9ef">nil</span>)
|
||||
(setq doom-modeline-env-enable-go <span style="color:#66d9ef">nil</span>)
|
||||
(setq doom-modeline-buffer-encoding <span style="color:#e6db74">'nondefault</span>)
|
||||
(setq doom-modeline-hud <span style="color:#66d9ef">t</span>)
|
||||
:config
|
||||
(doom-modeline-mode <span style="color:#ae81ff">1</span>)
|
||||
(setq doom-modeline-minor-modes <span style="color:#66d9ef">nil</span>)
|
||||
(setq doom-modeline-buffer-state-icon <span style="color:#66d9ef">nil</span>))
|
||||
</code></pre></div><h3 id="off--spaceline"><span class="org-todo done OFF">OFF</span> (OFF) Spaceline</h3>
|
||||
<p>A modeline from Spacemacs. It provides a different look than Doom modeline, but also needs to be tuned more.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package spaceline
|
||||
:straight <span style="color:#66d9ef">t</span>
|
||||
:disabled
|
||||
:config
|
||||
<<spaceline-conf>>)
|
||||
</code></pre></div><h4 id="perspectives">Perspectives</h4>
|
||||
<p>Definining a bunch of custom powerline segments. First, a list of perspectives.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(defun my/format-perspective-list ()
|
||||
(<span style="color:#a6e22e">format</span> <span style="color:#e6db74">"[%s]"</span>
|
||||
(let ((curr (persp-current-name)))
|
||||
(<span style="color:#a6e22e">mapconcat</span>
|
||||
(lambda (name)
|
||||
(if (<span style="color:#a6e22e">string-equal</span> name curr)
|
||||
(<span style="color:#a6e22e">propertize</span>
|
||||
name
|
||||
<span style="color:#e6db74">'face</span>
|
||||
<span style="color:#e6db74">'persp-selected-face</span>)
|
||||
name))
|
||||
(persp-names)
|
||||
<span style="color:#e6db74">"|"</span>))))
|
||||
|
||||
(defvar my/spaceline-persp-list <span style="color:#e6db74">""</span>)
|
||||
|
||||
(defun my/persp-update-advice (<span style="color:#66d9ef">&rest</span> _)
|
||||
(setq my/spaceline-persp-list (my/format-perspective-list)))
|
||||
|
||||
(advice-add <span style="color:#a6e22e">#'</span>persp-update-modestring :after <span style="color:#a6e22e">#'</span>my/persp-update-advice)
|
||||
(add-hook <span style="color:#e6db74">'buffer-list-update-hook</span> <span style="color:#a6e22e">#'</span>my/persp-update-advice)
|
||||
(add-hook <span style="color:#e6db74">'find-file-hook</span> <span style="color:#a6e22e">#'</span>my/persp-update-advice)
|
||||
|
||||
(spaceline-define-segment perspective
|
||||
<span style="color:#e6db74">"Perspective.el"</span>
|
||||
my/spaceline-persp-list)
|
||||
</code></pre></div><h4 id="exwm-workspace">EXWM workspace</h4>
|
||||
<p>Current EXWM workspace. The variable is being set in the EXWM config, the segment just displays it.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(defvar my/exwm-mode-line-info-no-props <span style="color:#e6db74">""</span>)
|
||||
|
||||
(spaceline-define-segment exwm
|
||||
my/exwm-mode-line-info-no-props)
|
||||
</code></pre></div><h4 id="debug">Debug</h4>
|
||||
<p>Indicators for <code>debug-on-error</code> and <code>debug-on-quit</code>.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(spaceline-define-segment debug-on-error
|
||||
(when debug-on-error
|
||||
(<span style="color:#a6e22e">propertize</span>
|
||||
<span style="color:#e6db74">""</span>
|
||||
<span style="color:#e6db74">'face</span> <span style="color:#e6db74">'warning</span>
|
||||
<span style="color:#e6db74">'local-map</span> (let ((map (<span style="color:#a6e22e">make-sparse-keymap</span>)))
|
||||
(<span style="color:#a6e22e">define-key</span> map
|
||||
[mode-line mouse-1]
|
||||
<span style="color:#a6e22e">#'</span>toggle-debug-on-error)
|
||||
map))))
|
||||
|
||||
(spaceline-define-segment debug-on-quit
|
||||
(when debug-on-quit
|
||||
(<span style="color:#a6e22e">propertize</span>
|
||||
<span style="color:#e6db74">""</span>
|
||||
<span style="color:#e6db74">'face</span> <span style="color:#e6db74">'error</span>
|
||||
<span style="color:#e6db74">'local-map</span> (let ((map (<span style="color:#a6e22e">make-sparse-keymap</span>)))
|
||||
(<span style="color:#a6e22e">define-key</span> map
|
||||
[mode-line mouse-1]
|
||||
<span style="color:#a6e22e">#'</span>toggle-debug-on-quit)
|
||||
map))))
|
||||
</code></pre></div><h4 id="my-theme">My theme</h4>
|
||||
<p>And a custom spaceline config with segments I like.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(require <span style="color:#e6db74">'spaceline-config</span>)
|
||||
|
||||
(spaceline-compile
|
||||
<span style="color:#e6db74">"my"</span>
|
||||
<span style="color:#f92672">'</span>((evil-state :priority <span style="color:#ae81ff">100</span> :face (spaceline-highlight-face-evil-state))
|
||||
(buffer-modified :priority <span style="color:#ae81ff">50</span>)
|
||||
(version-control :priority <span style="color:#ae81ff">25</span> :when active)
|
||||
(buffer-id :priority <span style="color:#ae81ff">90</span>))
|
||||
<span style="color:#f92672">'</span>(<span style="color:#75715e">;; (global)</span>
|
||||
(exwm :when active)
|
||||
(perspective :when active)
|
||||
(flycheck-error :when active)
|
||||
(flycheck-warning :when active)
|
||||
(debug-on-error :when active)
|
||||
(debug-on-quit :when active)
|
||||
(major-mode :when active :priority <span style="color:#ae81ff">90</span>)
|
||||
(selection-info :priority <span style="color:#ae81ff">95</span>)
|
||||
(line-column :when active :priority <span style="color:#ae81ff">99</span>)
|
||||
(hud :when active :priority <span style="color:#ae81ff">99</span>)))
|
||||
|
||||
(spaceline-ml-my)
|
||||
|
||||
(setq-default mode-line-format <span style="color:#f92672">'</span>(<span style="color:#e6db74">"%e"</span> (:eval (spaceline-ml-my))))
|
||||
(setq mode-line-format <span style="color:#f92672">'</span>(<span style="color:#e6db74">"%e"</span> (:eval (spaceline-ml-my))))
|
||||
</code></pre></div><h3 id="font-stuff">Font stuff</h3>
|
||||
<h4 id="ligatures">Ligatures</h4>
|
||||
<p>Ligature setup for the JetBrainsMono font.</p>
|
||||
|
|
@ -2859,7 +2973,16 @@
|
|||
<span style="color:#f92672">`</span>((<span style="color:#e6db74">"d"</span> <span style="color:#e6db74">"default"</span> plain <span style="color:#e6db74">"%?"</span>
|
||||
:if-new (file+head <span style="color:#e6db74">"%<%Y%m%d%H%M%S>-${slug}.org"</span> <span style="color:#e6db74">"#+title: ${title}\n"</span>)
|
||||
:unnarrowed <span style="color:#66d9ef">t</span>)))
|
||||
(require <span style="color:#e6db74">'org-roam-protocol</span>))
|
||||
(require <span style="color:#e6db74">'org-roam-protocol</span>)
|
||||
(general-define-key
|
||||
:keymaps <span style="color:#e6db74">'org-roam-mode-map</span>
|
||||
:states <span style="color:#f92672">'</span>(normal)
|
||||
<span style="color:#e6db74">"TAB"</span> <span style="color:#a6e22e">#'</span>magit-section-toggle
|
||||
<span style="color:#e6db74">"q"</span> <span style="color:#a6e22e">#'</span>quit-window
|
||||
<span style="color:#e6db74">"k"</span> <span style="color:#a6e22e">#'</span>magit-section-backward
|
||||
<span style="color:#e6db74">"j"</span> <span style="color:#a6e22e">#'</span>magit-section-forward
|
||||
<span style="color:#e6db74">"gr"</span> <span style="color:#a6e22e">#'</span>revert-buffer
|
||||
<span style="color:#e6db74">"RET"</span> <span style="color:#a6e22e">#'</span>org-roam-buffer-visit-thing))
|
||||
|
||||
(my-leader-def
|
||||
:infix <span style="color:#e6db74">"or"</span>
|
||||
|
|
@ -3378,6 +3501,8 @@ MimeType=x-scheme-handler/org-protocol
|
|||
<span style="color:#75715e">;; (csharp-mode . lsp)</span>
|
||||
)
|
||||
:commands lsp
|
||||
:init
|
||||
(setq lsp-keymap-prefix <span style="color:#66d9ef">nil</span>)
|
||||
:config
|
||||
(setq lsp-idle-delay <span style="color:#ae81ff">1</span>)
|
||||
(setq lsp-eslint-server-command <span style="color:#f92672">'</span>(<span style="color:#e6db74">"node"</span> <span style="color:#e6db74">"/home/pavel/.emacs.d/.cache/lsp/eslint/unzipped/extension/server/out/eslintServer.js"</span> <span style="color:#e6db74">"--stdio"</span>))
|
||||
|
|
@ -4869,14 +4994,14 @@ MimeType=x-scheme-handler/org-protocol
|
|||
</code></pre></div><p>Also a function to automatically adjust these colors with the Doom theme.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(defun my/update-my-theme-elfeed (<span style="color:#66d9ef">&rest</span> _)
|
||||
(custom-theme-set-faces
|
||||
<span style="color:#e6db74">'my-theme</span>
|
||||
<span style="color:#e6db74">'my-theme-1</span>
|
||||
<span style="color:#f92672">`</span>(elfeed-videos-entry ((<span style="color:#66d9ef">t</span> :foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'red</span>))))
|
||||
<span style="color:#f92672">`</span>(elfeed-twitter-entry ((<span style="color:#66d9ef">t</span> :foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'blue</span>))))
|
||||
<span style="color:#f92672">`</span>(elfeed-emacs-entry ((<span style="color:#66d9ef">t</span> :foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'magenta</span>))))
|
||||
<span style="color:#f92672">`</span>(elfeed-music-entry ((<span style="color:#66d9ef">t</span> :foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'green</span>))))
|
||||
<span style="color:#f92672">`</span>(elfeed-podcasts-entry ((<span style="color:#66d9ef">t</span> :foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'yellow</span>))))
|
||||
<span style="color:#f92672">`</span>(elfeed-blogs-entry ((<span style="color:#66d9ef">t</span> :foreground <span style="color:#f92672">,</span>(doom-color <span style="color:#e6db74">'orange</span>)))))
|
||||
(enable-theme <span style="color:#e6db74">'my-theme</span>))
|
||||
(enable-theme <span style="color:#e6db74">'my-theme-1</span>))
|
||||
|
||||
(advice-add <span style="color:#e6db74">'load-theme</span> :after <span style="color:#a6e22e">#'</span>my/update-my-theme-elfeed)
|
||||
(when (<span style="color:#a6e22e">fboundp</span> <span style="color:#e6db74">'doom-color</span>)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ if [ -z &#34;$IS_ANDROID&#34; ]; then GUIX_EXTRA_PROFILES=$HOME/.guix-ex
|
|||
<guid>https://sqrtminusone.xyz/configs/desktop/</guid>
|
||||
<description>My general desktop environment configuration.
|
||||
Parts prefixed with (OFF) are not used, but kept for historic purposes. For some reason GitHub&rsquo;s org renderer ignores TODO status, hence such a prefix. Round brackets instead of square ones to prevent GitHub&rsquo;s org renderer from screwing up.
|
||||
Table of Contents Global customization Colors Xresources Colors in Xresources Fonts Themes Device-specific settings EXWM Xsession Startup apps Moving windows Resizing windows App shortcuts Move workspace to another monitor Switch to the opposite monitor Switching buffers Add all EXWM buffers to current perspective Revive perspectives Locking up Keybindings Pinentry Modeline EXWM config i3wm General settings Managing windows Workspaces Rules Scratchpad Launch script i3 config Gaps &amp; borders Keybindings Move &amp; resize windows OFF (OFF) Intergration with dmenu Integration with rofi Launching apps &amp; misc keybindings Apps Media controls &amp; brightness Screenshots Colors OFF (OFF) i3blocks Keyboard Layout Autostart Polybar Launching General settings Colors Bar config Modules ipstack-vpn weather aw-afk pomm sun SEP TSEP i3 xkeyboard mpd pulseaudio cpu ram-memory swap-memory network date battery Rofi Theme Scripts Buku bookmarks Man pages Emojis pass Flameshot dunst keynav Config Using with picom Picom Shadows Fading Opacity General settings Zathura Various software Browsers Office &amp; Multimedia LaTeX Dev Manifests Flatpak Nix Services Music GNU Mcron ActivityWatch PulseEffects xsettingsd nm-applet Discord rich presence Polkit Authentication agent Xmodmap VPN Davmail Shepherd config Sync Guix settings Global customization Colors Most of the colors are from the Palenight theme.</description>
|
||||
Table of Contents Global customization Colors Xresources Colors in Xresources Fonts Themes Device-specific settings EXWM Xsession Startup apps Moving windows Resizing windows App shortcuts Move workspace to another monitor Switch to the opposite monitor Switching buffers Add all EXWM buffers to current perspective Revive perspectives Locking up Keybindings Pinentry Modeline EXWM config i3wm General settings Managing windows Workspaces Rules Scratchpad Launch script i3 config Gaps &amp; borders Keybindings Move &amp; resize windows OFF (OFF) Intergration with dmenu Integration with rofi Launching apps &amp; misc keybindings Apps Media controls &amp; brightness Screenshots Colors OFF (OFF) i3blocks Keyboard Layout Autostart Polybar General settings Colors Glyphs Modules Global bar config Launch script Individual modules pulseaudio mpd cpu ram-memory swap-memory network ipstack-vpn openvpn xkeyboard battery weather sun aw-afk date pomm SEP TSEP i3 Rofi Theme Scripts Buku bookmarks Man pages Emojis pass Flameshot dunst keynav Config Using with picom Picom Shadows Fading Opacity General settings Zathura Various software Browsers Office &amp; Multimedia LaTeX Dev Manifests Flatpak Nix Services Music GNU Mcron ActivityWatch PulseEffects xsettingsd nm-applet Discord rich presence Polkit Authentication agent Xmodmap VPN Davmail Shepherd config Sync Guix settings Global customization Colors Most of the colors are from the Palenight theme.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
|
|
@ -36,9 +36,7 @@ Parts prefixed with (OFF) are not used, but kept for historic purposes. For some
|
|||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||||
|
||||
<guid>https://sqrtminusone.xyz/configs/emacs/</guid>
|
||||
<description>One day we won&rsquo;t hate one another, no young boy will march to war and I will clean up my Emacs config. But that day isn&rsquo;t today.
|
||||
My Emacs configuration.
|
||||
As with other files in the repo, parts prefixed with (OFF) are not used but kept for historic purposes.
|
||||
<description>#+begin_quote One day we won&rsquo;t hate one another, no young boy will march to war and I will clean up my Emacs config. But that day isn'.
|
||||
Table of Contents Primary setup Measure startup speed straight.el use-package Config variants &amp; environment Performance Garbage collection Run garbage collection when Emacs is unfocused Native compilation Anaconda Custom file location Private config No littering Prevent Emacs from closing Global editing configuration General keybindings stuff general.</description>
|
||||
</item>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue