20250521.1747780314

This commit is contained in:
fz0x1 2025-05-21 00:31:54 +02:00
parent 54023cae23
commit 70605ab838
Signed by: fz0x1
GPG key ID: 6F81647BE1B459F4
9 changed files with 124 additions and 28 deletions

View file

@ -23,7 +23,7 @@
;;
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
(setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size 12.0))
(setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size 11.0))
;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
@ -79,6 +79,7 @@
(setq org-attach-method 'cp) ;; copy file to an attachments dir.
(setq org-attach-id-dir "~/org/attachments/")
(setq org-export-with-broken-links t)
(setq org-adapt-indentation t)
(setq org-startup-indented t)
(setq org-indent-mode t)
@ -125,26 +126,60 @@
;; For company-mode users,
;; (add-to-list 'company-backends 'hledger-company)
(use-package! org-roam
;; :ensure nil
:custom
(org-roam-directory "~/org/roam/")
(org-roam-capture-templates
'(("d" "default" plain
"%?\n\n\n* Key Features\n* Problems\n* Impact\n* Related:\n\n* References:\n"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
"#+title: ${title}\n#+filetags:\n#+date: %U\n"))))
(custom-set-faces
'((org-roam-link org-roam-link-current)
:foreground "#e24888" :underline t))
:config
;; (org-roam-db-autosync-mode)
(setq org-roam-completion-everywhere t)
(setq org-roam-database-connector 'sqlite-builtin)
(setq org-roam-db-node-include-function
(lambda ()
(not (member "ATTACH" (org-get-tags)))))
)
(require 'org-download)
(add-hook 'dired-mode-hook 'org-download-enable)
;; (use-package! org-roam
;; ;; :ensure nil
;; :custom
;; (org-roam-directory "~/org/roam/")
;; (org-roam-capture-templates
;; '(("d" "default" plain
;; "%?\n\n\n* Key Features\n* Problems\n* Impact\n* Related:\n\n* References:\n"
;; :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
;; "#+title: ${title}\n#+filetags:\n#+date: %U\n"))))
;; (custom-set-faces
;; '((org-roam-link org-roam-link-current)
;; :foreground "#e24888" :underline t))
;; :config
;; ;; (org-roam-db-autosync-mode)
;; (setq org-roam-completion-everywhere t)
;; (setq org-roam-database-connector 'sqlite-builtin)
;; (setq org-roam-db-node-include-function
;; (lambda ()
;; (not (member "ATTACH" (org-get-tags)))))
;; )
(defvar my/blog-post-directory "~/fz0x1.wtf/posts/"
"Directory for new blog posts captured with org-capture.")
(defconst my/cyr->lat
'((?а . "a") (?б . "b") ( . "v") (?г . "g") ( . "d") (?е . "e") ( . "e")
( . "zh") ( . "z") ( . "i") ( . "i") ( . "k") ( . "l") ( . "m")
( . "n") (?о . "o") (?п . "p") (?р . "r") (?с . "s") ( . "t") (?у . "u")
( . "f") (?х . "h") ( . "ts") ( . "ch") ( . "sh") ( . "sch")
( . "") ( . "y") ( . "") ( . "e") ( . "yu") ( . "ya")))
(defun my/slugify (str)
(let ((res (mapconcat
(lambda (ch) (or (cdr (assoc ch my/cyr->lat))
(char-to-string ch)))
(string-to-list (downcase str)) "")))
(setq res (replace-regexp-in-string "[^a-z0-9-]+" "-" res))
(setq res (replace-regexp-in-string "-\\{2,\\}" "-" res))
(string-trim res "-+" "-+")))
(defvar my/blog-last-title ""
"origin title var")
(defun my/blog-post-path ()
(let* ((title (read-string "Article name: "))
(slug (my/slugify title))
(date (format-time-string "%Y-%m-%d"))
(file (format "%s-%s.org" date slug)))
(setq my/blog-last-title title)
(expand-file-name file my/blog-post-directory)))
(setq org-default-priority ?D)
@ -214,6 +249,12 @@
"* [%<%Y-%m-%d>] [[%:link][%(transform-square-brackets-to-round-ones \"%:description\")]]\n:PROPERTIES:\n:ID: %(org-id-new)\n:END:\n Source: %:link\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n%?"
:empty-lines 0)
("b" "Blog post" plain
(file my/blog-post-path)
"#+title: %(or my/blog-last-title \"\")\n#+date: %U\n\n%?"
:empty-lines 1
:unnarrowed t)
("L" "Unselected web capture"
entry
(file+headline "~/org/inbox.org" "Web links")
@ -291,6 +332,7 @@
("book")
("movie")
("inbox")
("abandoned")
))
@ -319,6 +361,7 @@
("meeting" . (:foreground "magenta" :weight bold))
("CRITICAL" . (:foreground "red1" :weight bold))
("job" . (:foreground "medium spring green" :weight bold))
("abandoned" . (:foreground "medium spring grey18" :weight bold))
)
)
@ -364,7 +407,7 @@ PRIORITY may be one of the characters ?A, ?B, or ?C."
;; ------------------ Priority A ------------------
(tags "PRIORITY=\"A\""
((org-agenda-skip-function
'(or (org-agenda-skip-entry-if 'todo 'done)
'(or (org-agenda-skip-entry-if 'todo 'done)
(org-agenda-skip-entry-if 'todo '("STRT" "HOLD"))))
(org-agenda-overriding-header "Highpriority unfinished tasks:")))

