Dotfiles
This is my setup script for Linux Mint 22.1:
sudo apt update sudo apt install -y fonts-jetbrains-mono git emacs homebank keepassxc sudo locale-gen 'de_DE.UTF-8' git clone https://github.com/fwinkelbauer/chunkyard ~/Projects/chunkyard git clone https://github.com/fwinkelbauer/conferences ~/Projects/conferences git clone https://github.com/fwinkelbauer/fwinkelbauer.github.io.git ~/Projects/website emacs -Q --batch -l org --eval '(org-babel-tangle-file "~/Projects/website/content/notes/dotfiles/index.org")'
Git
[user] email = mail@florianwinkelbauer.com name = Florian Winkelbauer signingKey = key::ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGNtvxcmXUsGJJ152xMSHJdro/P41CIYtfwFUOXYbQlS git-commits [gpg] format = ssh [commit] gpgSign = true [tag] gpgSign = true [fetch] prune = true pruneTags = true [push] followTags = true [merge] ff = only conflictStyle = zdiff3 [tag] sort = version:refname [log] date = iso [init] defaultBranch = main [url "git@github.com:fwinkelbauer/"] insteadOf = "https://github.com/fwinkelbauer/"
Bash
Create new backup:
directories=(
~/Documents
~/Music
~/Pictures
~/Videos
)
includes=(
'!\~$'
)
chunkyard store --directory "${directories[@]}" --include "${includes[@]}" --repository ~/.chunkyard --password 'Libsecret' "$@"
my-copy
Restore the latest backup:
my-copy chunkyard restore --repository ~/.chunkyard --directory ~/ --password 'Libsecret' "$@"
Copy local backup data from/to external devices:
local=~/.chunkyard
remotes=(
/media/florian/Backup1/Florian/main.chunkyard
/media/florian/Backup2/Florian/main.chunkyard
/media/florian/DORA1/main.chunkyard
)
for remote in "${remotes[@]}"; do
if ! [ -d "$remote" ]; then
continue
fi
if ! [ -x "$(command -v chunkyard)" ]; then
cp "$remote/chunkyard" ~/.local/bin/
chmod +x ~/.local/bin/chunkyard
fi
echo "Synchronizing with: $remote"
chunkyard copy --repository "$local" --destination "$remote" --password 'Libsecret' --last 20 "$@"
chunkyard copy --repository "$remote" --destination "$local" --password 'Libsecret' --last 20 "$@"
done
Move files to an archive:
file="$1"
name="$2"
archive=~/Documents/archive
year=$(date -r "$file" '+%Y')
date=$(date -r "$file" '+%Y-%m-%d')
dir="$archive/$year"
base=$(basename "$file")
output="$dir/$date-$name.${base##*.}"
mkdir -p "$dir"
mv "$file" "$output"
echo "Archived $output"
Translate bank .csv files to import them into Homebank:
file="$1"
account="$2"
dir=~/Downloads
output="$dir/$account.qif"
awk -v acc="$account" '{ print "!Account\nN" acc "\n^\n!Type:Bank"; FS=";"; sub(/^\xef\xbb\xbf/, ""); gsub("\"", ""); print "D" $1 "\nM" $2 "\nT" $4 "\n^" }' "$file" > "$output"
rm -f "$file"
echo "Created $output"
Manipulate files based on some rules:
find ~/Downloads -name '*.qif' -exec rm -f {} \;
find ~/Downloads -name '*.bin' -exec rm -f {} \;
find ~/Downloads -name 'Lohnsets*' -exec my-archive {} 'Intact-Lohn' \;
find ~/Downloads -name 'Rechnung_38*.1_*.pdf' -exec my-archive {} 'A1-Rechnung' \;
find ~/Downloads -name 'ZS*.pdf' -exec my-archive {} 'Leibnitzerfeld-Rechnung' \;
find ~/Downloads -name 'meinElba*1_suche.csv' -exec my-homebank {} 'Girokonto' \;
find ~/Downloads -name 'meinElba*7_suche.csv' -exec my-homebank {} 'Sparbuch' \;
Emacs
(setq global-auto-revert-non-file-buffers t
gc-cons-threshold (* 64 1024 1024)
use-short-answers t
backup-inhibited t
auto-save-default nil
create-lockfiles nil
visible-bell t
inhibit-startup-message t
initial-scratch-message nil
column-number-mode t
sentence-end-double-space nil
require-final-newline t
uniquify-buffer-name-style 'forward)
(setq-default fill-column 80
indent-tabs-mode nil)
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(blink-cursor-mode -1)
(global-auto-revert-mode t)
(delete-selection-mode t)
(show-paren-mode t)
(pixel-scroll-precision-mode t)
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(set-face-attribute 'default nil :family "JetBrains Mono" :foundry "JB" :slant 'normal :weight 'medium :height 120 :width 'normal)
(set-locale-environment "de_DE.UTF-8")
(use-package dired
:hook (dired-mode . dired-hide-details-mode)
:custom
(dired-auto-revert-buffer t)
(dired-dwim-target t)
(dired-free-space nil)
(dired-listing-switches "-alhv --time-style=+%Y-%m-%d --group-directories-first"))
(use-package org
:hook (org-mode . (lambda () (electric-indent-local-mode -1)))
:bind (("C-c c" . fw/org-overview)
("C-c i" . org-capture))
:config
(setq org-directory "~/Documents/org/"
org-default-notes-file (concat org-directory "inbox.org")
org-agenda-files (list org-directory)
org-edit-src-content-indentation 0
fw/org-default-diary-file (concat org-directory "diary.org"))
(setq org-capture-bookmark nil
org-capture-templates '(("i" "Inbox" entry (file org-default-notes-file) "* %?" :empty-lines-before 1)
("d" "Diary" entry (file fw/org-default-diary-file) "* %?\n%u" :empty-lines-before 1)))
(setq org-agenda-custom-commands
'(("." "Overview"
((agenda ""
((org-agenda-overriding-header "Kalender\n")
(org-agenda-time-grid '((daily today require-timed)
(800 1000 1200 1400 1600 1800 2000)
""
""))
(org-agenda-current-time-string "<<<<<<<<<<<<<<<<")
(org-agenda-timerange-leaders '("" ""))
(org-agenda-scheduled-leaders '("Geplant: " "Verscho: "))
(org-agenda-deadline-leaders '("Frist: " "Bald: " "Verpasst: "))
(org-agenda-time-leading-zero t)
(org-agenda-show-future-repeats nil)
(org-agenda-skip-deadline-prewarning-if-scheduled t)))
(todo "*"
((org-agenda-overriding-header "\nSonstiges\n")
(org-agenda-block-separator nil)
(org-agenda-sorting-strategy '(todo-state-up))
(org-agenda-todo-ignore-deadlines 'all)
(org-agenda-todo-ignore-scheduled 'all)))))))
(setq calendar-week-start-day 1
calendar-day-header-array ["So" "Mo" "Di" "Mi" "Do" "Fr" "Sa"]
calendar-day-name-array ["Sonntag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag" "Samstag"]
calendar-month-name-array ["Jänner" "Februar" "März" "April" "Mai" "Juni" "Juli" "August" "September" "Oktober" "November" "Dezember"]
calendar-holidays '((holiday-fixed 1 1 "Neujahr (frei)")
(holiday-fixed 1 6 "Heilige Drei Könige (frei)")
(holiday-fixed 2 14 "Valentinstag")
(holiday-easter-etc 1 "Ostermontag (frei)")
(holiday-easter-etc -46 "Aschermittwoch")
(holiday-easter-etc -2 "Karfreitag")
(holiday-fixed 5 1 "Österreichischer Staatsfeiertag (frei)")
(holiday-easter-etc 39 "Christi Himmelfahrt (frei)")
(holiday-easter-etc 50 "Pfingstmontag (frei)")
(holiday-easter-etc 60 "Fronleichnam (frei)")
(holiday-float 5 0 2 "Muttertag")
(holiday-float 6 0 2 "Vatertag")
(holiday-fixed 8 15 "Mariä Himmelfahrt (frei)")
(holiday-fixed 10 26 "Nationalfeiertag (frei)")
(holiday-fixed 11 1 "Allerheiligen (frei)")
(holiday-fixed 12 8 "Maria Empfängnis (frei)")
(holiday-fixed 12 24 "Heiliger Abend")
(holiday-fixed 12 25 "Erster Weihnachtstag (frei)")
(holiday-fixed 12 26 "Zweiter Weihnachtstag (frei)"))
parse-time-weekdays '(("so" . 0) ("mo" . 1) ("di" . 2) ("mi" . 3) ("do" . 4) ("fr" . 5) ("sa" . 6)))
(defun fw/org-overview ()
"Show my inbox and custom org-agenda."
(interactive)
(delete-other-windows)
(find-file org-default-notes-file)
(org-agenda nil ".")))
(use-package magit
:ensure t
:custom
(magit-display-buffer-function 'magit-display-buffer-same-window-except-diff-v1)
(magit-save-repository-buffers 'dontask)
(magit-repository-directories '(("~/Projects" . 1))))
(use-package vertico
:ensure t
:config
(vertico-mode)
(keymap-set vertico-map "DEL" 'vertico-directory-delete-char))
(use-package orderless
:ensure t
:custom
(completion-styles '(orderless basic))
(completion-category-overrides '((file (styles partial-completion)))))
(use-package consult
:ensure t
:bind (("C-x f" . find-file)
("C-x b" . consult-buffer)
("C-x k" . kill-current-buffer)
("C-c s" . consult-line)
("C-c f" . project-find-file)
("C-c g" . consult-git-grep)
("M-g g" . consult-goto-line)
("C-z" . undo)))
(use-package embark
:ensure t
:bind (("C-." . embark-act))
:custom
(prefix-help-command 'embark-prefix-help-command))
(use-package embark-consult
:ensure t)
(use-package modus-themes
:ensure t
:config
(load-theme 'modus-operandi-tinted t))