From 72f3a9364569fbb5caa94b578f6c4ee12d47671f Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 11:39:46 +0200 Subject: [PATCH 01/75] Use MPV as the default player for OGG/Opus audio files --- .config/mimeapps.list | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/mimeapps.list b/.config/mimeapps.list index ff1ce92..0ec11bb 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -10,6 +10,8 @@ application/xhtml+xml=userapp-Firefox-RJEWT1.desktop application/x-extension-xhtml=userapp-Firefox-RJEWT1.desktop application/x-extension-xht=userapp-Firefox-RJEWT1.desktop x-scheme-handler/magnet=userapp-transmission-gtk-BAUQU2.desktop +audio/ogg=mpv.desktop +audio/x-opus+ogg=mpv.desktop [Added Associations] x-scheme-handler/http=userapp-Firefox-RJEWT1.desktop; From 531a16fa93ba0257fc15c738ca06db12d9b03d1f Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 11:42:22 +0200 Subject: [PATCH 02/75] Declare a quadlet file for an Ollama server --- .config/containers/systemd/ollama.container | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .config/containers/systemd/ollama.container diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container new file mode 100644 index 0000000..a9082b9 --- /dev/null +++ b/.config/containers/systemd/ollama.container @@ -0,0 +1,13 @@ +[Unit] +Description=A local LLM server + +[Container] +ContainerName=ollama +Image=docker.io/ollama/ollama:latest +PublishPort=11434:11434 + +[Install] +WantedBy=multi-user.target + +[Service] +Restart=always From 59e54f3d5bf44154bb036da153a4f8f1417e5f69 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 11:47:40 +0200 Subject: [PATCH 03/75] Synchronize branch and tag metadata by default --- .config/emacs/transient/values.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/emacs/transient/values.el b/.config/emacs/transient/values.el index c77d63e..e9662fa 100644 --- a/.config/emacs/transient/values.el +++ b/.config/emacs/transient/values.el @@ -2,6 +2,7 @@ ; keep-sorted start (magit-commit "--gpg-sign=") (magit-diff:magit-revision-mode "--no-ext-diff" "--stat" "--show-signature") + (magit-fetch "--force" "--prune" "--tags") (magit-log:magit-log-mode "-n256" "--graph" "--decorate" "--show-signature") (magit-merge "--gpg-sign=") (magit-tag "--sign") From 0010f1381f97350243ed8055c11cff3ad6a1e8c6 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 11:48:08 +0200 Subject: [PATCH 04/75] Wrap long lines in chat interaction for convenience --- .config/emacs/init.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 0be5a4f..1b015b7 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -307,6 +307,8 @@ ) (use-package gptel + :hook + (gptel-mode . visual-line-mode) :custom ; keep-sorted start (gptel-backend (gptel-get-backend "Claude")) From e80759441be148c67ba97058a0b3d59dd07e5afc Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 11:48:32 +0200 Subject: [PATCH 05/75] Allow gptel to use the Ollama server --- .config/emacs/init.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 1b015b7..9459afa 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -320,6 +320,10 @@ :stream t :key 'gptel-api-key-from-auth-source ) + (gptel-make-ollama "Ollama" + :stream t + :models '(llama3.2:latest) + ) ) (use-package power-mode) From 35603603d5ba8b85502af3099a054693dde3ff69 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 11:48:48 +0200 Subject: [PATCH 06/75] Make Ollama the default backend for gptel --- .config/emacs/init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 9459afa..92c6b6d 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -311,9 +311,9 @@ (gptel-mode . visual-line-mode) :custom ; keep-sorted start - (gptel-backend (gptel-get-backend "Claude")) + (gptel-backend (gptel-get-backend "Ollama")) (gptel-default-mode 'org-mode) - (gptel-model 'claude-3-5-haiku-20241022) + (gptel-model 'llama3.2:latest) ; keep-sorted end :preface (gptel-make-anthropic "Claude" From b15a0d70d11b4edcbfcb7d5dd0d3d2579410df37 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 17:30:15 +0200 Subject: [PATCH 07/75] Personalize chat UX more --- .config/emacs/init.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 92c6b6d..e3a988b 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -308,11 +308,17 @@ (use-package gptel :hook + ; keep-sorted start + (gptel-mode . gptel-highlight-mode) (gptel-mode . visual-line-mode) + (gptel-post-response . gptel-end-of-response) + (gptel-post-stream . gptel-auto-scroll) + ; keep-sorted end :custom ; keep-sorted start (gptel-backend (gptel-get-backend "Ollama")) (gptel-default-mode 'org-mode) + (gptel-highlight-methods '(face margin)) (gptel-model 'llama3.2:latest) ; keep-sorted end :preface From 8a0698f5b4f137e24a264b5c5ff1ae113eda8cbd Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 17:45:04 +0200 Subject: [PATCH 08/75] Keep the models in a persistent volume --- .config/containers/systemd/ollama.container | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container index a9082b9..4c6b9e9 100644 --- a/.config/containers/systemd/ollama.container +++ b/.config/containers/systemd/ollama.container @@ -2,12 +2,18 @@ Description=A local LLM server [Container] +# keep-sorted start ContainerName=ollama Image=docker.io/ollama/ollama:latest PublishPort=11434:11434 +Volume=%h/.local/share/ollama:/root/.ollama:Z +# keep-sorted end [Install] WantedBy=multi-user.target [Service] +# keep-sorted start +ExecStartPre=mkdir -p %h/.local/share/ollama Restart=always +# keep-sorted end From a3208b9deff5b6b9e1ef597404b98e79d141c6fe Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 20:43:19 +0200 Subject: [PATCH 09/75] Create a dedicated script to manage local models --- .local/bin/podllama | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 .local/bin/podllama diff --git a/.local/bin/podllama b/.local/bin/podllama new file mode 100755 index 0000000..947b0d0 --- /dev/null +++ b/.local/bin/podllama @@ -0,0 +1,9 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +mkdir --parents ~/.local/share/ollama/ +pod_id=$(podman run --detach --rm --volume ~/.local/share/ollama/:/root/.ollama ollama:latest) +podman exec --interactive --tty "${pod_id}" ollama "$@" +podman kill "${pod_id}" > /dev/null From a6fee6113fd6e7e49cd4192bf445a1c38193d630 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 20:43:55 +0200 Subject: [PATCH 10/75] Revoke unnecessary filesystem permissions for the server --- .config/containers/systemd/ollama.container | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container index 4c6b9e9..fc91619 100644 --- a/.config/containers/systemd/ollama.container +++ b/.config/containers/systemd/ollama.container @@ -6,7 +6,7 @@ Description=A local LLM server ContainerName=ollama Image=docker.io/ollama/ollama:latest PublishPort=11434:11434 -Volume=%h/.local/share/ollama:/root/.ollama:Z +Volume=%h/.local/share/ollama:/root/.ollama:ro,z # keep-sorted end [Install] From 2bf4debbc3f836a9b92e45360935f971617f1831 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 12 Nov 2025 21:00:27 +0200 Subject: [PATCH 11/75] Isolate the LLM server from the internet --- .config/containers/systemd/ollama.container | 1 + .config/containers/systemd/ollama.network | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 .config/containers/systemd/ollama.network diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container index fc91619..6ae7f6c 100644 --- a/.config/containers/systemd/ollama.container +++ b/.config/containers/systemd/ollama.container @@ -5,6 +5,7 @@ Description=A local LLM server # keep-sorted start ContainerName=ollama Image=docker.io/ollama/ollama:latest +Network=ollama.network PublishPort=11434:11434 Volume=%h/.local/share/ollama:/root/.ollama:ro,z # keep-sorted end diff --git a/.config/containers/systemd/ollama.network b/.config/containers/systemd/ollama.network new file mode 100644 index 0000000..5f8c30b --- /dev/null +++ b/.config/containers/systemd/ollama.network @@ -0,0 +1,5 @@ +[Unit] +Description=Isolated network for my local LLM server + +[Network] +Internal=true From 57a4aa4d2d2808e889a66ae0330099d615016e73 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 15 Nov 2025 16:35:19 +0200 Subject: [PATCH 12/75] Query the Ollama server for the list of installed models --- .config/emacs/init.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index e3a988b..152bc40 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -306,6 +306,14 @@ auto-mode-alist)) ) +(defun list-ollama-models () + "Query the local Ollama server for the list of installed models." + (condition-case error-var + (mapcar #'intern (mapcar #'car (mapcar #'split-string (cdr (process-lines "podllama" "list"))))) + (error + (message "Failed to list local models: %s" error-var) + ()))) + (use-package gptel :hook ; keep-sorted start @@ -328,7 +336,7 @@ ) (gptel-make-ollama "Ollama" :stream t - :models '(llama3.2:latest) + :models (list-ollama-models) ) ) From cfb0642bcd7c958f52d2b98d5696d5920bb14a01 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 15 Nov 2025 16:34:36 +0200 Subject: [PATCH 13/75] Display advanced options in the gptel menu --- .config/emacs/init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 152bc40..ddd01e1 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -326,6 +326,7 @@ ; keep-sorted start (gptel-backend (gptel-get-backend "Ollama")) (gptel-default-mode 'org-mode) + (gptel-expert-commands t) (gptel-highlight-methods '(face margin)) (gptel-model 'llama3.2:latest) ; keep-sorted end From 57ea018567282d1dfa9326b4aa8e3f8c54267183 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 15 Nov 2025 16:33:31 +0200 Subject: [PATCH 14/75] Start the Ollama server automatically on boot --- .config/containers/systemd/ollama.container | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container index 6ae7f6c..b6475ab 100644 --- a/.config/containers/systemd/ollama.container +++ b/.config/containers/systemd/ollama.container @@ -11,7 +11,7 @@ Volume=%h/.local/share/ollama:/root/.ollama:ro,z # keep-sorted end [Install] -WantedBy=multi-user.target +WantedBy=default.target [Service] # keep-sorted start From 5fa742407e7d9c92b698db3e8fd2efd5728fded2 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 15 Nov 2025 21:29:19 +0200 Subject: [PATCH 15/75] Support restricted one-off uses of language models --- .local/bin/podllama | 52 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/.local/bin/podllama b/.local/bin/podllama index 947b0d0..ae723dc 100755 --- a/.local/bin/podllama +++ b/.local/bin/podllama @@ -3,7 +3,53 @@ set -euo pipefail IFS=$'\n\t' +if ! PARSED_OPTIONS=$(getopt -o "" --long "offline,volatile" --name "$0" -- "$@"); then + echo "Error parsing options." >&2 + exit 1 +fi + +eval set -- "$PARSED_OPTIONS" + +offline=false +volatile=false + +while true; do + case "$1" in + --offline) + offline=true + shift + ;; + --volatile) + volatile=true + shift + ;; + --) + shift + break + ;; + *) + echo "Internal error!" >&2 + exit 1 + ;; + esac +done + mkdir --parents ~/.local/share/ollama/ -pod_id=$(podman run --detach --rm --volume ~/.local/share/ollama/:/root/.ollama ollama:latest) -podman exec --interactive --tty "${pod_id}" ollama "$@" -podman kill "${pod_id}" > /dev/null + +if [[ "true" == "${volatile}" ]]; then + PODMAN=(podman --transient-store) + MOUNTS=() +else + PODMAN=(podman) + MOUNTS=(--volume ~/.local/share/ollama/:/root/.ollama) +fi + +if [[ "true" == "${offline}" ]]; then + NETWORK=(--network none) +else + NETWORK=() +fi + +pod_id=$("${PODMAN[@]}" run --detach --rm "${MOUNTS[@]}" "${NETWORK[@]}" ollama:latest) +"${PODMAN[@]}" exec --interactive --tty "${pod_id}" ollama "$@" +"${PODMAN[@]}" kill "${pod_id}" > /dev/null From f6e80c0ba5cbc7087a6c418a90793e53cc9c1b59 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sun, 16 Nov 2025 23:15:12 +0200 Subject: [PATCH 16/75] Use conventional commenting style for Emacs Lisp --- .config/emacs/init.el | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index ddd01e1..f85632f 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -32,7 +32,7 @@ ) load-path)) :config - ; keep-sorted start + ;; keep-sorted start (defalias 'yes-or-no-p 'y-or-n-p) (display-battery-mode) (display-time-mode) @@ -42,9 +42,9 @@ (put 'dired-find-alternate-file 'disabled nil) (set-default-file-modes #o750) (windmove-default-keybindings 'super) - ; keep-sorted end + ;; keep-sorted end :custom - ; keep-sorted start + ;; keep-sorted start (auto-save-interval 20) (auto-save-visited-mode t) (auto-save-visited-predicate #'should-auto-save-current-buffer) @@ -57,7 +57,7 @@ (inhibit-startup-screen t) (show-paren-context-when-offscreen 'overlay) (xref-search-program 'ripgrep) - ; keep-sorted end + ;; keep-sorted end ) (use-package diminish) @@ -75,10 +75,10 @@ ("" . dired-subtree-cycle) ("" . dired-subtree-remove)) :config - ; keep-sorted start + ;; keep-sorted start (defadvice dired-subtree-cycle (after add-icons activate) (revert-buffer)) (defadvice dired-subtree-toggle (after add-icons activate) (revert-buffer)) - ; keep-sorted end + ;; keep-sorted end :custom (dired-subtree-use-backgrounds nil)) @@ -157,7 +157,7 @@ ("M-." . org-open-at-point) ("M-," . org-mark-ring-goto)) :custom - ; keep-sorted start block=yes + ;; keep-sorted start block=yes (org-agenda-start-on-weekday 0) (org-agenda-weekend-days '(5 6)) (org-default-notes-file "~/Documents/notes.org") @@ -172,7 +172,7 @@ "** TODO %?\n %U") )) (org-clock-sound "~/Music/single-ding.wav") - ; keep-sorted end + ;; keep-sorted end ) (use-package org-contrib) @@ -244,10 +244,10 @@ (flymake-show-diagnostics-at-end-of-line t) ) -; Note: debugging Python in a virtualenv requires debugpy to be installed inside the venv +;; Note: debugging Python in a virtualenv requires debugpy to be installed inside the venv (use-package dape) -; Requires poetry to be installed +;; Requires poetry to be installed (use-package poetry) (defun load-python-env () @@ -278,10 +278,10 @@ :config (require 'ein-notebook) :custom - ; keep-sorted start + ;; keep-sorted start (ein:jupyter-default-notebook-directory "~/Projects/notebooks") (ein:output-area-inlined-images t) - ; keep-sorted end + ;; keep-sorted end ) (use-package direnv @@ -316,20 +316,20 @@ (use-package gptel :hook - ; keep-sorted start + ;; keep-sorted start (gptel-mode . gptel-highlight-mode) (gptel-mode . visual-line-mode) (gptel-post-response . gptel-end-of-response) (gptel-post-stream . gptel-auto-scroll) - ; keep-sorted end + ;; keep-sorted end :custom - ; keep-sorted start + ;; keep-sorted start (gptel-backend (gptel-get-backend "Ollama")) (gptel-default-mode 'org-mode) (gptel-expert-commands t) (gptel-highlight-methods '(face margin)) (gptel-model 'llama3.2:latest) - ; keep-sorted end + ;; keep-sorted end :preface (gptel-make-anthropic "Claude" :stream t @@ -348,10 +348,10 @@ (require 'emms-setup) (emms-all) :custom - ; keep-sorted start + ;; keep-sorted start (emms-info-functions '(emms-info-native)) (emms-player-list '(emms-player-mpv)) - ; keep-sorted end + ;; keep-sorted end ) (defun my-qr-selection () From 8a410a884a0c09812434488e99ff25b853f5f32a Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sun, 16 Nov 2025 23:18:34 +0200 Subject: [PATCH 17/75] Reenable autoformatting for Emacs Lisp --- .config/emacs/init.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index f85632f..5a0c5b2 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -217,7 +217,6 @@ (use-package apheleia :config (apheleia-global-mode) - (setf (alist-get 'emacs-lisp-mode apheleia-mode-alist nil 'remove) nil) (setf (alist-get 'ruff-isort apheleia-formatters) '("ruff" "check" "-n" @@ -236,10 +235,10 @@ (use-package flymake :ensure nil :bind (:map flymake-mode-map - ("C-c C-l" . flymake-show-buffer-diagnostics) - ("C-x C-l" . flymake-show-project-diagnostics) - ("C-c C-n" . flymake-goto-next-error) - ("C-c C-p" . flymake-goto-prev-error)) + ("C-c C-l" . flymake-show-buffer-diagnostics) + ("C-x C-l" . flymake-show-project-diagnostics) + ("C-c C-n" . flymake-goto-next-error) + ("C-c C-p" . flymake-goto-prev-error)) :custom (flymake-show-diagnostics-at-end-of-line t) ) From 1c32a13a6668d74e69d2d1aac2a492e8a309c17f Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sun, 16 Nov 2025 22:59:20 +0200 Subject: [PATCH 18/75] Compose a library of known local models --- .config/emacs/site-lisp/local-models.el | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .config/emacs/site-lisp/local-models.el diff --git a/.config/emacs/site-lisp/local-models.el b/.config/emacs/site-lisp/local-models.el new file mode 100644 index 0000000..cddf6e8 --- /dev/null +++ b/.config/emacs/site-lisp/local-models.el @@ -0,0 +1,37 @@ +(defconst gptel--local-models + '( + ;; keep-sorted start + ( + hf.co/Orenguteng/Llama-3.1-8B-Lexi-Uncensored-V2-GGUF:latest + :description "Uncensored model based on Llama-3.1-8b-Instruct" + :context-window 128 + :cutoff-date "2023-12" + ) + ( + hf.co/TheBloke/MythoMax-L2-13B-GGUF:latest + :description "Proficient at both roleplaying and storywriting" + :context-window 32 + ) + ( + hf.co/bartowski/cognitivecomputations_Dolphin-Mistral-24B-Venice-Edition-GGUF:latest + :description "Uncensored version of Mistral 24B" + :context-window 32 + :cutoff-date "2023-10" + ) + ( + llama3.2:latest + :description "Instruction-tuned model optimized for multilingual dialogue" + :context-window 128 + :cutoff-date "2023-12" + ) + ( + mollysama/rwkv-7-g0a3:13.3b + :description "Pure RNN reasoning model, suitable for post-training and fine-tuning" + :context-window 1000 + :cutoff-date "2023-10" + ) + ;; keep-sorted end + ) + "List of known local models and associated properties. +Refer to https://gptel.org/manual.html#models for a description of supported properties" + ) From 8ba847a72c1243b92dc37a5ba12f594dfa498e75 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Mon, 17 Nov 2025 00:17:26 +0200 Subject: [PATCH 19/75] Enrich the Ollama models list with metadata for known models --- .config/emacs/init.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 5a0c5b2..5a3e8cb 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -313,6 +313,13 @@ (message "Failed to list local models: %s" error-var) ()))) +(defun enrich-ollama-models (available library) + "Enrich the available models with metadata from the library of known models." + (mapcar + (lambda (model) + (seq-find (lambda (x) (eq (car x) model)) library model)) + available)) + (use-package gptel :hook ;; keep-sorted start @@ -330,13 +337,14 @@ (gptel-model 'llama3.2:latest) ;; keep-sorted end :preface + (load "local-models.el") (gptel-make-anthropic "Claude" :stream t :key 'gptel-api-key-from-auth-source ) (gptel-make-ollama "Ollama" :stream t - :models (list-ollama-models) + :models (enrich-ollama-models (list-ollama-models) gptel--local-models) ) ) From 361dc8d96f96d3e5fc58cf97f29f2652a66c2eda Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Mon, 17 Nov 2025 22:32:05 +0200 Subject: [PATCH 20/75] Rely on pipx's built-in upgrade capabilities --- .local/bin/upgrade | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.local/bin/upgrade b/.local/bin/upgrade index 95784aa..5ce5ba5 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -17,10 +17,7 @@ cargo_update() { } pipx_update() { - for venv in $(pipx list --json | jq --raw-output ".venvs | keys[]") - do - pipx upgrade "${venv}" - done + pipx upgrade-all } git_sync_update() { From 7a091e7a6c89fb3d034f1faf564cceea4fd9cb46 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Mon, 17 Nov 2025 23:21:31 +0200 Subject: [PATCH 21/75] Add an Emacs Lisp lexical binding cookie --- .config/emacs/site-lisp/local-models.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/emacs/site-lisp/local-models.el b/.config/emacs/site-lisp/local-models.el index cddf6e8..2af6bd6 100644 --- a/.config/emacs/site-lisp/local-models.el +++ b/.config/emacs/site-lisp/local-models.el @@ -1,3 +1,5 @@ +;; -*- lexical-binding: t; -*- + (defconst gptel--local-models '( ;; keep-sorted start From 6e59be6d0a46e60c88b65fe4217c1732d934cf9d Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Mon, 17 Nov 2025 22:47:21 +0200 Subject: [PATCH 22/75] Allow sharing configurations between host and containers --- .config/emacs/init.el | 1 + .config/environment.d/ollama.conf | 3 +++ .config/hosts | 1 + 3 files changed, 5 insertions(+) create mode 100644 .config/environment.d/ollama.conf create mode 100644 .config/hosts diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 5a3e8cb..497d7d8 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -343,6 +343,7 @@ :key 'gptel-api-key-from-auth-source ) (gptel-make-ollama "Ollama" + :host "ollama:11434" :stream t :models (enrich-ollama-models (list-ollama-models) gptel--local-models) ) diff --git a/.config/environment.d/ollama.conf b/.config/environment.d/ollama.conf new file mode 100644 index 0000000..6105efa --- /dev/null +++ b/.config/environment.d/ollama.conf @@ -0,0 +1,3 @@ +# keep-sorted start +HOSTALIASES=~/.config/hosts +# keep-sorted end diff --git a/.config/hosts b/.config/hosts new file mode 100644 index 0000000..4aa6d0b --- /dev/null +++ b/.config/hosts @@ -0,0 +1 @@ +ollama localhost From 438bcafcea48ff5861ef4e411af7deff7b14d421 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Mon, 17 Nov 2025 23:45:11 +0200 Subject: [PATCH 23/75] Retrieve model list directly from the Ollama server --- .config/emacs/init.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 497d7d8..0da29e5 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -307,11 +307,12 @@ (defun list-ollama-models () "Query the local Ollama server for the list of installed models." - (condition-case error-var - (mapcar #'intern (mapcar #'car (mapcar #'split-string (cdr (process-lines "podllama" "list"))))) - (error - (message "Failed to list local models: %s" error-var) - ()))) + (let* ((tags-buffer (url-retrieve-synchronously "http://ollama:11434/api/tags")) + (raw-response (with-current-buffer tags-buffer (buffer-string))) + (tags-payload (nth 1 (split-string raw-response "\n\n"))) + (models (gethash "models" (json-parse-string tags-payload))) + (model-names (mapcar (lambda (model) (gethash "name" model)) models))) + model-names)) (defun enrich-ollama-models (available library) "Enrich the available models with metadata from the library of known models." From 940c45450a4ea6b10c92e5ffe02c6301d961c05e Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 13 Nov 2025 00:15:04 +0200 Subject: [PATCH 24/75] Give the vault container access to the Ollama server --- .local/bin/vaulter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/vaulter b/.local/bin/vaulter index f12dd73..4409d0e 100755 --- a/.local/bin/vaulter +++ b/.local/bin/vaulter @@ -11,5 +11,5 @@ podman --transient-store run --rm -ti \ --mount type=bind,readonly=true,source="$(systemd-path user)"/.keys/vaults,target=/root/.age/key \ --mount type=bind,readonly=true,source="$(systemd-path user)"/.keys/vaults.pub,target=/root/.age/key.pub \ --mount type=bind,source="$(systemd-path user)"/Vaults,target=/root/Vaults \ - --network none \ + --network systemd-ollama \ vaulter:latest From 9bf2f9985a6671c44645f3e8a28891171d824066 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Tue, 18 Nov 2025 08:51:16 +0200 Subject: [PATCH 25/75] Share the local model library into the vault container --- .local/bin/vaulter | 1 + 1 file changed, 1 insertion(+) diff --git a/.local/bin/vaulter b/.local/bin/vaulter index 4409d0e..876832f 100755 --- a/.local/bin/vaulter +++ b/.local/bin/vaulter @@ -8,6 +8,7 @@ podman --transient-store run --rm -ti \ --env XDG_RUNTIME_DIR=/tmp \ --hostname localhost \ --mount type=bind,source="${XDG_RUNTIME_DIR}"/"${WAYLAND_DISPLAY}",target=/tmp/"${WAYLAND_DISPLAY}" \ + --mount type=bind,source="$(systemd-path user-configuration)"/emacs/site-lisp/local-models.el,target=/root/.config/emacs/site-lisp/local-models.el \ --mount type=bind,readonly=true,source="$(systemd-path user)"/.keys/vaults,target=/root/.age/key \ --mount type=bind,readonly=true,source="$(systemd-path user)"/.keys/vaults.pub,target=/root/.age/key.pub \ --mount type=bind,source="$(systemd-path user)"/Vaults,target=/root/Vaults \ From b4a0b26b08908d63783d0f5a9ee5bfd646b82b67 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Tue, 18 Nov 2025 23:40:13 +0200 Subject: [PATCH 26/75] Add Devstral to the model library --- .config/emacs/site-lisp/local-models.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/emacs/site-lisp/local-models.el b/.config/emacs/site-lisp/local-models.el index 2af6bd6..93635a9 100644 --- a/.config/emacs/site-lisp/local-models.el +++ b/.config/emacs/site-lisp/local-models.el @@ -20,6 +20,11 @@ :context-window 32 :cutoff-date "2023-10" ) + ( + hf.co/unsloth/Devstral-Small-2507-GGUF:latest + :description "Agentic LLM for software engineering tasks" + :context-window 128 + ) ( llama3.2:latest :description "Instruction-tuned model optimized for multilingual dialogue" From 4bdeed109e81ded50465aae047b415968bad4b24 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Tue, 18 Nov 2025 23:42:28 +0200 Subject: [PATCH 27/75] Switch to a more powerful default model --- .config/emacs/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 0da29e5..abf0b8e 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -335,7 +335,7 @@ (gptel-default-mode 'org-mode) (gptel-expert-commands t) (gptel-highlight-methods '(face margin)) - (gptel-model 'llama3.2:latest) + (gptel-model 'hf.co/unsloth/Devstral-Small-2507-GGUF:latest) ;; keep-sorted end :preface (load "local-models.el") From 9691cf9c0393a146a76a7c1d9f1ae3e720337184 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Tue, 18 Nov 2025 23:43:13 +0200 Subject: [PATCH 28/75] Make the default system prompt more fun --- .config/emacs/init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index abf0b8e..260b76f 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -331,6 +331,7 @@ ;; keep-sorted end :custom ;; keep-sorted start + (gptel--system-message "You are a sassy, sharp-tongued personal assistant. I need you to assist me in crafting responses to questions, dripping with acerbic wit and sarcasm.") (gptel-backend (gptel-get-backend "Ollama")) (gptel-default-mode 'org-mode) (gptel-expert-commands t) From 2f8d1338f0e5b6fae7379927969ac601da2ed42a Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 20 Nov 2025 15:18:14 +0200 Subject: [PATCH 29/75] Run the transmission client inside a contained service --- .../containers/systemd/transmission.container | 26 +++++++++++++++++++ .config/setup/04-install-deb-packages.sh | 1 - 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .config/containers/systemd/transmission.container diff --git a/.config/containers/systemd/transmission.container b/.config/containers/systemd/transmission.container new file mode 100644 index 0000000..ca3190e --- /dev/null +++ b/.config/containers/systemd/transmission.container @@ -0,0 +1,26 @@ +[Unit] +Description=Transmission client service with web interface on localhost:9091 + +[Container] +# keep-sorted start +ContainerName=transmission +Environment=PGID=1000 +Environment=PUID=1000 +Image=lscr.io/linuxserver/transmission:latest +Network=host +PublishPort=51413:51413 +PublishPort=51413:51413/udp +PublishPort=9091:9091 +UserNS=keep-id +Volume=%h/.config/transmission:/config:Z +Volume=%h/Downloads/transmission/watch:/watch:ro,Z +Volume=%h/Downloads/transmission:/downloads:Z +# keep-sorted end + +[Install] +WantedBy=default.target + +[Service] +# keep-sorted start +Restart=always +# keep-sorted end diff --git a/.config/setup/04-install-deb-packages.sh b/.config/setup/04-install-deb-packages.sh index d1e8af7..c96ba44 100755 --- a/.config/setup/04-install-deb-packages.sh +++ b/.config/setup/04-install-deb-packages.sh @@ -83,7 +83,6 @@ DEB_PKGS=( syncthing thunderbolt-tools timidity - transmission udisks2 unar unrar-free From 0e2558c7e82a86942709cbc4e986a623b99c99a3 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Tue, 2 Dec 2025 15:26:19 +0200 Subject: [PATCH 30/75] Correctly set company mode --- .config/emacs/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 260b76f..f2fa2f4 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -196,7 +196,7 @@ ) (use-package company - :init (global-company-mode) + :config (global-company-mode) :diminish company-mode) (use-package apt-mode From d5f373e563e705d248a21a4c8d3c1aa24541caf1 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Tue, 2 Dec 2025 21:47:57 +0200 Subject: [PATCH 31/75] Enable spellchecking in Emacs buffers --- .config/emacs/init.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index f2fa2f4..29ca4e5 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -23,8 +23,14 @@ :bind (("C-z" . nil) ("C-z i" . find-init-file) ("C-z f" . ffap)) - :hook ((after-save . executable-make-buffer-file-executable-if-script-p) - (xref-after-update . outline-minor-mode)) + :hook ( + ;; keep-sorted start + (after-save . executable-make-buffer-file-executable-if-script-p) + (prog-mode . flyspell-prog-mode) + (text-mode . flyspell-mode) + (xref-after-update . outline-minor-mode) + ;; keep-sorted end + ) :init (setq load-path (append (list (expand-file-name "~/.config/emacs/site-lisp/") From 83124524a4c46f575c993594c950b5f8a61b3766 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 3 Dec 2025 18:29:05 +0200 Subject: [PATCH 32/75] Fix model listing logic --- .config/emacs/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 29ca4e5..0441264 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -318,7 +318,7 @@ (tags-payload (nth 1 (split-string raw-response "\n\n"))) (models (gethash "models" (json-parse-string tags-payload))) (model-names (mapcar (lambda (model) (gethash "name" model)) models))) - model-names)) + (mapcar #'intern model-names))) (defun enrich-ollama-models (available library) "Enrich the available models with metadata from the library of known models." From beb0dad96b619fd11e72d564266e00ce5ad37304 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 3 Dec 2025 18:34:41 +0200 Subject: [PATCH 33/75] Add Gemma 3 to the model library --- .config/emacs/site-lisp/local-models.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/emacs/site-lisp/local-models.el b/.config/emacs/site-lisp/local-models.el index 93635a9..9822d10 100644 --- a/.config/emacs/site-lisp/local-models.el +++ b/.config/emacs/site-lisp/local-models.el @@ -3,6 +3,12 @@ (defconst gptel--local-models '( ;; keep-sorted start + ( + gemma3:latest + :description "A model from Google built on Gemini technology" + :context-window 128 + :cutoff-date "2024-08" + ) ( hf.co/Orenguteng/Llama-3.1-8B-Lexi-Uncensored-V2-GGUF:latest :description "Uncensored model based on Llama-3.1-8b-Instruct" From 04b33b52099e27d37a3e8e5835bc47a7ac7690b0 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 3 Dec 2025 18:24:25 +0200 Subject: [PATCH 34/75] Automatically update the list of Ollama models --- .config/emacs/init.el | 12 +++++++----- .local/bin/podllama | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 0441264..c911572 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -327,6 +327,12 @@ (seq-find (lambda (x) (eq (car x) model)) library model)) available)) +(defun generate-ollama-declaration () + (gptel-make-ollama "Ollama" + :host "ollama:11434" + :stream t + :models (enrich-ollama-models (list-ollama-models) gptel--local-models))) + (use-package gptel :hook ;; keep-sorted start @@ -350,11 +356,7 @@ :stream t :key 'gptel-api-key-from-auth-source ) - (gptel-make-ollama "Ollama" - :host "ollama:11434" - :stream t - :models (enrich-ollama-models (list-ollama-models) gptel--local-models) - ) + (generate-ollama-declaration) ) (use-package power-mode) diff --git a/.local/bin/podllama b/.local/bin/podllama index ae723dc..2f9393e 100755 --- a/.local/bin/podllama +++ b/.local/bin/podllama @@ -53,3 +53,5 @@ fi pod_id=$("${PODMAN[@]}" run --detach --rm "${MOUNTS[@]}" "${NETWORK[@]}" ollama:latest) "${PODMAN[@]}" exec --interactive --tty "${pod_id}" ollama "$@" "${PODMAN[@]}" kill "${pod_id}" > /dev/null + +emacsclient --eval "(generate-ollama-declaration)" From bd24c42bffe93b7ab847e4b30dbab7ff753d843b Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 3 Dec 2025 19:17:11 +0200 Subject: [PATCH 35/75] Add capabilities to the model library --- .config/emacs/site-lisp/local-models.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/emacs/site-lisp/local-models.el b/.config/emacs/site-lisp/local-models.el index 9822d10..ac695eb 100644 --- a/.config/emacs/site-lisp/local-models.el +++ b/.config/emacs/site-lisp/local-models.el @@ -6,12 +6,15 @@ ( gemma3:latest :description "A model from Google built on Gemini technology" + :capabilities (media tool-use cache) + :mime-types ("image/bmp" "image/gif" "image/jpeg" "image/png" "image/tiff" "image/webp") :context-window 128 :cutoff-date "2024-08" ) ( hf.co/Orenguteng/Llama-3.1-8B-Lexi-Uncensored-V2-GGUF:latest :description "Uncensored model based on Llama-3.1-8b-Instruct" + :capabilities (tool-use cache) :context-window 128 :cutoff-date "2023-12" ) @@ -28,12 +31,14 @@ ) ( hf.co/unsloth/Devstral-Small-2507-GGUF:latest + :capabilities (json tool-use cache) :description "Agentic LLM for software engineering tasks" :context-window 128 ) ( llama3.2:latest :description "Instruction-tuned model optimized for multilingual dialogue" + :capabilities (tool-use cache) :context-window 128 :cutoff-date "2023-12" ) From bd11213d96e78b6160353b52094284e11b490837 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 4 Dec 2025 22:45:12 +0200 Subject: [PATCH 36/75] Include Go binaries in $PATH --- .profile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.profile b/.profile index c1e9129..1e7ee3e 100644 --- a/.profile +++ b/.profile @@ -30,6 +30,10 @@ if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi +if [ -d "$(go env GOBIN)" ] ; then + PATH="$(go env GOBIN):$PATH" +fi + # Install the git-sync script if [ -d "$(systemd-path user-state-private)"/git-sync ] ; then PATH="$(systemd-path user-state-private)/git-sync:$PATH" From d1e322aa5e0b74f5a76ed85ad5c8d706c4d32567 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 4 Dec 2025 22:48:24 +0200 Subject: [PATCH 37/75] Update pre-commit hooks --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2d32394..d5b6fff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,13 +10,13 @@ repos: exclude: ^\.config/fcitx5/ - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.13.1 + rev: v0.14.8 hooks: - id: ruff args: [ --fix ] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.18.2 + rev: v1.19.0 hooks: - id: mypy - repo: https://github.com/syntaqx/git-hooks @@ -29,6 +29,6 @@ repos: hooks: - id: detect-secrets - repo: https://github.com/google/keep-sorted - rev: v0.6.0 + rev: v0.7.1 hooks: - id: keep-sorted From da8aab4084123382dd3e84b894a87b261b6a887e Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 6 Dec 2025 21:03:44 +0200 Subject: [PATCH 38/75] Alias docker->podman to support container-based pre-commit hooks --- .local/bin/docker | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 .local/bin/docker diff --git a/.local/bin/docker b/.local/bin/docker new file mode 100755 index 0000000..abd7414 --- /dev/null +++ b/.local/bin/docker @@ -0,0 +1,6 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +podman "${@:1}" From 662f032eca857360be02d9344a1743c3cab1e730 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 6 Dec 2025 20:57:38 +0200 Subject: [PATCH 39/75] Keep container images up-to-date --- .local/bin/update-container-images | 14 ++++++++++++++ .local/bin/upgrade | 1 + 2 files changed, 15 insertions(+) create mode 100755 .local/bin/update-container-images diff --git a/.local/bin/update-container-images b/.local/bin/update-container-images new file mode 100755 index 0000000..2b28b04 --- /dev/null +++ b/.local/bin/update-container-images @@ -0,0 +1,14 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +IMAGES=( + # keep-sorted start + docker.io/ollama/ollama:latest + ghcr.io/hadolint/hadolint:latest + lscr.io/linuxserver/transmission:latest + # keep-sorted end +) + +podman pull "${IMAGES[@]}" diff --git a/.local/bin/upgrade b/.local/bin/upgrade index 5ce5ba5..b209d96 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -30,3 +30,4 @@ pipx_update cargo_update ghup git_sync_update +update-container-images From 7dac78e81cf8c11e8b3535f85c4e638afaaa7d43 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sun, 7 Dec 2025 00:25:19 +0200 Subject: [PATCH 40/75] Pre-download container images --- .config/setup/41-download-container-images.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 .config/setup/41-download-container-images.sh diff --git a/.config/setup/41-download-container-images.sh b/.config/setup/41-download-container-images.sh new file mode 100755 index 0000000..55fba41 --- /dev/null +++ b/.config/setup/41-download-container-images.sh @@ -0,0 +1,6 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +update-container-images From 102ac5062341da93d0f2c66adb628183b72626e5 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 13 Dec 2025 23:56:54 +0200 Subject: [PATCH 41/75] Use conventional commenting style for Emacs Lisp --- .config/emacs/transient/values.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/emacs/transient/values.el b/.config/emacs/transient/values.el index e9662fa..9dc81a5 100644 --- a/.config/emacs/transient/values.el +++ b/.config/emacs/transient/values.el @@ -1,10 +1,10 @@ ( - ; keep-sorted start + ;; keep-sorted start (magit-commit "--gpg-sign=") (magit-diff:magit-revision-mode "--no-ext-diff" "--stat" "--show-signature") (magit-fetch "--force" "--prune" "--tags") (magit-log:magit-log-mode "-n256" "--graph" "--decorate" "--show-signature") (magit-merge "--gpg-sign=") (magit-tag "--sign") - ; keep-sorted end + ;; keep-sorted end ) From 985a2cbe63b7add1aa3adb1ca103ef7246c20c25 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sun, 14 Dec 2025 00:27:48 +0200 Subject: [PATCH 42/75] Enable tree-sitter-integrated modes --- .config/emacs/init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index c911572..bea332b 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -62,6 +62,7 @@ (global-auto-revert-non-file-buffers t) (inhibit-startup-screen t) (show-paren-context-when-offscreen 'overlay) + (treesit-enabled-modes t) (xref-search-program 'ripgrep) ;; keep-sorted end ) @@ -264,7 +265,7 @@ (eglot-ensure)))) (use-package python - :bind (:map python-mode-map + :bind (:map python-ts-mode-map ("C-c C-p" . nil) ("C-c C-l" . nil) ("C-c t" . elpy-test)) From c25d98ee20dd336e0657b48d13e5f2da198f0f78 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 18 Dec 2025 22:26:48 +0200 Subject: [PATCH 43/75] Update binary name --- .bash_aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bash_aliases b/.bash_aliases index 8c96a9f..62098a4 100755 --- a/.bash_aliases +++ b/.bash_aliases @@ -1,7 +1,7 @@ #! /usr/bin/bash alias em="emacs --no-init-file --no-splash --no-window-system" -alias ll="exa --binary --group --long" +alias ll="eza --binary --group --long" alias la="ll --all" alias tree="ll --tree" alias llblk="lsblk -o NAME,TYPE,FSTYPE,SIZE,MOUNTPOINT,LABEL,PARTLABEL,UUID,PARTUUID" From cd5958bd2120eb636dfa14b7eb74bac2281368b7 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 18 Dec 2025 22:27:14 +0200 Subject: [PATCH 44/75] Use long option names --- .bash_aliases | 2 +- .config/containers/systemd/ollama.container | 2 +- .config/sway/config | 12 ++++++------ .local/bin/podllama | 2 +- .local/bin/print-status | 12 ++++++------ .local/bin/take-screenshot | 14 +++++++------- .local/bin/vaulter | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.bash_aliases b/.bash_aliases index 62098a4..0ed8566 100755 --- a/.bash_aliases +++ b/.bash_aliases @@ -4,4 +4,4 @@ alias em="emacs --no-init-file --no-splash --no-window-system" alias ll="eza --binary --group --long" alias la="ll --all" alias tree="ll --tree" -alias llblk="lsblk -o NAME,TYPE,FSTYPE,SIZE,MOUNTPOINT,LABEL,PARTLABEL,UUID,PARTUUID" +alias llblk="lsblk --output NAME,TYPE,FSTYPE,SIZE,MOUNTPOINT,LABEL,PARTLABEL,UUID,PARTUUID" diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container index b6475ab..653e159 100644 --- a/.config/containers/systemd/ollama.container +++ b/.config/containers/systemd/ollama.container @@ -15,6 +15,6 @@ WantedBy=default.target [Service] # keep-sorted start -ExecStartPre=mkdir -p %h/.local/share/ollama +ExecStartPre=mkdir --parents %h/.local/share/ollama Restart=always # keep-sorted end diff --git a/.config/sway/config b/.config/sway/config index 1054a60..f431603 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -32,15 +32,15 @@ include /etc/sway/config-vars.d/* # # output HDMI-A-1 resolution 1920x1080 position 1920,0 # -# You can get the names of your outputs by running: swaymsg -t get_outputs +# You can get the names of your outputs by running: swaymsg --type get_outputs ### Idle configuration # exec swayidle -w \ - timeout 300 'swaylock -f -c 000000' \ + timeout 300 'swaylock --daemonize --color 000000' \ timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock -f -c 000000' + before-sleep 'swaylock --daemonize --color 000000' # This will lock your screen after 300 seconds of inactivity, then turn off # your displays after another 300 seconds, and turn your screens back on when @@ -58,7 +58,7 @@ input type:touchpad { tap enabled } -# You can get the names of your inputs by running: swaymsg -t get_inputs +# You can get the names of your inputs by running: swaymsg --type get_inputs # Read `man 5 sway-input` for more information about this section. ### Key bindings @@ -99,9 +99,9 @@ input type:touchpad { # Lock screen # Black - bindsym $wm_mod+l exec swaylock -f -c 000000 + bindsym $wm_mod+l exec swaylock --daemonize --color 000000 # Random color - bindsym $wm_mod+semicolon exec swaylock -f -c $(dd if=/dev/urandom bs=1 count=3 2>/dev/null | hexdump -e '"%02x"') + bindsym $wm_mod+semicolon exec swaylock --daemonize --color $(dd if=/dev/urandom bs=1 count=3 2>/dev/null | hexdump --format '"%02x"') # Exit sway (logs you out of your Wayland session) bindsym $wm_mod+Delete exec leave diff --git a/.local/bin/podllama b/.local/bin/podllama index 2f9393e..39b8e63 100755 --- a/.local/bin/podllama +++ b/.local/bin/podllama @@ -3,7 +3,7 @@ set -euo pipefail IFS=$'\n\t' -if ! PARSED_OPTIONS=$(getopt -o "" --long "offline,volatile" --name "$0" -- "$@"); then +if ! PARSED_OPTIONS=$(getopt --options "" --long "offline,volatile" --name "$0" -- "$@"); then echo "Error parsing options." >&2 exit 1 fi diff --git a/.local/bin/print-status b/.local/bin/print-status index 6192f29..a9e5ab7 100755 --- a/.local/bin/print-status +++ b/.local/bin/print-status @@ -1,6 +1,6 @@ #! /usr/bin/sh -recordings=$(pgrep wf-recorder | wc -l) +recordings=$(pgrep wf-recorder | wc --lines) if [ "${recordings}" = "0" ]; then recs="" else @@ -19,7 +19,7 @@ else numlock="⮔" fi -touchpad=$(swaymsg -t get_inputs | jq -r '[.[] | select(.type == "touchpad")][0] | .libinput.send_events') +touchpad=$(swaymsg --type get_inputs | jq --raw-output '[.[] | select(.type == "touchpad")][0] | .libinput.send_events') if [ "${touchpad}" = "enabled" ]; then touchpad_active="✅" else @@ -29,8 +29,8 @@ fi today=$(date +'%Y-%m-%d') now=$(date +'%H:%M:%S') -hour=$(echo "${now}" | cut -d: -f1 -) -minute=$(echo "${now}" | cut -d: -f2 -) +hour=$(echo "${now}" | cut --delimiter ":" --fields 1 -) +minute=$(echo "${now}" | cut --delimiter ":" --fields 2 -) if [ "${minute}" -lt 30 ]; then case "${hour}" in "00"|"12") clock_face="🕛";; @@ -64,7 +64,7 @@ else fi audio_mute=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') -audio_volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]\+%' | head -n 1 | tr -d %) +audio_volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep --only-matching '[0-9]\+%' | head --lines 1 | tr --delete %) audio_symbol="❔" if [ "${audio_mute}" = "yes" ]; then audio_symbol="🔇" @@ -81,7 +81,7 @@ else fi mike_mute=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk '{print $2}') -mike_volume=$(pactl get-source-volume @DEFAULT_SOURCE@ | grep -o '[0-9]\+%' | head -n 1 | tr -d %) +mike_volume=$(pactl get-source-volume @DEFAULT_SOURCE@ | grep --only-matching '[0-9]\+%' | head --lines 1 | tr --delete %) mike_symbol="❔" if [ "${mike_mute}" = "yes" ]; then mike_symbol="🍌" diff --git a/.local/bin/take-screenshot b/.local/bin/take-screenshot index 32f4eaf..8a71bea 100755 --- a/.local/bin/take-screenshot +++ b/.local/bin/take-screenshot @@ -37,15 +37,15 @@ else fi get_focused_monitor() { - swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name' + swaymsg --type get_outputs | jq --raw-output '.[] | select(.focused) | .name' } get_focused_window() { - swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"' + swaymsg --type get_tree | jq --join-output '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"' } select_window() { - swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp + swaymsg --type get_tree | jq --raw-output '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp } case "${option}" in @@ -68,11 +68,11 @@ case "${option}" in "📷 Select window → 📋") grim -g "$(select_window)" - | wl-copy;; "📽 Record focused monitor") - wf-recorder -o "$(get_focused_monitor)" -f "$(recording_filename)";; + wf-recorder --output "$(get_focused_monitor)" -f "$(recording_filename)";; "📽 Record select region") - wf-recorder -g "$(slurp)" -f "$(recording_filename)";; + wf-recorder --geometry "$(slurp)" -f "$(recording_filename)";; "📽 Record focused window") - wf-recorder -g "$(get_focused_window)" -f "$(recording_filename)";; + wf-recorder --geometry "$(get_focused_window)" -f "$(recording_filename)";; "📽 Record select window") - wf-recorder -g "$(select_window)" -f "$(recording_filename)";; + wf-recorder --geometry "$(select_window)" -f "$(recording_filename)";; esac diff --git a/.local/bin/vaulter b/.local/bin/vaulter index 876832f..0ebad34 100755 --- a/.local/bin/vaulter +++ b/.local/bin/vaulter @@ -3,7 +3,7 @@ set -euo pipefail IFS=$'\n\t' -podman --transient-store run --rm -ti \ +podman --transient-store run --interactive --rm --tty \ --env WAYLAND_DISPLAY \ --env XDG_RUNTIME_DIR=/tmp \ --hostname localhost \ From c4fb544f41f74d316e36a76ce5e1c0065d34e97f Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 18 Dec 2025 22:27:25 +0200 Subject: [PATCH 45/75] Start a local PlantUML server on boot --- .config/containers/systemd/plantuml.container | 17 +++++++++++++++++ .local/bin/update-container-images | 1 + 2 files changed, 18 insertions(+) create mode 100644 .config/containers/systemd/plantuml.container diff --git a/.config/containers/systemd/plantuml.container b/.config/containers/systemd/plantuml.container new file mode 100644 index 0000000..347a03b --- /dev/null +++ b/.config/containers/systemd/plantuml.container @@ -0,0 +1,17 @@ +[Unit] +Description=A local PlantUML server + +[Container] +# keep-sorted start +ContainerName=plantuml +Image=docker.io/plantuml/plantuml-server:jetty +Network=private +PublishPort=8080:8080 +ReadOnly=true +# keep-sorted end + +[Install] +WantedBy=default.target + +[Service] +Restart=always diff --git a/.local/bin/update-container-images b/.local/bin/update-container-images index 2b28b04..df5f93f 100755 --- a/.local/bin/update-container-images +++ b/.local/bin/update-container-images @@ -6,6 +6,7 @@ IFS=$'\n\t' IMAGES=( # keep-sorted start docker.io/ollama/ollama:latest + docker.io/plantuml/plantuml-server:jetty ghcr.io/hadolint/hadolint:latest lscr.io/linuxserver/transmission:latest # keep-sorted end From 4d8b0ab47c96c65421518d1c45cead55410a8a42 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 18 Dec 2025 23:15:19 +0200 Subject: [PATCH 46/75] Setup PlantUML mode in Emacs to use the local server --- .config/emacs/init.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index bea332b..b5fb4c4 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -186,6 +186,17 @@ (use-package org-contacts :after org-contrib) +(use-package deflate + :ensure (:repo "https://github.com/skuro/deflate")) +(use-package plantuml-mode + :ensure (:repo "https://github.com/skuro/plantuml-mode") + :custom + (plantuml-default-exec-mode 'server) + (plantuml-server-url "http://localhost:8080") + :init + (add-to-list 'auto-mode-alist '("\\.puml\\'" . plantuml-mode)) + ) + (use-package age :custom (age-default-identity "~/.age/key") From b70c20603ece87974caef9cd338007dceb8945f7 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 19 Dec 2025 00:15:19 +0200 Subject: [PATCH 47/75] Integrate PlantUML mode with org-mode code blocks --- .config/emacs/init.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index b5fb4c4..2eb5bbe 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -191,10 +191,15 @@ (use-package plantuml-mode :ensure (:repo "https://github.com/skuro/plantuml-mode") :custom + ;; keep-sorted start (plantuml-default-exec-mode 'server) + (plantuml-output-type "svg") (plantuml-server-url "http://localhost:8080") + ;; keep-sorted end :init (add-to-list 'auto-mode-alist '("\\.puml\\'" . plantuml-mode)) + (add-to-list 'org-src-lang-modes '("plantuml" . plantuml)) + (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))) ) (use-package age From a459460426875e237aaaf5dd2696232d257d6da4 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 20 Dec 2025 23:37:56 +0200 Subject: [PATCH 48/75] Detach the Transmission server from the host network --- .config/containers/systemd/transmission.container | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/containers/systemd/transmission.container b/.config/containers/systemd/transmission.container index ca3190e..0c139f3 100644 --- a/.config/containers/systemd/transmission.container +++ b/.config/containers/systemd/transmission.container @@ -7,7 +7,7 @@ ContainerName=transmission Environment=PGID=1000 Environment=PUID=1000 Image=lscr.io/linuxserver/transmission:latest -Network=host +Network=private PublishPort=51413:51413 PublishPort=51413:51413/udp PublishPort=9091:9091 From 4f1ff6fc8210adc42960b4fa59c845ce3addeaa0 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 24 Dec 2025 00:41:06 +0200 Subject: [PATCH 49/75] Collect all the flyspell configuration options together --- .config/emacs/init.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 2eb5bbe..bec67ef 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -26,8 +26,6 @@ :hook ( ;; keep-sorted start (after-save . executable-make-buffer-file-executable-if-script-p) - (prog-mode . flyspell-prog-mode) - (text-mode . flyspell-mode) (xref-after-update . outline-minor-mode) ;; keep-sorted end ) @@ -67,6 +65,18 @@ ;; keep-sorted end ) +(use-package flyspell + :ensure nil + :bind (:map flyspell-mode-map + ("C-;" . nil)) + :hook ( + ;; keep-sorted start + (prog-mode . flyspell-prog-mode) + (text-mode . flyspell-mode) + ;; keep-sorted end + ) + ) + (use-package diminish) (use-package better-defaults From c4bc942307eae9d5ea98e1a8bc3dfb9f705800ce Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 24 Dec 2025 20:13:30 +0200 Subject: [PATCH 50/75] Use a read-only root filesystem in service containers --- .config/containers/systemd/ollama.container | 1 + .config/containers/systemd/transmission.container | 1 + 2 files changed, 2 insertions(+) diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container index 653e159..fd73a5a 100644 --- a/.config/containers/systemd/ollama.container +++ b/.config/containers/systemd/ollama.container @@ -7,6 +7,7 @@ ContainerName=ollama Image=docker.io/ollama/ollama:latest Network=ollama.network PublishPort=11434:11434 +ReadOnly=true Volume=%h/.local/share/ollama:/root/.ollama:ro,z # keep-sorted end diff --git a/.config/containers/systemd/transmission.container b/.config/containers/systemd/transmission.container index 0c139f3..7e167c5 100644 --- a/.config/containers/systemd/transmission.container +++ b/.config/containers/systemd/transmission.container @@ -11,6 +11,7 @@ Network=private PublishPort=51413:51413 PublishPort=51413:51413/udp PublishPort=9091:9091 +ReadOnly=true UserNS=keep-id Volume=%h/.config/transmission:/config:Z Volume=%h/Downloads/transmission/watch:/watch:ro,Z From 619a6e7f3a432dd733c557326666a0bb807e504d Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 24 Dec 2025 20:13:40 +0200 Subject: [PATCH 51/75] Run service containers in the transient store for speed and safety --- .config/containers/systemd/ollama.container | 1 + .config/containers/systemd/plantuml.container | 1 + .config/containers/systemd/transmission.container | 1 + 3 files changed, 3 insertions(+) diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container index fd73a5a..51b9e69 100644 --- a/.config/containers/systemd/ollama.container +++ b/.config/containers/systemd/ollama.container @@ -6,6 +6,7 @@ Description=A local LLM server ContainerName=ollama Image=docker.io/ollama/ollama:latest Network=ollama.network +PodmanArgs=--transient-store PublishPort=11434:11434 ReadOnly=true Volume=%h/.local/share/ollama:/root/.ollama:ro,z diff --git a/.config/containers/systemd/plantuml.container b/.config/containers/systemd/plantuml.container index 347a03b..3b93c5a 100644 --- a/.config/containers/systemd/plantuml.container +++ b/.config/containers/systemd/plantuml.container @@ -6,6 +6,7 @@ Description=A local PlantUML server ContainerName=plantuml Image=docker.io/plantuml/plantuml-server:jetty Network=private +PodmanArgs=--transient-store PublishPort=8080:8080 ReadOnly=true # keep-sorted end diff --git a/.config/containers/systemd/transmission.container b/.config/containers/systemd/transmission.container index 7e167c5..15b6387 100644 --- a/.config/containers/systemd/transmission.container +++ b/.config/containers/systemd/transmission.container @@ -8,6 +8,7 @@ Environment=PGID=1000 Environment=PUID=1000 Image=lscr.io/linuxserver/transmission:latest Network=private +PodmanArgs=--transient-store PublishPort=51413:51413 PublishPort=51413:51413/udp PublishPort=9091:9091 From a4bbd8eb6661acb18fa9b57f93423ea90172e012 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 12 Jul 2025 23:55:38 +0300 Subject: [PATCH 52/75] Replace sudo with run0 in scripts that only use it once --- .config/setup/20-install-zoom.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/setup/20-install-zoom.sh b/.config/setup/20-install-zoom.sh index d1260cc..c5e6fe1 100755 --- a/.config/setup/20-install-zoom.sh +++ b/.config/setup/20-install-zoom.sh @@ -4,4 +4,4 @@ set -euo pipefail IFS=$'\n\t' curl --location --output-dir /tmp --remote-name https://zoom.us/client/latest/zoom_amd64.deb -sudo apt-get install --no-install-recommends --yes /tmp/zoom_amd64.deb +run0 apt-get install --no-install-recommends --yes /tmp/zoom_amd64.deb From bd156c1641ece228d62e6cf87984dbda06827346 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:54:22 +0300 Subject: [PATCH 53/75] Replace sudo with run0 in all scripts --- .config/setup/02-install-debian-testing.sh | 8 ++++---- .config/setup/04-install-deb-packages.sh | 4 ++-- .config/setup/12-setup-packages.sh | 4 ++-- .config/setup/16-install-tor.sh | 12 ++++++------ .config/setup/31-initialize-backup-repository.sh | 6 +++--- .local/bin/no-ipv6 | 4 ++-- .local/bin/upgrade | 8 +++----- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/.config/setup/02-install-debian-testing.sh b/.config/setup/02-install-debian-testing.sh index 7cf2c21..0b55046 100755 --- a/.config/setup/02-install-debian-testing.sh +++ b/.config/setup/02-install-debian-testing.sh @@ -3,8 +3,8 @@ set -euo pipefail IFS=$'\n\t' -sudo cp "$(systemd-path user-configuration)"/setup/sources.list.d/debian.sources /etc/apt/sources.list.d/ -sudo rm /etc/apt/sources.list +run0 cp "$(systemd-path user-configuration)"/setup/sources.list.d/debian.sources /etc/apt/sources.list.d/ +run0 rm /etc/apt/sources.list -sudo apt update -sudo apt --yes full-upgrade +run0 apt update +run0 apt --yes full-upgrade diff --git a/.config/setup/04-install-deb-packages.sh b/.config/setup/04-install-deb-packages.sh index c96ba44..23ef30f 100755 --- a/.config/setup/04-install-deb-packages.sh +++ b/.config/setup/04-install-deb-packages.sh @@ -105,5 +105,5 @@ META_PKGS=( # keep-sorted end ) -sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes "${DEB_PKGS[@]}" -sudo DEBIAN_FRONTEND=noninteractive apt-get install --install-recommends --yes "${META_PKGS[@]}" +run0 --setenv=DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes "${DEB_PKGS[@]}" +run0 --setenv=DEBIAN_FRONTEND=noninteractive apt-get install --install-recommends --yes "${META_PKGS[@]}" diff --git a/.config/setup/12-setup-packages.sh b/.config/setup/12-setup-packages.sh index 6c3ad50..ded26af 100755 --- a/.config/setup/12-setup-packages.sh +++ b/.config/setup/12-setup-packages.sh @@ -19,6 +19,6 @@ mkdir --parents ~/Pictures/screenshots pre-commit install -sudo usermod --append --groups dialout "${USER}" +run0 usermod --append --groups dialout "${USER}" -echo 'kernel.perf_event_paranoid=1' | sudo tee '/etc/sysctl.d/51-enable-perf-events.conf' +echo 'kernel.perf_event_paranoid=1' | run0 tee '/etc/sysctl.d/51-enable-perf-events.conf' diff --git a/.config/setup/16-install-tor.sh b/.config/setup/16-install-tor.sh index 44bf3f5..def32bf 100755 --- a/.config/setup/16-install-tor.sh +++ b/.config/setup/16-install-tor.sh @@ -3,12 +3,12 @@ set -euo pipefail IFS=$'\n\t' -sudo cp "$(systemd-path user-configuration)"/setup/sources.list.d/tor.sources /etc/apt/sources.list.d/ -sudo chmod 644 /etc/apt/sources.list.d/tor.sources +run0 cp "$(systemd-path user-configuration)"/setup/sources.list.d/tor.sources /etc/apt/sources.list.d/ +run0 chmod 644 /etc/apt/sources.list.d/tor.sources outfile=/usr/share/keyrings/deb.torproject.org-keyring.pgp -curl --silent https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | sudo tee "${outfile}" >/dev/null -sudo chmod 644 "${outfile}" +curl --silent https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | run0 tee "${outfile}" >/dev/null +run0 chmod 644 "${outfile}" TOR_PKGS=( # keep-sorted start @@ -18,5 +18,5 @@ TOR_PKGS=( # keep-sorted end ) -sudo apt update -sudo apt install --no-install-recommends --yes "${TOR_PKGS[@]}" +run0 apt update +run0 apt install --no-install-recommends --yes "${TOR_PKGS[@]}" diff --git a/.config/setup/31-initialize-backup-repository.sh b/.config/setup/31-initialize-backup-repository.sh index fe2c0cf..81441d6 100755 --- a/.config/setup/31-initialize-backup-repository.sh +++ b/.config/setup/31-initialize-backup-repository.sh @@ -3,8 +3,8 @@ set -euo pipefail IFS=$'\n\t' -sudo mkdir --parents "${BORG_REPO}" -sudo chown "${USER}":"${USER}" "${BORG_REPO}" -sudo chmod 700 "${BORG_REPO}" +run0 mkdir --parents "${BORG_REPO}" +run0 chown "${USER}":"${USER}" "${BORG_REPO}" +run0 chmod 700 "${BORG_REPO}" borg init --encryption=repokey diff --git a/.local/bin/no-ipv6 b/.local/bin/no-ipv6 index 3ad8edb..18495df 100755 --- a/.local/bin/no-ipv6 +++ b/.local/bin/no-ipv6 @@ -3,6 +3,6 @@ set -euo pipefail IFS=$'\n\t' -sudo sysctl net.ipv6.conf.all.disable_ipv6=1 +run0 sysctl net.ipv6.conf.all.disable_ipv6=1 "$@" -sudo sysctl net.ipv6.conf.all.disable_ipv6=0 +run0 sysctl net.ipv6.conf.all.disable_ipv6=0 diff --git a/.local/bin/upgrade b/.local/bin/upgrade index b209d96..d15adca 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -4,11 +4,9 @@ set -euo pipefail IFS=$'\n\t' apt_update() { - sudo --reset-timestamp - sudo apt update --audit && apt list --upgradable - sudo apt full-upgrade - sudo apt autoremove - sudo --reset-timestamp + run0 apt update --audit && apt list --upgradable + run0 apt full-upgrade + run0 apt autoremove } cargo_update() { From ed13b2653d19dc6a8ebd69a976f026358f1a98a3 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:54:23 +0300 Subject: [PATCH 54/75] Transparently use run0 instead of sudo --- .bash_aliases | 1 + .config/setup/04-install-deb-packages.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/.bash_aliases b/.bash_aliases index 0ed8566..17c5753 100755 --- a/.bash_aliases +++ b/.bash_aliases @@ -5,3 +5,4 @@ alias ll="eza --binary --group --long" alias la="ll --all" alias tree="ll --tree" alias llblk="lsblk --output NAME,TYPE,FSTYPE,SIZE,MOUNTPOINT,LABEL,PARTLABEL,UUID,PARTUUID" +alias sudo="run0" diff --git a/.config/setup/04-install-deb-packages.sh b/.config/setup/04-install-deb-packages.sh index 23ef30f..6d60053 100755 --- a/.config/setup/04-install-deb-packages.sh +++ b/.config/setup/04-install-deb-packages.sh @@ -107,3 +107,4 @@ META_PKGS=( run0 --setenv=DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes "${DEB_PKGS[@]}" run0 --setenv=DEBIAN_FRONTEND=noninteractive apt-get install --install-recommends --yes "${META_PKGS[@]}" +run0 --setenv=DEBIAN_FRONTEND=noninteractive apt-get remove --yes sudo From c2e29a3bfe9e0e6226f3a0edd645be11fd99f45c Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 24 Dec 2025 00:41:19 +0200 Subject: [PATCH 55/75] Increase the cache TTL for loaded models --- .config/containers/systemd/ollama.container | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container index 51b9e69..1e53f79 100644 --- a/.config/containers/systemd/ollama.container +++ b/.config/containers/systemd/ollama.container @@ -4,6 +4,7 @@ Description=A local LLM server [Container] # keep-sorted start ContainerName=ollama +Environment=OLLAMA_KEEP_ALIVE=10m Image=docker.io/ollama/ollama:latest Network=ollama.network PodmanArgs=--transient-store From f2e5d75d2bdd538ef1384422f673f83b3969c564 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 25 Dec 2025 01:31:13 +0200 Subject: [PATCH 56/75] Write a run0-based alternative to sudoedit --- .local/bin/run0edit | 75 +++++++++++++++++++++++++++++++++++++++++++++ .local/bin/sudoedit | 1 + 2 files changed, 76 insertions(+) create mode 100755 .local/bin/run0edit create mode 120000 .local/bin/sudoedit diff --git a/.local/bin/run0edit b/.local/bin/run0edit new file mode 100755 index 0000000..0909e39 --- /dev/null +++ b/.local/bin/run0edit @@ -0,0 +1,75 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +default_editor() { + if [ -n "${SUDO_EDITOR+set}" ]; then + echo "${SUDO_EDITOR}" + elif [ -n "${VISUAL+set}" ]; then + echo "${VISUAL}" + elif [ -n "${EDITOR+set}" ]; then + echo "${EDITOR}" + else + echo "No editor configured" 1>&2 + exit 1 + fi +} + +try_command() { + if "$@" 2> /dev/null; then + return + elif run0 "$@" > /dev/null; then + return + else + exit 2 + fi +} + +make_editable_copy() { + orig_file="$1" + tempfile="$2" + + try_command cp "${orig_file}" "${tempfile}" +} + +elevate_permissions() { + tempfile="$1" + orig_file="$2" + + try_command chown --reference "${orig_file}" "${tempfile}" + try_command chmod --reference "${orig_file}" "${tempfile}" +} + +update_file() { + tempfile="$1" + orig_file="$2" + + try_command mv --force "${tempfile}" "${orig_file}" +} + +clean_tempfiles() { + tempfile="$1" + + rm --force "${tempfile}" "${tempfile}.orig" +} + +editor_cmd="$(default_editor)" +echo "Editing using the command \"${editor_cmd}\"" + +IFS=' ' read -r -a editor <<< "${editor_cmd}" + +orig_file="$1" +tempfile="$(mktemp)" +echo "Using temporary file ${tempfile}" +make_editable_copy "${orig_file}" "${tempfile}" +cp "${tempfile}" "${tempfile}.orig" +"${editor[@]}" "${tempfile}" +if cmp --quiet "${tempfile}" "${tempfile}.orig"; then + echo "No change to file" +else + elevate_permissions "${tempfile}" "${orig_file}" + update_file "${tempfile}" "${orig_file}" +fi + +clean_tempfiles "${tempfile}" diff --git a/.local/bin/sudoedit b/.local/bin/sudoedit new file mode 120000 index 0000000..17feabe --- /dev/null +++ b/.local/bin/sudoedit @@ -0,0 +1 @@ +run0edit \ No newline at end of file From 0c312bf1a2f916c31852016def77d7e03605f2c2 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 26 Dec 2025 00:01:52 +0200 Subject: [PATCH 57/75] Add input validation - the script only supports editing a single file --- .local/bin/run0edit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.local/bin/run0edit b/.local/bin/run0edit index 0909e39..fca6897 100755 --- a/.local/bin/run0edit +++ b/.local/bin/run0edit @@ -54,6 +54,12 @@ clean_tempfiles() { rm --force "${tempfile}" "${tempfile}.orig" } +if [ "$#" -ne "1" ]; then + echo "Expected exactly one input file. Usage:" 1>&2 + echo " $0 FILE" 1>&2 + exit 1 +fi + editor_cmd="$(default_editor)" echo "Editing using the command \"${editor_cmd}\"" From 9aa9851367d486f74a70c1b42c910f3822f7aa54 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 26 Dec 2025 00:02:44 +0200 Subject: [PATCH 58/75] Parse flag-like inputs as literal names --- .local/bin/run0edit | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/run0edit b/.local/bin/run0edit index fca6897..2fb087f 100755 --- a/.local/bin/run0edit +++ b/.local/bin/run0edit @@ -30,7 +30,7 @@ make_editable_copy() { orig_file="$1" tempfile="$2" - try_command cp "${orig_file}" "${tempfile}" + try_command cp -- "${orig_file}" "${tempfile}" } elevate_permissions() { @@ -45,13 +45,13 @@ update_file() { tempfile="$1" orig_file="$2" - try_command mv --force "${tempfile}" "${orig_file}" + try_command mv --force -- "${tempfile}" "${orig_file}" } clean_tempfiles() { tempfile="$1" - rm --force "${tempfile}" "${tempfile}.orig" + rm --force -- "${tempfile}" "${tempfile}.orig" } if [ "$#" -ne "1" ]; then From 1c10b1b5f20b6e2a551e97c30a04c00ce4c037a9 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 24 Dec 2025 19:45:24 +0200 Subject: [PATCH 59/75] Rely on podman's built-in update mechanism --- .config/setup/41-download-container-images.sh | 11 ++++++++++- .local/bin/update-container-images | 15 --------------- .local/bin/upgrade | 7 ++++++- 3 files changed, 16 insertions(+), 17 deletions(-) delete mode 100755 .local/bin/update-container-images diff --git a/.config/setup/41-download-container-images.sh b/.config/setup/41-download-container-images.sh index 55fba41..df5f93f 100755 --- a/.config/setup/41-download-container-images.sh +++ b/.config/setup/41-download-container-images.sh @@ -3,4 +3,13 @@ set -euo pipefail IFS=$'\n\t' -update-container-images +IMAGES=( + # keep-sorted start + docker.io/ollama/ollama:latest + docker.io/plantuml/plantuml-server:jetty + ghcr.io/hadolint/hadolint:latest + lscr.io/linuxserver/transmission:latest + # keep-sorted end +) + +podman pull "${IMAGES[@]}" diff --git a/.local/bin/update-container-images b/.local/bin/update-container-images deleted file mode 100755 index df5f93f..0000000 --- a/.local/bin/update-container-images +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/bash - -set -euo pipefail -IFS=$'\n\t' - -IMAGES=( - # keep-sorted start - docker.io/ollama/ollama:latest - docker.io/plantuml/plantuml-server:jetty - ghcr.io/hadolint/hadolint:latest - lscr.io/linuxserver/transmission:latest - # keep-sorted end -) - -podman pull "${IMAGES[@]}" diff --git a/.local/bin/upgrade b/.local/bin/upgrade index d15adca..d69ce3f 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -23,9 +23,14 @@ git_sync_update() { resync-git-sync } +podman_update() { + echo Updating podman images... + podman auto-update +} + apt_update pipx_update cargo_update ghup git_sync_update -update-container-images +podman_update From bc83a3d28b4cbc314b8594eb200f21b550d71c2e Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 26 Dec 2025 17:43:51 +0200 Subject: [PATCH 60/75] All things deserve to be known by their true name --- .local/bin/sudoedit | 1 - .local/bin/{run0edit => temper} | 0 2 files changed, 1 deletion(-) delete mode 120000 .local/bin/sudoedit rename .local/bin/{run0edit => temper} (100%) diff --git a/.local/bin/sudoedit b/.local/bin/sudoedit deleted file mode 120000 index 17feabe..0000000 --- a/.local/bin/sudoedit +++ /dev/null @@ -1 +0,0 @@ -run0edit \ No newline at end of file diff --git a/.local/bin/run0edit b/.local/bin/temper similarity index 100% rename from .local/bin/run0edit rename to .local/bin/temper From 0bf839680598b6ef4cafdc5ede59723c7d2d6cb4 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 15 Nov 2025 21:43:06 +0200 Subject: [PATCH 61/75] Install a GPU monitor utility --- .config/setup/04-install-deb-packages.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/setup/04-install-deb-packages.sh b/.config/setup/04-install-deb-packages.sh index 6d60053..ae5a17e 100755 --- a/.config/setup/04-install-deb-packages.sh +++ b/.config/setup/04-install-deb-packages.sh @@ -58,6 +58,7 @@ DEB_PKGS=( network-manager-openvpn nmap ntfs-3g + nvtop pipewire-audio pipx postfix From 0410013e1e68d40303f6e6b85f368202bfe54797 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 27 Dec 2025 18:56:22 +0200 Subject: [PATCH 62/75] Install testcontainers in the lsp venv for type inference --- .config/setup/06-install-pipx-packages.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/setup/06-install-pipx-packages.sh b/.config/setup/06-install-pipx-packages.sh index 91d04f3..448fc1d 100755 --- a/.config/setup/06-install-pipx-packages.sh +++ b/.config/setup/06-install-pipx-packages.sh @@ -23,6 +23,7 @@ PYLSP_PLUGINS=( pylsp-mypy pylsp-rope pytest + testcontainers types-pyxdg # keep-sorted end ) From c852e5862a364428261bb91ce0d90cddd953171d Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sun, 28 Dec 2025 00:34:38 +0200 Subject: [PATCH 63/75] Configure testcontainers to use the podman socket --- .config/environment.d/testcontainers.conf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .config/environment.d/testcontainers.conf diff --git a/.config/environment.d/testcontainers.conf b/.config/environment.d/testcontainers.conf new file mode 100644 index 0000000..8e07e7f --- /dev/null +++ b/.config/environment.d/testcontainers.conf @@ -0,0 +1,3 @@ +# keep-sorted start +DOCKER_HOST=unix:///run/user/1000/podman/podman.sock +# keep-sorted end From 0503aed013dba109222699d6b83cf0f36e3f2245 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Tue, 30 Dec 2025 00:22:44 +0200 Subject: [PATCH 64/75] Enable auto updates for the service containers --- .config/containers/systemd/ollama.container | 1 + .config/containers/systemd/plantuml.container | 1 + .config/containers/systemd/transmission.container | 1 + .local/bin/upgrade | 1 + 4 files changed, 4 insertions(+) diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container index 1e53f79..98929ac 100644 --- a/.config/containers/systemd/ollama.container +++ b/.config/containers/systemd/ollama.container @@ -3,6 +3,7 @@ Description=A local LLM server [Container] # keep-sorted start +AutoUpdate=registry ContainerName=ollama Environment=OLLAMA_KEEP_ALIVE=10m Image=docker.io/ollama/ollama:latest diff --git a/.config/containers/systemd/plantuml.container b/.config/containers/systemd/plantuml.container index 3b93c5a..aa8057d 100644 --- a/.config/containers/systemd/plantuml.container +++ b/.config/containers/systemd/plantuml.container @@ -3,6 +3,7 @@ Description=A local PlantUML server [Container] # keep-sorted start +AutoUpdate=registry ContainerName=plantuml Image=docker.io/plantuml/plantuml-server:jetty Network=private diff --git a/.config/containers/systemd/transmission.container b/.config/containers/systemd/transmission.container index 15b6387..b9f92ac 100644 --- a/.config/containers/systemd/transmission.container +++ b/.config/containers/systemd/transmission.container @@ -3,6 +3,7 @@ Description=Transmission client service with web interface on localhost:9091 [Container] # keep-sorted start +AutoUpdate=registry ContainerName=transmission Environment=PGID=1000 Environment=PUID=1000 diff --git a/.local/bin/upgrade b/.local/bin/upgrade index d69ce3f..21a893e 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -26,6 +26,7 @@ git_sync_update() { podman_update() { echo Updating podman images... podman auto-update + podman --transient-store auto-update } apt_update From f6fe70a08dd26531936f5a0fccea3d4c8f71512f Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 31 Dec 2025 01:13:51 +0200 Subject: [PATCH 65/75] Clean images after updates --- .local/bin/upgrade | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.local/bin/upgrade b/.local/bin/upgrade index 21a893e..65bbcd8 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -24,9 +24,11 @@ git_sync_update() { } podman_update() { - echo Updating podman images... + echo Updating container service images... podman auto-update podman --transient-store auto-update + echo Removing dangling images... + podman image prune --force } apt_update From 469b8cfb2dd80b46a1609fd1b4c7781012fcefda Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 31 Dec 2025 01:14:25 +0200 Subject: [PATCH 66/75] Ensure mounted directories exist --- .config/containers/systemd/transmission.container | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/containers/systemd/transmission.container b/.config/containers/systemd/transmission.container index b9f92ac..6d83357 100644 --- a/.config/containers/systemd/transmission.container +++ b/.config/containers/systemd/transmission.container @@ -25,5 +25,10 @@ WantedBy=default.target [Service] # keep-sorted start +ExecStartPre=mkdir --parents %h/.config/transmission +ExecStartPre=mkdir --parents %h/Downloads/transmission +ExecStartPre=mkdir --parents %h/Downloads/transmission/complete +ExecStartPre=mkdir --parents %h/Downloads/transmission/incomplete +ExecStartPre=mkdir --parents %h/Downloads/transmission/watch Restart=always # keep-sorted end From b89f91ab90702215af81a1988b6a3085aeecaee1 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 3 Jan 2026 22:09:15 +0200 Subject: [PATCH 67/75] Install docker type stubs in the lsp venv --- .config/setup/06-install-pipx-packages.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/setup/06-install-pipx-packages.sh b/.config/setup/06-install-pipx-packages.sh index 448fc1d..e7bc1eb 100755 --- a/.config/setup/06-install-pipx-packages.sh +++ b/.config/setup/06-install-pipx-packages.sh @@ -24,6 +24,7 @@ PYLSP_PLUGINS=( pylsp-rope pytest testcontainers + types-docker types-pyxdg # keep-sorted end ) From ffbd7a7d358041cdf304e4b29d3af4f16433c6c2 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Sat, 3 Jan 2026 23:08:12 +0200 Subject: [PATCH 68/75] Integrate Emacs package updates into the system upgrade script --- .local/bin/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.local/bin/upgrade b/.local/bin/upgrade index 65bbcd8..3e85388 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -9,6 +9,11 @@ apt_update() { run0 apt autoremove } +emacs_update() { + echo Queuing updates for Emacs packages... + emacsclient --alternate-editor "" --reuse-frame --eval "(elpaca-pull-all t)" --no-wait > /dev/null +} + cargo_update() { # shellcheck disable=SC2046 cargo install $(cargo install --list | grep '^[a-z0-9_-]\+ v[0-9.]\+:$' | cut --delimiter=' ' --fields=1) @@ -32,6 +37,7 @@ podman_update() { } apt_update +emacs_update pipx_update cargo_update ghup From 6da2e08b4378c1569f1fb607441fae258f22c4fc Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 7 Jan 2026 23:21:03 +0200 Subject: [PATCH 69/75] Replace pipx with uv for installing Python-based tools --- .config/setup/04-install-deb-packages.sh | 1 - .config/setup/06-install-pipx-packages.sh | 32 ----------------------- .config/setup/46-install-uv-packages.sh | 30 +++++++++++++++++++++ .local/bin/upgrade | 6 ++--- 4 files changed, 33 insertions(+), 36 deletions(-) delete mode 100755 .config/setup/06-install-pipx-packages.sh create mode 100755 .config/setup/46-install-uv-packages.sh diff --git a/.config/setup/04-install-deb-packages.sh b/.config/setup/04-install-deb-packages.sh index ae5a17e..a8d976f 100755 --- a/.config/setup/04-install-deb-packages.sh +++ b/.config/setup/04-install-deb-packages.sh @@ -60,7 +60,6 @@ DEB_PKGS=( ntfs-3g nvtop pipewire-audio - pipx postfix pre-commit pulseaudio-utils diff --git a/.config/setup/06-install-pipx-packages.sh b/.config/setup/06-install-pipx-packages.sh deleted file mode 100755 index e7bc1eb..0000000 --- a/.config/setup/06-install-pipx-packages.sh +++ /dev/null @@ -1,32 +0,0 @@ -#! /usr/bin/bash - -set -euo pipefail -IFS=$'\n\t' - -PIPX_PKGS=( - # keep-sorted start - python-lsp-server - rshell - ruff - # keep-sorted end -) - -if (( "${#PIPX_PKGS[@]}" != 0 )); then - pipx install "${PIPX_PKGS[@]}" -fi - -PYLSP_PLUGINS=( - # keep-sorted start - fs - podman - pydantic - pylsp-mypy - pylsp-rope - pytest - testcontainers - types-docker - types-pyxdg - # keep-sorted end -) - -pipx inject python-lsp-server "${PYLSP_PLUGINS[@]}" diff --git a/.config/setup/46-install-uv-packages.sh b/.config/setup/46-install-uv-packages.sh new file mode 100755 index 0000000..0c09810 --- /dev/null +++ b/.config/setup/46-install-uv-packages.sh @@ -0,0 +1,30 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +UV_PKGS=( + # keep-sorted start + rshell + ruff + # keep-sorted end +) + +for package in "${UV_PKGS[@]}"; do + uv tool install "${package}" +done + +PYLSP_PLUGINS=( + # keep-sorted start + --with fs + --with podman + --with pydantic + --with pylsp-mypy + --with pylsp-rope + --with pytest + --with testcontainers + --with types-docker + --with types-pyxdg + # keep-sorted end +) +uv tool install "${PYLSP_PLUGINS[@]}" python-lsp-server diff --git a/.local/bin/upgrade b/.local/bin/upgrade index 3e85388..9e432c7 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -19,8 +19,8 @@ cargo_update() { cargo install $(cargo install --list | grep '^[a-z0-9_-]\+ v[0-9.]\+:$' | cut --delimiter=' ' --fields=1) } -pipx_update() { - pipx upgrade-all +uv_update() { + uv tool upgrade --all } git_sync_update() { @@ -38,7 +38,7 @@ podman_update() { apt_update emacs_update -pipx_update +uv_update cargo_update ghup git_sync_update From 74cf768800c51f4c140abec649c3add6623e0c94 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 8 Jan 2026 00:30:42 +0200 Subject: [PATCH 70/75] Give visual cues on terminal bell --- .config/foot/foot.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini index 611e95b..b28aaf2 100644 --- a/.config/foot/foot.ini +++ b/.config/foot/foot.ini @@ -40,9 +40,9 @@ force_color_prompt=true [bell] -# urgent=no +urgent=yes # notify=no -# visual=no +visual=yes # command= # command-focused=no From b26eea3f57f8a64ed1323f3403dfe0060f41fb2a Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 9 Jan 2026 00:55:10 +0200 Subject: [PATCH 71/75] Create a script for listing and selecting urgent windows in sway --- .config/sway/config | 3 ++ .local/bin/select-urgent | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100755 .local/bin/select-urgent diff --git a/.config/sway/config b/.config/sway/config index f431603..8d8adba 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -188,6 +188,9 @@ input type:touchpad { # Move focus to the parent container bindsym $wm_mod+bracketleft focus parent bindsym $wm_mod+bracketright focus child + + # Select urgent window to move focus to + bindsym $wm_mod+backslash exec select-urgent # # Scratchpad: # diff --git a/.local/bin/select-urgent b/.local/bin/select-urgent new file mode 100755 index 0000000..69c44c0 --- /dev/null +++ b/.local/bin/select-urgent @@ -0,0 +1,61 @@ +#! /usr/bin/python3 + +import json +import re +import subprocess +from collections.abc import Iterable, Iterator +from typing import Any + + +def urgent_descendents(node: dict[str, Any]) -> Iterator[dict[str, Any]]: + for subnode in node["nodes"]: + yield from find_urgent(subnode) + + +def find_urgent(node: dict[str, Any]) -> Iterator[dict[str, Any]]: + if node["type"] in ("root", "output"): + yield from urgent_descendents(node) + elif node["type"] == "workspace": + for unode in urgent_descendents(node): + yield unode | {"workspace": node["name"]} + elif node["type"] == "con": + if node["focus"]: + yield from urgent_descendents(node) + elif node["urgent"]: + yield {"id": node["id"], "name": node["name"]} + + +def display_option(unode: dict[str, Any]) -> str: + return f"[#{unode['id']} @ WS {unode['workspace']}] {unode['name']}" + + +def select_option(unodes: Iterable[dict[str, Any]]) -> str: + joined = "".join(display_option(unode) + "\n" for unode in unodes) + proc = subprocess.run( + ["fuzzel", "--dmenu"], + input=joined, + capture_output=True, + text=True, + ) + + return proc.stdout + + +def parse_id_from_option(opt: str) -> int: + m = re.match("^\\[#(?P[0-9]+) ", opt) + if m is None: + raise ValueError() + + return int(m["id"]) + + +def main() -> None: + proc = subprocess.run(["swaymsg", "-t", "get_tree"], capture_output=True, text=True) + sway_tree = json.loads(proc.stdout) + opt = select_option(find_urgent(sway_tree)) + con_id = parse_id_from_option(opt) + subprocess.run(["swaymsg", "--raw", f"[con_id={con_id}]", "focus"]) + + +if __name__ == "__main__": + main() From 2c4ded838a4984da970a6e064123886f93034d79 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Mon, 12 Jan 2026 21:58:27 +0200 Subject: [PATCH 72/75] Install agentbox from the live git repo --- .config/setup/04-install-deb-packages.sh | 1 + ...h => 18-install-live-git-repo-packages.sh} | 2 +- .local/bin/resync-git-sync | 13 ---------- .local/bin/resync-live-git-repo-packages | 24 +++++++++++++++++++ .local/bin/upgrade | 8 +++---- 5 files changed, 30 insertions(+), 18 deletions(-) rename .config/setup/{18-install-git-sync.sh => 18-install-live-git-repo-packages.sh} (62%) delete mode 100755 .local/bin/resync-git-sync create mode 100755 .local/bin/resync-live-git-repo-packages diff --git a/.config/setup/04-install-deb-packages.sh b/.config/setup/04-install-deb-packages.sh index a8d976f..70370d6 100755 --- a/.config/setup/04-install-deb-packages.sh +++ b/.config/setup/04-install-deb-packages.sh @@ -16,6 +16,7 @@ DEB_PKGS=( build-essential cargo cargo-doc + catatonit curl direnv emacs-mozc diff --git a/.config/setup/18-install-git-sync.sh b/.config/setup/18-install-live-git-repo-packages.sh similarity index 62% rename from .config/setup/18-install-git-sync.sh rename to .config/setup/18-install-live-git-repo-packages.sh index c5824c1..97c5a78 100755 --- a/.config/setup/18-install-git-sync.sh +++ b/.config/setup/18-install-live-git-repo-packages.sh @@ -3,4 +3,4 @@ set -euo pipefail IFS=$'\n\t' -resync-git-sync +resync-live-git-repo-packages diff --git a/.local/bin/resync-git-sync b/.local/bin/resync-git-sync deleted file mode 100755 index f167ca8..0000000 --- a/.local/bin/resync-git-sync +++ /dev/null @@ -1,13 +0,0 @@ -#! /usr/bin/bash - -set -euo pipefail -IFS=$'\n\t' - -REPO_DIR="$(systemd-path user-state-private)"/git-sync -if [ -d "${REPO_DIR}" ] -then - git -C "${REPO_DIR}" pull -else - cd "$(systemd-path user-state-private)" || exit - git clone https://github.com/simonthum/git-sync -fi diff --git a/.local/bin/resync-live-git-repo-packages b/.local/bin/resync-live-git-repo-packages new file mode 100755 index 0000000..bf0229a --- /dev/null +++ b/.local/bin/resync-live-git-repo-packages @@ -0,0 +1,24 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +REPO_DIR="$(systemd-path user-state-private)"/agentbox +if [ -d "${REPO_DIR}" ] +then + git -C "${REPO_DIR}" pull +else + cd "$(systemd-path user-state-private)" || exit + git clone https://github.com/libohad-dev/agentbox + git -C "${REPO_DIR}" checkout podman + ln --symbolic "${REPO_DIR}"/agentbox ~/.local/bin/ +fi + +REPO_DIR="$(systemd-path user-state-private)"/git-sync +if [ -d "${REPO_DIR}" ] +then + git -C "${REPO_DIR}" pull +else + cd "$(systemd-path user-state-private)" || exit + git clone https://github.com/simonthum/git-sync +fi diff --git a/.local/bin/upgrade b/.local/bin/upgrade index 9e432c7..023622a 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -23,9 +23,9 @@ uv_update() { uv tool upgrade --all } -git_sync_update() { - echo Updating git-sync... - resync-git-sync +live_git_repo_update() { + echo Updating packages installed directly via git repos... + resync-live-git-repo-packages } podman_update() { @@ -41,5 +41,5 @@ emacs_update uv_update cargo_update ghup -git_sync_update +live_git_repo_update podman_update From a0f7abdd9da8aedf5ef324496a34a90c21c77f7c Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 15 Jan 2026 13:28:23 +0200 Subject: [PATCH 73/75] Create a script to clean up dangling buildah containers --- .local/bin/clear-buildah | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 .local/bin/clear-buildah diff --git a/.local/bin/clear-buildah b/.local/bin/clear-buildah new file mode 100755 index 0000000..591aebd --- /dev/null +++ b/.local/bin/clear-buildah @@ -0,0 +1,11 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +buildah_containers="$(buildah list | tail --lines +2 | cut --delimiter ' ' --fields 1)" +if [ -z "${buildah_containers}" ]; then + echo "No containers to remove" +else + buildah rm "${buildah_containers}" +fi From b77c518b79d6b35cf7bf18c67b4fe31e141ccab4 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 15 Jan 2026 15:45:05 +0200 Subject: [PATCH 74/75] Disable the testcontainers reaper service by default --- .config/environment.d/testcontainers.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/environment.d/testcontainers.conf b/.config/environment.d/testcontainers.conf index 8e07e7f..ada45f6 100644 --- a/.config/environment.d/testcontainers.conf +++ b/.config/environment.d/testcontainers.conf @@ -1,3 +1,4 @@ # keep-sorted start DOCKER_HOST=unix:///run/user/1000/podman/podman.sock +TESTCONTAINERS_RYUK_DISABLED=true # keep-sorted end From 7c036ccd7fe3af3a72814a6c2386a416a4a0289c Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 15 Jan 2026 16:01:03 +0200 Subject: [PATCH 75/75] Install the Kingfisher service image for secret detection --- .config/setup/41-download-container-images.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/setup/41-download-container-images.sh b/.config/setup/41-download-container-images.sh index df5f93f..07f44a6 100755 --- a/.config/setup/41-download-container-images.sh +++ b/.config/setup/41-download-container-images.sh @@ -8,6 +8,7 @@ IMAGES=( docker.io/ollama/ollama:latest docker.io/plantuml/plantuml-server:jetty ghcr.io/hadolint/hadolint:latest + ghcr.io/mongodb/kingfisher:latest lscr.io/linuxserver/transmission:latest # keep-sorted end )