View file

@ -46,7 +46,7 @@
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;tabs ; a tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler
treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
@ -84,7 +84,7 @@
:checkers
syntax ; tasing you for every semicolon you forget
(spell +hunspell +everywhere +flyspell) ; tasing you for misspelling misspelling
(spell +hunspell +flyspell) ; tasing you for misspelling misspelling
grammar ; tasing grammar mistake every you make
:tools
@ -154,7 +154,7 @@
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +roam2 +pretty +habits +journal) ; organize your plain life in plain text
(org +habits +journal) ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;graphviz ; diagrams for confusing yourself even more

View file

@ -55,3 +55,5 @@
(package! org-super-links
:recipe (:host github :repo "toshism/org-super-links"))
(package! hledger-mode)
(package! htmlize)
(package! org-download)

View file

@ -147,3 +147,5 @@ fi
source $HOME/.zshrc-additional
source $HOME/.zshrc-secrets
eval "$(pyenv init -)"
[ -f "/home/fz0x1/.ghcup/env" ] && . "/home/fz0x1/.ghcup/env" # ghcup-env

View file

@ -14,11 +14,13 @@ if [[ "$(uname)" == "Darwin" ]]; then
elif [[ "$(uname)" == "Linux" ]]; then
case $mode in
full)
maim -o $screenshot
maim -o "$screenshot"
echo "$screenshot" | xsel --clipboard --input
notify-send "Screenshot created: $screenshot"
;;
region)
maim -o --select $screenshot
maim -o --select "$screenshot"
echo "$screenshot" | xsel --clipboard --input
notify-send "Screenshot created: $screenshot"
;;
*)

View file

@ -3,7 +3,6 @@ image/webp=librewolf.desktop;
; image/png=org.xfce.ristretto.desktop;
; image/jpeg=org.xfce.ristretto.desktop;
text/plain=nvim.desktop;
text/html=nvim.desktop;
x-scheme-handler/http=librewolf.desktop;
x-scheme-handler/https=librewolf.desktop;
x-scheme-handler/terminal=Alacritty.desktop;

View file

@ -19,6 +19,8 @@ export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:/usr/local/go/bin
## cargo
export PATH=$PATH:$HOME/.cargo/bin
## ruby
export PATH=$PATH:$HOME/.local/share/gem/ruby/3.4.0/bin
## color
export TERM=tmux-256color
## default gui browser

22
linux/scripts/bin/dirstat Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env sh
target_dir="$1"
if [ ! -d "$target_dir" ]; then
echo "❌ Dir not found: $target_dir"
return 1
fi
total_lines=0
echo "📁 Analyze dir: $target_dir"
for f in "$target_dir"/*; do
[ -f "$f" ] || continue
lines=$(wc -l <"$f")
size=$(stat -c %s "$f")
mod=$(date -d @"$(stat -c %Y "$f")" +"%Y-%m-%d %H:%M:%S")
sha=$(shasum -a 256 "$f" | cut -d ' ' -f 1)
total_lines=$((total_lines + lines))
printf "%-30s %10s bytes %5s lines %s SHA256: %s\n" "$(basename "$f")" "$size" "$lines" "$mod" "$sha"
done
echo "📊 Total lines of code in the dir: $total_lines"

24
linux/scripts/bin/ex Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
### ARCHIVE EXTRACTION
# usage: ex <file>
if [ -f "$1" ]; then
case $1 in
*.tar.bz2) tar xjf "$1" ;;
*.tar.gz) tar xzf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.rar) unrar x "$1" ;;
*.gz) gunzip "$1" ;;
*.tar) tar xf "$1" ;;
*.tbz2) tar xjf "$1" ;;
*.tgz) tar xzf "$1" ;;
*.zip) unzip "$1" ;;
*.Z) uncompress "$1" ;;
*.7z) 7z x "$1" ;;
*.deb) ar x "$1" ;;
*.tar.xz) tar xf "$1" ;;
*.tar.zst) unzstd "$1" ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi