mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-10 19:23:03 +03:00
Compare commits
2 commits
cd387f0e6b
...
6b058cc2cf
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b058cc2cf | |||
| d8a14dc486 |
7 changed files with 204 additions and 12 deletions
|
|
@ -3,7 +3,7 @@ enabled_backends = ["arch"]
|
||||||
hostname_groups_enabled = true
|
hostname_groups_enabled = true
|
||||||
|
|
||||||
[hostname_groups]
|
[hostname_groups]
|
||||||
violet = ["system","office","nvidia","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"]
|
violet = ["printer","system","office","nvidia","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"]
|
||||||
weiss = ["system","office","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"]
|
weiss = ["system","office","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"]
|
||||||
archlinux = ["system","office","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"]
|
archlinux = ["system","office","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ arch = [
|
||||||
"texlive-games",
|
"texlive-games",
|
||||||
"texlive-formatsextra",
|
"texlive-formatsextra",
|
||||||
"texlive-fontutils",
|
"texlive-fontutils",
|
||||||
|
"texlive-langcyrillic",
|
||||||
"texlive-binextra",
|
"texlive-binextra",
|
||||||
"texlive-bibtexextra",
|
"texlive-bibtexextra",
|
||||||
"texlive-basic",]
|
"texlive-basic",]
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,4 @@ Description=Music Player Daemon
|
||||||
ExecStart=/usr/bin/mpd --no-daemon
|
ExecStart=/usr/bin/mpd --no-daemon
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=graphical-session.target
|
WantedBy=wm-session.target
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
(setq org-directory (expand-file-name "~/30-39 Life/32 org-mode"))
|
(setq org-directory (expand-file-name "~/30-39 Life/32 org-mode"))
|
||||||
|
|
||||||
(use-package org
|
(use-package org
|
||||||
:straight (:type built-in)
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(unless (file-exists-p org-directory)
|
(unless (file-exists-p org-directory)
|
||||||
|
|
@ -53,8 +53,7 @@
|
||||||
(use-package org-contrib
|
(use-package org-contrib
|
||||||
:straight (org-contrib
|
:straight (org-contrib
|
||||||
:type git
|
:type git
|
||||||
:repo "https://git.sr.ht/~bzg/org-contrib"
|
:repo "https://git.sr.ht/~bzg/org-contrib")
|
||||||
:build t)
|
|
||||||
:after (org)
|
:after (org)
|
||||||
:config
|
:config
|
||||||
(require 'ox-extra)
|
(require 'ox-extra)
|
||||||
|
|
@ -193,6 +192,92 @@ With ARG, repeats or can move backward if negative."
|
||||||
(concat org-directory "/"
|
(concat org-directory "/"
|
||||||
(completing-read "Org file: " files)))))
|
(completing-read "Org file: " files)))))
|
||||||
|
|
||||||
|
(defvar-local my/org-fold-cycle-last-pos nil
|
||||||
|
"Last position where `my/org-fold-cycle' was called.")
|
||||||
|
|
||||||
|
(defvar-local my/org-fold-cycle-status nil
|
||||||
|
"Current folding status for `my/org-fold-cycle'.
|
||||||
|
Can be 'folded, 'children, or 'subtree.")
|
||||||
|
|
||||||
|
(defun my/org-fold-cycle ()
|
||||||
|
"Cycle folding state of current heading.
|
||||||
|
|
||||||
|
The cycling works as follows:
|
||||||
|
- If heading is FOLDED: show children only
|
||||||
|
- If heading shows CHILDREN and this was the last command at same position:
|
||||||
|
* If heading has sub-headings: show entire subtree
|
||||||
|
* If heading has no sub-headings: fold the heading
|
||||||
|
- Otherwise: fold the heading
|
||||||
|
|
||||||
|
The complete cycle is:
|
||||||
|
- With children: FOLDED → CHILDREN → SUBTREE → FOLDED
|
||||||
|
- Without children: FOLDED → CHILDREN → FOLDED
|
||||||
|
|
||||||
|
If not at a heading, delegates to the normal `org-cycle' function."
|
||||||
|
(interactive)
|
||||||
|
|
||||||
|
;; If not at a heading and can't move to one, delegate to org-cycle
|
||||||
|
(unless (org-at-heading-p)
|
||||||
|
(org-cycle)
|
||||||
|
(cl-return-from my/org-fold-cycle))
|
||||||
|
|
||||||
|
(let* ((current-pos (point))
|
||||||
|
(eoh (save-excursion (outline-end-of-heading) (point)))
|
||||||
|
(eos (save-excursion
|
||||||
|
(org-end-of-subtree t t)
|
||||||
|
(if (eobp) (point) (1- (point)))))
|
||||||
|
;; Check if content after heading is folded
|
||||||
|
(folded-p (org-fold-folded-p eoh 'headline))
|
||||||
|
;; Check if we're continuing from the same position
|
||||||
|
(same-pos (equal my/org-fold-cycle-last-pos current-pos))
|
||||||
|
(continued (and (or (eq last-command 'my/org-fold-cycle)
|
||||||
|
(eq last-command 'org-cycle))
|
||||||
|
same-pos))
|
||||||
|
;; Check if heading has children (sub-headings)
|
||||||
|
(has-children (save-excursion
|
||||||
|
(org-back-to-heading t)
|
||||||
|
(let ((level (org-current-level)))
|
||||||
|
(outline-next-heading)
|
||||||
|
(and (not (eobp))
|
||||||
|
(> (org-current-level) level))))))
|
||||||
|
|
||||||
|
(cond
|
||||||
|
;; State 1: Heading is folded → show children
|
||||||
|
(folded-p
|
||||||
|
(org-fold-show-entry)
|
||||||
|
(org-fold-show-children)
|
||||||
|
(org-unlogged-message "CHILDREN")
|
||||||
|
(setq my/org-fold-cycle-status 'children))
|
||||||
|
|
||||||
|
;; State 2: Was showing children, same position → show entire subtree (if has children)
|
||||||
|
((and continued (eq my/org-fold-cycle-status 'children))
|
||||||
|
(if has-children
|
||||||
|
(progn
|
||||||
|
(org-fold-show-subtree)
|
||||||
|
(org-unlogged-message "SUBTREE")
|
||||||
|
(setq my/org-fold-cycle-status 'subtree))
|
||||||
|
;; No children, skip SUBTREE and fold directly
|
||||||
|
(org-fold-hide-subtree)
|
||||||
|
(org-unlogged-message "FOLDED")
|
||||||
|
(setq my/org-fold-cycle-status 'folded)))
|
||||||
|
|
||||||
|
;; State 3: Otherwise → fold the heading
|
||||||
|
(t
|
||||||
|
(org-fold-hide-subtree)
|
||||||
|
(org-unlogged-message "FOLDED")
|
||||||
|
(setq my/org-fold-cycle-status 'folded)))
|
||||||
|
|
||||||
|
;; Remember position for next invocation
|
||||||
|
(setq my/org-fold-cycle-last-pos current-pos)))
|
||||||
|
|
||||||
|
(defun my/org-fold-cycle-around (fun &rest args)
|
||||||
|
(if (org-at-heading-p)
|
||||||
|
(my/org-fold-cycle)
|
||||||
|
(apply fun args)))
|
||||||
|
|
||||||
|
(with-eval-after-load 'org-cycle
|
||||||
|
(advice-add #'org-cycle :around #'my/org-fold-cycle-around))
|
||||||
|
|
||||||
(defun my/enable-org-latex ()
|
(defun my/enable-org-latex ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(customize-set-variable 'org-highlight-latex-and-related '(native))
|
(customize-set-variable 'org-highlight-latex-and-related '(native))
|
||||||
|
|
|
||||||
17
Arch.org
17
Arch.org
|
|
@ -166,6 +166,7 @@ Below is the table enabling different groups on different hostnames:
|
||||||
| nvidia | | | + |
|
| nvidia | | | + |
|
||||||
| office | + | + | + |
|
| office | + | + | + |
|
||||||
| system | + | + | + |
|
| system | + | + | + |
|
||||||
|
| printer | | | + |
|
||||||
|
|
||||||
And the code to format it as TOML:
|
And the code to format it as TOML:
|
||||||
#+NAME: metapac-groups-format
|
#+NAME: metapac-groups-format
|
||||||
|
|
@ -244,12 +245,22 @@ Various drivers, I'm not sure which I actually need, so...
|
||||||
| xf86-video-amdgpu |
|
| xf86-video-amdgpu |
|
||||||
| xf86-video-ati |
|
| xf86-video-ati |
|
||||||
|
|
||||||
NVIDIA drivers for violet
|
NVIDIA drivers & AI stuff for violet
|
||||||
| Category | Arch dependency |
|
| Category | Arch dependency |
|
||||||
|----------+-----------------|
|
|----------+-----------------|
|
||||||
| nvidia | cuda |
|
| nvidia | cuda |
|
||||||
| nvidia | nvidia-utils |
|
| nvidia | nvidia-utils |
|
||||||
| nvidia | nvidia |
|
| nvidia | nvidia |
|
||||||
|
| nvidia | ollama-cuda |
|
||||||
|
|
||||||
|
Printer packages.
|
||||||
|
| Category | Arch dependency |
|
||||||
|
|----------+-----------------|
|
||||||
|
| printer | cups |
|
||||||
|
| printer | usbutils |
|
||||||
|
| printer | brlaser |
|
||||||
|
| printer | naps2-bin |
|
||||||
|
| printer | brscan4 |
|
||||||
|
|
||||||
#+NAME: packages
|
#+NAME: packages
|
||||||
#+begin_src emacs-lisp :tangle no :var category=""
|
#+begin_src emacs-lisp :tangle no :var category=""
|
||||||
|
|
@ -260,6 +271,10 @@ NVIDIA drivers for violet
|
||||||
<<packages("nvidia")>>
|
<<packages("nvidia")>>
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
#+begin_src scheme :tangle .config/metapac/groups/printer.toml :noweb yes
|
||||||
|
<<packages("printer")>>
|
||||||
|
#+end_src
|
||||||
|
|
||||||
#+begin_src scheme :tangle .config/metapac/groups/system.toml :noweb yes
|
#+begin_src scheme :tangle .config/metapac/groups/system.toml :noweb yes
|
||||||
<<packages()>>
|
<<packages()>>
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
|
||||||
|
|
@ -4318,7 +4318,6 @@ c.tabs.favicons.scale = 1
|
||||||
#+end_src
|
#+end_src
|
||||||
* Various software
|
* Various software
|
||||||
This section generates manifests for various desktop software that I'm using.
|
This section generates manifests for various desktop software that I'm using.
|
||||||
|
|
||||||
** Browsers
|
** Browsers
|
||||||
| Category | Arch dependency |
|
| Category | Arch dependency |
|
||||||
|----------+------------------------|
|
|----------+------------------------|
|
||||||
|
|
@ -4345,6 +4344,7 @@ This section generates manifests for various desktop software that I'm using.
|
||||||
| latex | texlive-basic | |
|
| latex | texlive-basic | |
|
||||||
| latex | texlive-bibtexextra | |
|
| latex | texlive-bibtexextra | |
|
||||||
| latex | texlive-binextra | |
|
| latex | texlive-binextra | |
|
||||||
|
| latex | texlive-langcyrillic | |
|
||||||
| latex | texlive-fontsextra | t |
|
| latex | texlive-fontsextra | t |
|
||||||
| latex | texlive-fontutils | |
|
| latex | texlive-fontutils | |
|
||||||
| latex | texlive-formatsextra | |
|
| latex | texlive-formatsextra | |
|
||||||
|
|
@ -4531,7 +4531,7 @@ Description=Music Player Daemon
|
||||||
ExecStart=/usr/bin/mpd --no-daemon
|
ExecStart=/usr/bin/mpd --no-daemon
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=graphical-session.target
|
WantedBy=wm-session.target
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src conf :tangle .config/systemd/user/deterred-mpd.service
|
#+begin_src conf :tangle .config/systemd/user/deterred-mpd.service
|
||||||
|
|
|
||||||
99
Emacs.org
99
Emacs.org
|
|
@ -4993,13 +4993,15 @@ References:
|
||||||
- [[https://orgmode.org/manual/][Manual]]
|
- [[https://orgmode.org/manual/][Manual]]
|
||||||
|
|
||||||
** Installation & basic settings
|
** Installation & basic settings
|
||||||
Use the built-in org mode (=:type built-in=).
|
Somehow the built-in =org-mode= had some issues with native-comp on my setup, so I pull the latest version from git for now.
|
||||||
|
|
||||||
|
I tried to pin the package with straight, but somehow this doesn't seem to work...
|
||||||
|
|
||||||
#+begin_src emacs-lisp :noweb yes
|
#+begin_src emacs-lisp :noweb yes
|
||||||
(setq org-directory (expand-file-name "~/30-39 Life/32 org-mode"))
|
(setq org-directory (expand-file-name "~/30-39 Life/32 org-mode"))
|
||||||
|
|
||||||
(use-package org
|
(use-package org
|
||||||
:straight (:type built-in)
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(unless (file-exists-p org-directory)
|
(unless (file-exists-p org-directory)
|
||||||
|
|
@ -5069,8 +5071,7 @@ This used to have =org-contacts= and =ol-notmuch= at some point, but they have s
|
||||||
(use-package org-contrib
|
(use-package org-contrib
|
||||||
:straight (org-contrib
|
:straight (org-contrib
|
||||||
:type git
|
:type git
|
||||||
:repo "https://git.sr.ht/~bzg/org-contrib"
|
:repo "https://git.sr.ht/~bzg/org-contrib")
|
||||||
:build t)
|
|
||||||
:after (org)
|
:after (org)
|
||||||
:config
|
:config
|
||||||
(require 'ox-extra)
|
(require 'ox-extra)
|
||||||
|
|
@ -5239,6 +5240,96 @@ A function to open a file from =org-directory=, excluding a few directories like
|
||||||
(concat org-directory "/"
|
(concat org-directory "/"
|
||||||
(completing-read "Org file: " files)))))
|
(completing-read "Org file: " files)))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
*** Fix org-cycle
|
||||||
|
I don't know what's going on with =org-cycle=...
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defvar-local my/org-fold-cycle-last-pos nil
|
||||||
|
"Last position where `my/org-fold-cycle' was called.")
|
||||||
|
|
||||||
|
(defvar-local my/org-fold-cycle-status nil
|
||||||
|
"Current folding status for `my/org-fold-cycle'.
|
||||||
|
Can be 'folded, 'children, or 'subtree.")
|
||||||
|
|
||||||
|
(defun my/org-fold-cycle ()
|
||||||
|
"Cycle folding state of current heading.
|
||||||
|
|
||||||
|
The cycling works as follows:
|
||||||
|
- If heading is FOLDED: show children only
|
||||||
|
- If heading shows CHILDREN and this was the last command at same position:
|
||||||
|
* If heading has sub-headings: show entire subtree
|
||||||
|
* If heading has no sub-headings: fold the heading
|
||||||
|
- Otherwise: fold the heading
|
||||||
|
|
||||||
|
The complete cycle is:
|
||||||
|
- With children: FOLDED → CHILDREN → SUBTREE → FOLDED
|
||||||
|
- Without children: FOLDED → CHILDREN → FOLDED
|
||||||
|
|
||||||
|
If not at a heading, delegates to the normal `org-cycle' function."
|
||||||
|
(interactive)
|
||||||
|
|
||||||
|
;; If not at a heading and can't move to one, delegate to org-cycle
|
||||||
|
(unless (org-at-heading-p)
|
||||||
|
(org-cycle)
|
||||||
|
(cl-return-from my/org-fold-cycle))
|
||||||
|
|
||||||
|
(let* ((current-pos (point))
|
||||||
|
(eoh (save-excursion (outline-end-of-heading) (point)))
|
||||||
|
(eos (save-excursion
|
||||||
|
(org-end-of-subtree t t)
|
||||||
|
(if (eobp) (point) (1- (point)))))
|
||||||
|
;; Check if content after heading is folded
|
||||||
|
(folded-p (org-fold-folded-p eoh 'headline))
|
||||||
|
;; Check if we're continuing from the same position
|
||||||
|
(same-pos (equal my/org-fold-cycle-last-pos current-pos))
|
||||||
|
(continued (and (or (eq last-command 'my/org-fold-cycle)
|
||||||
|
(eq last-command 'org-cycle))
|
||||||
|
same-pos))
|
||||||
|
;; Check if heading has children (sub-headings)
|
||||||
|
(has-children (save-excursion
|
||||||
|
(org-back-to-heading t)
|
||||||
|
(let ((level (org-current-level)))
|
||||||
|
(outline-next-heading)
|
||||||
|
(and (not (eobp))
|
||||||
|
(> (org-current-level) level))))))
|
||||||
|
|
||||||
|
(cond
|
||||||
|
;; State 1: Heading is folded → show children
|
||||||
|
(folded-p
|
||||||
|
(org-fold-show-entry)
|
||||||
|
(org-fold-show-children)
|
||||||
|
(org-unlogged-message "CHILDREN")
|
||||||
|
(setq my/org-fold-cycle-status 'children))
|
||||||
|
|
||||||
|
;; State 2: Was showing children, same position → show entire subtree (if has children)
|
||||||
|
((and continued (eq my/org-fold-cycle-status 'children))
|
||||||
|
(if has-children
|
||||||
|
(progn
|
||||||
|
(org-fold-show-subtree)
|
||||||
|
(org-unlogged-message "SUBTREE")
|
||||||
|
(setq my/org-fold-cycle-status 'subtree))
|
||||||
|
;; No children, skip SUBTREE and fold directly
|
||||||
|
(org-fold-hide-subtree)
|
||||||
|
(org-unlogged-message "FOLDED")
|
||||||
|
(setq my/org-fold-cycle-status 'folded)))
|
||||||
|
|
||||||
|
;; State 3: Otherwise → fold the heading
|
||||||
|
(t
|
||||||
|
(org-fold-hide-subtree)
|
||||||
|
(org-unlogged-message "FOLDED")
|
||||||
|
(setq my/org-fold-cycle-status 'folded)))
|
||||||
|
|
||||||
|
;; Remember position for next invocation
|
||||||
|
(setq my/org-fold-cycle-last-pos current-pos)))
|
||||||
|
|
||||||
|
(defun my/org-fold-cycle-around (fun &rest args)
|
||||||
|
(if (org-at-heading-p)
|
||||||
|
(my/org-fold-cycle)
|
||||||
|
(apply fun args)))
|
||||||
|
|
||||||
|
(with-eval-after-load 'org-cycle
|
||||||
|
(advice-add #'org-cycle :around #'my/org-fold-cycle-around))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** UI
|
** UI
|
||||||
*** LaTeX fragments
|
*** LaTeX fragments
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue