20250521.1747780314
This commit is contained in:
parent
54023cae23
commit
70605ab838
9 changed files with 124 additions and 28 deletions
|
@ -23,7 +23,7 @@
|
||||||
;;
|
;;
|
||||||
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
|
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
|
||||||
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
|
;; 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
|
;; 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
|
;; 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-method 'cp) ;; copy file to an attachments dir.
|
||||||
(setq org-attach-id-dir "~/org/attachments/")
|
(setq org-attach-id-dir "~/org/attachments/")
|
||||||
|
|
||||||
|
(setq org-export-with-broken-links t)
|
||||||
(setq org-adapt-indentation t)
|
(setq org-adapt-indentation t)
|
||||||
(setq org-startup-indented t)
|
(setq org-startup-indented t)
|
||||||
(setq org-indent-mode t)
|
(setq org-indent-mode t)
|
||||||
|
@ -125,26 +126,60 @@
|
||||||
;; For company-mode users,
|
;; For company-mode users,
|
||||||
;; (add-to-list 'company-backends 'hledger-company)
|
;; (add-to-list 'company-backends 'hledger-company)
|
||||||
|
|
||||||
(use-package! org-roam
|
(require 'org-download)
|
||||||
;; :ensure nil
|
(add-hook 'dired-mode-hook 'org-download-enable)
|
||||||
:custom
|
|
||||||
(org-roam-directory "~/org/roam/")
|
;; (use-package! org-roam
|
||||||
(org-roam-capture-templates
|
;; ;; :ensure nil
|
||||||
'(("d" "default" plain
|
;; :custom
|
||||||
"%?\n\n\n* Key Features\n* Problems\n* Impact\n* Related:\n\n* References:\n"
|
;; (org-roam-directory "~/org/roam/")
|
||||||
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
|
;; (org-roam-capture-templates
|
||||||
"#+title: ${title}\n#+filetags:\n#+date: %U\n"))))
|
;; '(("d" "default" plain
|
||||||
(custom-set-faces
|
;; "%?\n\n\n* Key Features\n* Problems\n* Impact\n* Related:\n\n* References:\n"
|
||||||
'((org-roam-link org-roam-link-current)
|
;; :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
|
||||||
:foreground "#e24888" :underline t))
|
;; "#+title: ${title}\n#+filetags:\n#+date: %U\n"))))
|
||||||
:config
|
;; (custom-set-faces
|
||||||
;; (org-roam-db-autosync-mode)
|
;; '((org-roam-link org-roam-link-current)
|
||||||
(setq org-roam-completion-everywhere t)
|
;; :foreground "#e24888" :underline t))
|
||||||
(setq org-roam-database-connector 'sqlite-builtin)
|
;; :config
|
||||||
(setq org-roam-db-node-include-function
|
;; ;; (org-roam-db-autosync-mode)
|
||||||
(lambda ()
|
;; (setq org-roam-completion-everywhere t)
|
||||||
(not (member "ATTACH" (org-get-tags)))))
|
;; (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)
|
(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%?"
|
"* [%<%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)
|
: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"
|
("L" "Unselected web capture"
|
||||||
entry
|
entry
|
||||||
(file+headline "~/org/inbox.org" "Web links")
|
(file+headline "~/org/inbox.org" "Web links")
|
||||||
|
@ -291,6 +332,7 @@
|
||||||
("book")
|
("book")
|
||||||
("movie")
|
("movie")
|
||||||
("inbox")
|
("inbox")
|
||||||
|
("abandoned")
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
@ -319,6 +361,7 @@
|
||||||
("meeting" . (:foreground "magenta" :weight bold))
|
("meeting" . (:foreground "magenta" :weight bold))
|
||||||
("CRITICAL" . (:foreground "red1" :weight bold))
|
("CRITICAL" . (:foreground "red1" :weight bold))
|
||||||
("job" . (:foreground "medium spring green" :weight bold))
|
("job" . (:foreground "medium spring green" :weight bold))
|
||||||
|
("abandoned" . (:foreground "medium spring grey18" :weight bold))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
ophints ; highlight the region an operation acts on
|
ophints ; highlight the region an operation acts on
|
||||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
||||||
;;tabs ; a tab bar for Emacs
|
;;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
|
;;unicode ; extended unicode support for various languages
|
||||||
(vc-gutter +pretty) ; vcs diff in the fringe
|
(vc-gutter +pretty) ; vcs diff in the fringe
|
||||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
|
|
||||||
:checkers
|
:checkers
|
||||||
syntax ; tasing you for every semicolon you forget
|
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
|
grammar ; tasing grammar mistake every you make
|
||||||
|
|
||||||
:tools
|
:tools
|
||||||
|
@ -154,7 +154,7 @@
|
||||||
;;nim ; python + lisp at the speed of c
|
;;nim ; python + lisp at the speed of c
|
||||||
;;nix ; I hereby declare "nix geht mehr!"
|
;;nix ; I hereby declare "nix geht mehr!"
|
||||||
;;ocaml ; an objective camel
|
;;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
|
;;php ; perl's insecure younger brother
|
||||||
;;plantuml ; diagrams for confusing people more
|
;;plantuml ; diagrams for confusing people more
|
||||||
;;graphviz ; diagrams for confusing yourself even more
|
;;graphviz ; diagrams for confusing yourself even more
|
||||||
|
|
|
@ -55,3 +55,5 @@
|
||||||
(package! org-super-links
|
(package! org-super-links
|
||||||
:recipe (:host github :repo "toshism/org-super-links"))
|
:recipe (:host github :repo "toshism/org-super-links"))
|
||||||
(package! hledger-mode)
|
(package! hledger-mode)
|
||||||
|
(package! htmlize)
|
||||||
|
(package! org-download)
|
||||||
|
|
|
@ -147,3 +147,5 @@ fi
|
||||||
source $HOME/.zshrc-additional
|
source $HOME/.zshrc-additional
|
||||||
source $HOME/.zshrc-secrets
|
source $HOME/.zshrc-secrets
|
||||||
eval "$(pyenv init -)"
|
eval "$(pyenv init -)"
|
||||||
|
|
||||||
|
[ -f "/home/fz0x1/.ghcup/env" ] && . "/home/fz0x1/.ghcup/env" # ghcup-env
|
|
@ -14,11 +14,13 @@ if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
elif [[ "$(uname)" == "Linux" ]]; then
|
elif [[ "$(uname)" == "Linux" ]]; then
|
||||||
case $mode in
|
case $mode in
|
||||||
full)
|
full)
|
||||||
maim -o $screenshot
|
maim -o "$screenshot"
|
||||||
|
echo "$screenshot" | xsel --clipboard --input
|
||||||
notify-send "Screenshot created: $screenshot"
|
notify-send "Screenshot created: $screenshot"
|
||||||
;;
|
;;
|
||||||
region)
|
region)
|
||||||
maim -o --select $screenshot
|
maim -o --select "$screenshot"
|
||||||
|
echo "$screenshot" | xsel --clipboard --input
|
||||||
notify-send "Screenshot created: $screenshot"
|
notify-send "Screenshot created: $screenshot"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -3,7 +3,6 @@ image/webp=librewolf.desktop;
|
||||||
; image/png=org.xfce.ristretto.desktop;
|
; image/png=org.xfce.ristretto.desktop;
|
||||||
; image/jpeg=org.xfce.ristretto.desktop;
|
; image/jpeg=org.xfce.ristretto.desktop;
|
||||||
text/plain=nvim.desktop;
|
text/plain=nvim.desktop;
|
||||||
text/html=nvim.desktop;
|
|
||||||
x-scheme-handler/http=librewolf.desktop;
|
x-scheme-handler/http=librewolf.desktop;
|
||||||
x-scheme-handler/https=librewolf.desktop;
|
x-scheme-handler/https=librewolf.desktop;
|
||||||
x-scheme-handler/terminal=Alacritty.desktop;
|
x-scheme-handler/terminal=Alacritty.desktop;
|
||||||
|
|
|
@ -19,6 +19,8 @@ export PATH=$PATH:$GOPATH/bin
|
||||||
export PATH=$PATH:/usr/local/go/bin
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
## cargo
|
## cargo
|
||||||
export PATH=$PATH:$HOME/.cargo/bin
|
export PATH=$PATH:$HOME/.cargo/bin
|
||||||
|
## ruby
|
||||||
|
export PATH=$PATH:$HOME/.local/share/gem/ruby/3.4.0/bin
|
||||||
## color
|
## color
|
||||||
export TERM=tmux-256color
|
export TERM=tmux-256color
|
||||||
## default gui browser
|
## default gui browser
|
||||||
|
|
22
linux/scripts/bin/dirstat
Executable file
22
linux/scripts/bin/dirstat
Executable 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
24
linux/scripts/bin/ex
Executable 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
|
Loading…
Add table
Reference in a new issue