Compare commits
7 Commits
504bdc17f3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d324fd71af | ||
|
|
7749ecdb22 | ||
|
|
5dcafcc8e8 | ||
|
|
102eef308f | ||
|
|
f394d004ff | ||
|
|
fcfe3504d8 | ||
|
|
ef825d4544 |
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +0,0 @@
|
||||
[submodule "Pictures/Pictures/Backgrounds"]
|
||||
path = Pictures/Pictures/Backgrounds
|
||||
url = https://gitlab.com/odavep/Wallpapers
|
||||
@@ -8,7 +8,7 @@ AlignEscapedNewlines: true
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AllowShortLambdasOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
AlwaysBreakTemplateDeclarations: No
|
||||
BasedOnStyle: LLVM
|
||||
BreakBeforeBraces: Allman
|
||||
ColumnLimit: 80
|
||||
|
||||
1
Emacs/.config/emacs/.config/gdb-window-config
Normal file
1
Emacs/.config/emacs/.config/gdb-window-config
Normal file
@@ -0,0 +1 @@
|
||||
(((min-height . 12) (min-width . 20) (min-height-ignore . 9) (min-width-ignore . 6) (min-height-safe . 3) (min-width-safe . 4) (min-pixel-height . 288) (min-pixel-width . 200) (min-pixel-height-ignore . 216) (min-pixel-width-ignore . 60) (min-pixel-height-safe . 72) (min-pixel-width-safe . 40)) hc (pixel-width . 1910) (pixel-height . 1025) (total-width . 191) (total-height . 43) (normal-height . 1.0) (normal-width . 1.0) (combination-limit) (leaf (pixel-width . 880) (pixel-height . 1025) (total-width . 88) (total-height . 43) (normal-height . 1.0) (normal-width . 0.46073298429319376) (parameters (context) (gdb-buffer-type . source)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 1) (start . 1))) (vc (last . t) (pixel-width . 1030) (pixel-height . 1025) (total-width . 103) (total-height . 43) (normal-height . 1.0) (normal-width . 0.5392670157068062) (combination-limit) (leaf (pixel-width . 1030) (pixel-height . 360) (total-width . 103) (total-height . 15) (normal-height . 0.35121951219512193) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . gdb-breakpoints-buffer)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated . t) (point . 1) (start . 1))) (leaf (pixel-width . 1030) (pixel-height . 336) (total-width . 103) (total-height . 14) (normal-height . 0.3278048780487805) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . command)) (buffer " *gdb-placeholder*" (selected) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 1) (start . 1))) (leaf (last . t) (pixel-width . 1030) (pixel-height . 329) (total-width . 103) (total-height . 14) (normal-height . 0.32097560975609757) (normal-width . 1.0) (parameters (context) (gdb-buffer-type . gdb-inferior-io)) (buffer " *gdb-placeholder*" (selected . t) (hscroll . 0) (fringes 10 0 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated . t) (point . 1) (start . 1)))))
|
||||
@@ -225,41 +225,45 @@ must be preserved for any operation suggested by the above.
|
||||
(defun +cfg/--make-clean-buffer-alist ()
|
||||
(cl-loop with assoc-list = nil
|
||||
for buffer in (buffer-list)
|
||||
for dir = (+cfg/--get-dir-or-project-dir buffer)
|
||||
if (assoc dir assoc-list #'string=)
|
||||
do (setf (cdr (assoc dir assoc-list #'string=))
|
||||
if (null (assoc (buffer-name buffer) +cfg/clean-buffers-keep))
|
||||
do
|
||||
(let ((dir (+cfg/--get-dir-or-project-dir buffer)))
|
||||
(if (assoc dir assoc-list #'string=)
|
||||
(setf (cdr (assoc dir assoc-list #'string=))
|
||||
(cons buffer (cdr (assoc dir assoc-list #'string=))))
|
||||
else do (setf assoc-list (cons (list dir buffer) assoc-list))
|
||||
(setf assoc-list (cons (list dir buffer) assoc-list))))
|
||||
finally (return assoc-list)))
|
||||
|
||||
(defun +cfg/clean-buffers (&optional arg)
|
||||
"Kill all buffers except any with names in CLEAN-BUFFERS-KEEP."
|
||||
(interactive "P")
|
||||
"Attempt to clean buffers based on `arg' and `+cfg/clean-buffers-keep'.
|
||||
Buffers that match any of `+cfg/clean-buffers-keep' are not cleaned. Rules for
|
||||
how buffers are picked:
|
||||
|
||||
1) If no arg passed, interactively pick a directory to kill, then kill all
|
||||
buffers in that directory.
|
||||
|
||||
2) If a single universal argument (C-u) or 4 is passed, kill the directory
|
||||
of the current focused buffer.
|
||||
|
||||
3) If two universal arguments (C-u C-u) or 16 is passed, attempt to kill all
|
||||
buffers."
|
||||
(interactive "p")
|
||||
(let ((buffer-alist (+cfg/--make-clean-buffer-alist))
|
||||
(items nil)
|
||||
(should-not-kill
|
||||
#'(lambda (buf) (member (buffer-name buf) +cfg/clean-buffers-keep))))
|
||||
(cond
|
||||
((null arg)
|
||||
(let ((choice (completing-read "Choose directory to kill: "
|
||||
(mapcar #'car buffer-alist)
|
||||
nil t)))
|
||||
(setq items (cdr (assoc choice buffer-alist #'string=)))))
|
||||
((and (listp arg)
|
||||
(eq 4 (car arg)))
|
||||
(setq items
|
||||
(thread-first (current-buffer)
|
||||
(+cfg/--get-dir-or-project-dir )
|
||||
(let ((items
|
||||
(pcase arg
|
||||
(1 (thread-first "Choose directory to kill: "
|
||||
(completing-read (mapcar #'car buffer-alist) nil t)
|
||||
(assoc buffer-alist #'string=)
|
||||
(cdr))))
|
||||
((and (listp arg)
|
||||
(eq 16 (car arg)))
|
||||
(setq items (buffer-list))))
|
||||
|
||||
(cdr)))
|
||||
(4 (thread-first (current-buffer)
|
||||
(+cfg/--get-dir-or-project-dir)
|
||||
(assoc buffer-alist #'string=)
|
||||
(cdr)))
|
||||
(16 (buffer-list)))))
|
||||
(message "[clean-buffers]: Cleaning %d buffers" (length items))
|
||||
(thread-last items
|
||||
(cl-remove-if should-not-kill)
|
||||
(mapc #'kill-buffer))))
|
||||
(mapc #'kill-buffer items))))
|
||||
#+end_src
|
||||
** Custom window management
|
||||
Emacs has a window management system unlike any other piece of
|
||||
@@ -384,7 +388,7 @@ completely while still setting a reasonable font size. Best part? It
|
||||
works for any theme!
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defvar +cfg/default-font-size 140)
|
||||
(defvar +cfg/default-font-size 120)
|
||||
|
||||
(defvar +cfg/boost-size 1)
|
||||
|
||||
@@ -663,7 +667,9 @@ system directly, rather than me explain every setting.
|
||||
"zC" #'hs-hide-level
|
||||
"zO" #'hs-show-all
|
||||
"M-," #'evil-jump-backward
|
||||
"M-." #'evil-jump-forward)
|
||||
"M-." #'evil-jump-forward
|
||||
"gf" #'evil-find-file-at-point-with-line
|
||||
"gF" #'find-file-at-point)
|
||||
|
||||
(:states '(normal motion visual)
|
||||
:keymaps 'override
|
||||
@@ -1015,40 +1021,51 @@ it takes a bit less time.
|
||||
|
||||
Here I:
|
||||
- Bind ~project-prefix-map~ to "<leader>p"
|
||||
- Bind a tags generation command to "<leader>pr" which mimics
|
||||
projectile's one
|
||||
- Define ~+project/generate-tags~ to generate ctags quickly (like
|
||||
=projectile=), and bind it.
|
||||
- Define ~+project/rgrep~, which does an [[*Grep][rgrep]] from the
|
||||
project root.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package project
|
||||
:straight t
|
||||
:defer t
|
||||
:general
|
||||
(:keymaps 'project-prefix-map
|
||||
"r" #'+project/generate-tags)
|
||||
(leader
|
||||
"p" project-prefix-map)
|
||||
(:keymaps 'project-prefix-map
|
||||
"r" #'+project/generate-tags
|
||||
"g" #'+project/rgrep)
|
||||
:config
|
||||
(setq project-vc-extra-root-markers '(".project"))
|
||||
(defun +project/command (folder)
|
||||
(format "ctags -Re -f %sTAGS %s*"
|
||||
folder folder))
|
||||
|
||||
(defun +project/root ()
|
||||
(if (project-current)
|
||||
(project-root (project-current))
|
||||
default-directory))
|
||||
|
||||
(autoload #'grep-read-regexp "grep")
|
||||
(autoload #'grep-read-files "grep")
|
||||
(autoload #'rgrep "grep")
|
||||
(defun +project/rgrep (regexp &optional files)
|
||||
(interactive
|
||||
(let* ((regexp (grep-read-regexp))
|
||||
(files (grep-read-files regexp)))
|
||||
(list regexp files)))
|
||||
(rgrep regexp files (+project/root)))
|
||||
|
||||
(defun +project/generate-tags ()
|
||||
(interactive)
|
||||
(let ((folder (+project/root)))
|
||||
(set-process-sentinel
|
||||
(start-process-shell-command
|
||||
"PROJECT-GENERATE-TAGS"
|
||||
"*tags*"
|
||||
(+project/command (+project/root)))
|
||||
(format "ctags -Re -f %sTAGS %s*" folder folder))
|
||||
(lambda (p event)
|
||||
(when (string= event "finished\n")
|
||||
(message "Finished generating tags!")
|
||||
(visit-tags-table (format "%sTAGS" (+project/root))))))))
|
||||
(visit-tags-table (format "%sTAGS" folder))))))))
|
||||
#+end_src
|
||||
* Aesthetics
|
||||
General look and feel of Emacs, perhaps the most important of all the
|
||||
@@ -1192,9 +1209,12 @@ dired-rsync is being used"
|
||||
better-mode-line/centre-segment
|
||||
'("%+" ;; Buffer state (changed or not)
|
||||
"%b" ;; Buffer name
|
||||
"(" ;; Major mode
|
||||
(:eval
|
||||
(if (mode-line-window-selected-p) ;; Major Mode
|
||||
'("("
|
||||
(:eval (format "%s" major-mode))
|
||||
")")
|
||||
")")))
|
||||
)
|
||||
better-mode-line/right-segment
|
||||
'((:eval
|
||||
(when (mode-line-window-selected-p)
|
||||
@@ -1357,16 +1377,11 @@ enables it in all but the minibuffer.
|
||||
:defer t
|
||||
:general
|
||||
(mode-leader
|
||||
"o" #'olivetti-global-mode)
|
||||
"o" #'olivetti-mode)
|
||||
:init
|
||||
(setq-default olivetti-body-width nil
|
||||
olivetti-minimum-body-width 100
|
||||
olivetti-style nil)
|
||||
:config
|
||||
(define-globalized-minor-mode olivetti-global-mode olivetti-mode
|
||||
(lambda nil (unless (or (minibufferp)
|
||||
(string= (buffer-name) "*which-key*"))
|
||||
(olivetti-mode 1)))))
|
||||
olivetti-style nil))
|
||||
#+end_src
|
||||
** All the Icons
|
||||
Nice set of icons, for even more emojis.
|
||||
@@ -1663,7 +1678,6 @@ Here I setup dired with a few niceties
|
||||
:hook
|
||||
(dired-mode-hook . auto-revert-mode)
|
||||
(dired-mode-hook . dired-hide-details-mode)
|
||||
(dired-mode-hook . dired-omit-mode)
|
||||
:init
|
||||
(setq-default dired-listing-switches "-AFBlu --group-directories-first"
|
||||
dired-omit-files "^\\." ; dotfiles
|
||||
@@ -1889,6 +1903,8 @@ really cool.
|
||||
"L" #'image-dired-display-next
|
||||
"RET" #'image-dired-display-this
|
||||
"m" #'image-dired-mark-thumb-original-file
|
||||
"u" #'image-dired-unmark-thumb-original-file
|
||||
"U" #'image-dired-unmark-all-marks
|
||||
"q" #'quit-window))
|
||||
#+end_src
|
||||
*** wdired
|
||||
@@ -2509,15 +2525,11 @@ playing.
|
||||
("SomaFM - The Trip" . "http://www.somafm.com/thetrip.pls"))))
|
||||
#+end_src
|
||||
** Grand Unified Debugger (GUD)
|
||||
GUD is a system for debugging, hooking into processes and
|
||||
providing an interface to the user all in Emacs. Here I define a
|
||||
hydra which provides a ton of the useful =gud= keybindings that exist
|
||||
in an Emacs-only map.
|
||||
GUD is a system for debugging, hooking into processes and providing an
|
||||
interface to the user all in Emacs. Here I define a hydra for the
|
||||
various =gud= keybindings, to make debugging a bit less painful.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package gud
|
||||
:config
|
||||
(evil-set-initial-state 'gdb-disassembly-mode 'motion)
|
||||
(evil-set-initial-state 'gdb-registers-mode 'motion)
|
||||
:after hydra
|
||||
:hydra
|
||||
(gud-hydra
|
||||
@@ -2553,8 +2565,66 @@ in an Emacs-only map.
|
||||
("TAB" #'gud-stepi "Stepi"
|
||||
:column "Control Flow"))
|
||||
:general
|
||||
(code-leader "d" #'gud-hydra/body
|
||||
"D" #'gdb))
|
||||
(code-leader
|
||||
"d" #'gud-hydra/body))
|
||||
#+end_src
|
||||
** GDB
|
||||
GDB is a little wrapper on top of GUD for GDB specific functionality.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package gud
|
||||
:after hydra
|
||||
:init
|
||||
(setopt gdb-default-window-configuration-file
|
||||
(no-littering-expand-etc-file-name "gdb-window-config")
|
||||
gdb-restore-window-configuration-after-quit t)
|
||||
:config
|
||||
(evil-set-initial-state 'gdb-disassembly-mode 'motion)
|
||||
(evil-set-initial-state 'gdb-registers-mode 'motion)
|
||||
(evil-set-initial-state 'gdb-locals-mode 'motion)
|
||||
(evil-set-initial-state 'gdb-frames-mode 'motion)
|
||||
(evil-set-initial-state 'gdb-threads-mode 'motion)
|
||||
(evil-set-initial-state 'gdb-breakpoints-mode 'motion)
|
||||
|
||||
(defun +gdb/switch-buffer (type)
|
||||
(interactive)
|
||||
(gdb-set-window-buffer
|
||||
(gdb-get-buffer-create type gdb-thread-number)
|
||||
t))
|
||||
|
||||
(cl-loop for type in '(gdb-locals-buffer
|
||||
gdb-registers-buffer
|
||||
gdb-stack-buffer
|
||||
gdb-breakpoints-buffer
|
||||
gdb-threads-buffer)
|
||||
for name = (intern (concat "+gdb/--switch-" (symbol-name type)))
|
||||
do (eval `(defun ,name ()
|
||||
(interactive)
|
||||
(+gdb/switch-buffer ',type))))
|
||||
:hydra
|
||||
(gdb-buffer-hydra
|
||||
() "Hydra for the various buffers GDB generates"
|
||||
("l" #'+gdb/--switch-gdb-locals-buffer "locals")
|
||||
("r" #'+gdb/--switch-gdb-registers-buffer "registers")
|
||||
("f" #'+gdb/--switch-gdb-stack-buffer "frames")
|
||||
("b" #'+gdb/--switch-gdb-breakpoints-buffer "breakpoints")
|
||||
("t" #'+gdb/--switch-gdb-threads-buffer "threads")
|
||||
("ESC" nil "Exit" :exit t))
|
||||
:general
|
||||
(code-leader
|
||||
"g" #'gdb)
|
||||
(local-leader
|
||||
:keymaps 'gud-mode-map
|
||||
"m" #'gdb-many-windows)
|
||||
(nmmap
|
||||
:keymaps 'gdb-frames-mode-map
|
||||
"RET" #'gdb-select-frame)
|
||||
(nmmap
|
||||
:keymaps '(gdb-locals-mode-map
|
||||
gdb-registers-mode-map
|
||||
gdb-frames-mode-map
|
||||
gdb-breakpoints-mode-map
|
||||
gdb-threads-mode-map)
|
||||
"TAB" #'gdb-buffer-hydra/body))
|
||||
#+end_src
|
||||
** Jira
|
||||
#+begin_src emacs-lisp
|
||||
@@ -3421,47 +3491,6 @@ For bibliographic stuff in $\LaTeX$ export.
|
||||
bibtex-completion-bibliography '("~/Text/bibliography.bib")
|
||||
bibtex-completion-additional-search-fields '(keywords)))
|
||||
#+end_src
|
||||
** Makefile
|
||||
Defines an auto-insert for Makefiles. Assumes C but it's very easy to
|
||||
change it for C++.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package make-mode
|
||||
:defer t
|
||||
:auto-insert
|
||||
(("[mM]akefile\\'" . "Makefile skeleton")
|
||||
""
|
||||
"CC=gcc
|
||||
OUT=main.out
|
||||
LIBS=
|
||||
ARGS=
|
||||
|
||||
RELEASE=0
|
||||
GFLAGS=-Wall -Wextra -Werror -Wswitch-enum -std=c11
|
||||
DFLAGS=-ggdb -fsanitize=address -fsanitize=undefined
|
||||
RFLAGS=-O3
|
||||
ifeq ($(RELEASE), 1)
|
||||
CFLAGS=$(GFLAGS) $(RFLAGS)
|
||||
else
|
||||
CFLAGS=$(GFLAGS) $(DFLAGS)
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: $(OUT)
|
||||
|
||||
$(OUT): main.c
|
||||
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
|
||||
|
||||
.PHONY: run
|
||||
run: $(OUT)
|
||||
./$^ $(ARGS)
|
||||
|
||||
.PHONY:
|
||||
clean:
|
||||
rm -v $(OUT)
|
||||
"
|
||||
_))
|
||||
#+end_src
|
||||
** WAIT SQL
|
||||
:PROPERTIES:
|
||||
:header-args:emacs-lisp: :tangle no :results none
|
||||
@@ -4429,22 +4458,23 @@ A little helper function to instantly mark anything I paste.
|
||||
(nmmap
|
||||
"g C-v" #'+evil/select-pasted))
|
||||
#+end_src
|
||||
** gptel
|
||||
** LLM stuff
|
||||
LLMs in my Emacs?? What kind of developer have I become!
|
||||
|
||||
I came kinda late to the party with AI and LLM usage for development -
|
||||
I did try them out much earlier near 2022-2023 but found them
|
||||
obtrusive to use. They didn't integrate into my workflow well and
|
||||
providing the context necessary for some of the problems I was facing
|
||||
was, in and of itself, a gargantuan task.
|
||||
|
||||
~gptel~ changes that in quite a dramatic way: incredibly smooth
|
||||
integration of LLMs into my Emacs instance. Some things this package
|
||||
does:
|
||||
was, in and of itself, a gargantuan task. This isn't the case
|
||||
anymore.
|
||||
*** gptel
|
||||
~gptel~ provides incredibly smooth integration of LLMs into my Emacs
|
||||
instance. I'd consider this the main interface I use for
|
||||
communicating with LLMs nowadays. Some things this package does:
|
||||
- Call an LLM from any buffer in Emacs: from code buffers, to a
|
||||
dedicated chat buffer, even [[*EShell][EShell]]!
|
||||
- Maintain large persistent conversations just by saving the
|
||||
conversation to disc
|
||||
conversation to disc as a normal text file
|
||||
- Use ~org-mode~ for conversations, so generated code is actually in
|
||||
clean source code blocks
|
||||
- Allows one to slickly use all options available via one transient
|
||||
@@ -4500,6 +4530,44 @@ source code blocks."
|
||||
|
||||
(add-hook 'gptel-post-response-functions #'gptel-auto-fill-response))
|
||||
#+end_src
|
||||
*** minuet
|
||||
Minuet provides LLM powered completion-at-point to Emacs. This is the
|
||||
one thing that I can't use ~gptel~ for.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package minuet
|
||||
:straight (:host github :repo "milanglacier/minuet-ai.el")
|
||||
:bind
|
||||
(("M-y" . #'minuet-complete-with-minibuffer) ;; use minibuffer for completion
|
||||
("M-i" . #'minuet-show-suggestion)) ;; use overlay for completion
|
||||
:bind
|
||||
(:map minuet-active-mode-map
|
||||
;; These keymaps activate only when a minuet suggestion is displayed in the current buffer
|
||||
("M-k" . #'minuet-previous-suggestion) ;; invoke completion or cycle to next completion
|
||||
("M-j" . #'minuet-next-suggestion) ;; invoke completion or cycle to previous completion
|
||||
("M-SPC" . #'minuet-accept-suggestion) ;; accept whole completion
|
||||
;; Accept the first line of completion, or N lines with a numeric-prefix:
|
||||
;; e.g. C-u 2 M-a will accepts 2 lines of completion.
|
||||
("M-a" . #'minuet-accept-suggestion-line)
|
||||
("M-e" . #'minuet-dismiss-suggestion))
|
||||
:init
|
||||
(add-hook 'minuet-active-mode-hook #'evil-normalize-keymaps)
|
||||
:config
|
||||
(setq minuet-provider 'openai-fim-compatible)
|
||||
(setq minuet-n-completions 1) ; recommended for Local LLM for resource saving
|
||||
;; I recommend beginning with a small context window size and incrementally
|
||||
;; expanding it, depending on your local computing power. A context window
|
||||
;; of 512, serves as an good starting point to estimate your computing
|
||||
;; power. Once you have a reliable estimate of your local computing power,
|
||||
;; you should adjust the context window to a larger value.
|
||||
(setq minuet-context-window 1024)
|
||||
(plist-put minuet-openai-fim-compatible-options :end-point "http://localhost:11434/v1/completions")
|
||||
;; an arbitrary non-null environment variable as placeholder.
|
||||
;; For Windows users, TERM may not be present in environment variables.
|
||||
;; Consider using APPDATA instead.
|
||||
(plist-put minuet-openai-fim-compatible-options :name "Ollama")
|
||||
(plist-put minuet-openai-fim-compatible-options :api-key "TERM")
|
||||
(plist-put minuet-openai-fim-compatible-options :model "qwen2.5-coder"))
|
||||
#+end_src
|
||||
** Save place
|
||||
Saves current place in a buffer permanently, so on revisiting the file
|
||||
(even in a different Emacs instance) you go back to the place you were
|
||||
|
||||
@@ -38,20 +38,21 @@
|
||||
(defvar bml/--minimum-padding 4
|
||||
"Minimum size of padding string.")
|
||||
|
||||
(defun bml/--get-padding-size (other-size)
|
||||
"Compute length of padding to ensure string of size OTHER-SIZE is on an
|
||||
extreme end to CENTRE-SEGMENT."
|
||||
(let ((centre-size (length (format-mode-line bml/centre-segment)))
|
||||
(window-width ;; compute total width of window (including margins)
|
||||
(thread-last (cons (window-width) (window-margins))
|
||||
(mapcar (lambda (x) (if (null x) 0 x)))
|
||||
(defun bml/--get-left-padding-size ()
|
||||
(let* ((left-segment-size (length (format-mode-line bml/left-segment)))
|
||||
(centre-size (length (format-mode-line bml/centre-segment)))
|
||||
(window-margins (window-margins))
|
||||
(window-width (thread-last
|
||||
(cons (window-width)
|
||||
(if (null (car window-margins))
|
||||
(list 0)
|
||||
(list (car window-margins) (cdr window-margins))))
|
||||
(cl-reduce #'+))))
|
||||
(floor (- (/ window-width 2) (/ centre-size 2) other-size))))
|
||||
(floor (- (/ window-width 2) (/ centre-size 2) left-segment-size))))
|
||||
|
||||
(defun bml/--generate-padding (segment)
|
||||
(defun bml/--generate-left-padding ()
|
||||
"Make padding string to separate center segment from SEGMENT."
|
||||
(let* ((segment-size (length (format-mode-line segment)))
|
||||
(padding-size (bml/--get-padding-size segment-size)))
|
||||
(let ((padding-size (bml/--get-left-padding-size)))
|
||||
(make-string (max padding-size bml/--minimum-padding) ?\s)))
|
||||
|
||||
(defun bml/setup-mode-line ()
|
||||
@@ -60,8 +61,7 @@ extreme end to CENTRE-SEGMENT."
|
||||
- segments are updated."
|
||||
(setq-default mode-line-format
|
||||
`(,bml/left-segment
|
||||
(:eval (bml/--generate-padding
|
||||
bml/left-segment))
|
||||
(:eval (bml/--generate-left-padding))
|
||||
,bml/centre-segment
|
||||
;; NOTE: Emacs 30!
|
||||
mode-line-format-right-align
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
"NeoSolarized": { "branch": "master", "commit": "b94b1a9ad51e2de015266f10fdc6e142f97bd617" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" }
|
||||
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" }
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
feh --bg-fill --randomize $HOME/Pictures/Backgrounds;
|
||||
choice=$(shuf < $HOME/Pictures/Backgrounds/dark.txt | head -1)
|
||||
# feh --bg-fill --randomize $HOME/Pictures/Backgrounds;
|
||||
feh --bg-fill $HOME/Pictures/Backgrounds/$choice;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
scrot -f -s '%Y%m%d_%H%M%S.png' -e 'mv $f ~/Pictures/';
|
||||
gscreenshot;
|
||||
|
||||
@@ -2,8 +2,5 @@
|
||||
|
||||
app=$(wmctrl -l |\
|
||||
awk '{for (i=4; i<=NF; i++) printf "%s ", $i; print ""}' |\
|
||||
dmenu -i -p "Switch to: ")
|
||||
if [ ! -z "$app" ]
|
||||
then
|
||||
wmctrl -a $app
|
||||
fi
|
||||
dmenu -l 4 -i -p "Switch to: ")
|
||||
[ ! -z "$app" ] && $(wmctrl -a $app)
|
||||
|
||||
@@ -4,8 +4,7 @@ processes="st btop
|
||||
emacsclient -c -a emacs
|
||||
$HOME/.local/scripts/browser
|
||||
steam
|
||||
discord
|
||||
spotify"
|
||||
"
|
||||
|
||||
|
||||
printf '%s\n' "$processes" | \
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
echo "㊋ $(sensors | grep "Core" | sed 's/Core [0-9]:[ ]*+//;s/C.*//' | sort -r | head -1)C"
|
||||
echo "㊋ $(sensors | grep "Tctl" | sed 's/Tctl:.*+//;s/C.*//')C"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
killall sxhkd;
|
||||
|
||||
sh .xprofile;
|
||||
$HOME/.local/scripts/screentimer on;
|
||||
$HOME/.local/scripts/screentimer off;
|
||||
|
||||
xrandr --output HDMI1 --auto --mode 1920x1080 --left-of eDP1;
|
||||
xrandr --output eDP1 --auto --mode 1920x1080;
|
||||
@@ -14,7 +14,6 @@ $(xss-lock --transfer-sleep-lock -- $HOME/.local/scripts/lock) &
|
||||
sxhkd &
|
||||
dunst &
|
||||
dwmblocks &
|
||||
# $HOME/.local/scripts/compositor &
|
||||
$HOME/.local/scripts/background &
|
||||
|
||||
while :
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
personal_ws-1.1 en 192
|
||||
personal_ws-1.1 en 194
|
||||
Architecting
|
||||
Aryadev
|
||||
Automorphism
|
||||
@@ -113,6 +113,7 @@ incentivises
|
||||
infinitum
|
||||
injective
|
||||
inlined
|
||||
innovatively
|
||||
instrinsics
|
||||
intuitionism
|
||||
intuitionist
|
||||
@@ -179,6 +180,7 @@ telekinetically
|
||||
tokenisation
|
||||
tokenise
|
||||
tokeniser
|
||||
transformative
|
||||
uncomputable
|
||||
uncountably
|
||||
undealt
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1013 KiB After Width: | Height: | Size: 997 KiB |
Reference in New Issue
Block a user