My core configuration (dot) files, shell functions and utility scripts.
dotfiles/ Actual dotfiles symlinked to $HOME (zsh, bash, vim, X11, etc.)
bin/ User utility scripts (added to PATH via ~/bin/)
system-scripts/ System/admin scripts (some require root)
lib/ Shared shell libraries (commons.sh)
tools/ Repo tooling: link.sh, fix-modelines.py, etc.
docs/ Documentation and TODO
_archive/ Archived scripts pending review (not in PATH)-
ZSHis the leading shell. -
Bashconfigs exist for rare cases in which zsh is not available, they are not regularly maintained and usually outdated (consolidation is however a backlog topic). -
Portability is a core goal: the
dotfiles/+bin/+lib/+tools/link.shapproach is intentionally dependency-free and should work without additional packages or root access. -
Restricted-host support matters: basic setup should still be usable on systems with only
bashavailable (nozsh, no extra tooling). -
If not clearly
ZSHrelated, all alias, function, etc. files should beBashcompatible (but not always POSIX compliant). -
All files use the
" \{\{\{( .*)?$"(or{{{ }}}in short) folding comment pattern (use e.g. emacs, VS Code, eclipse)
|
ℹ️
|
See docs/TODO.adoc for the full task/improvement list. |
| File / Folder | App | Description |
|---|---|---|
Common ZSH login shell environment (variables). |
||
Common ZSH logout cleanup |
||
Common ZSH config |
||
|
OS, distribution, and/or host specific ZSH configs. |
|
Common aliases |
||
|
OS, distribution, and/or host specific aliases. |
|
Common shell functions. |
||
Common Bash config (rarely maintained). |
||
Used by the display manager. Loads |
||
Loaded from inside |
||
|
Common, default and host specific xsession initialization scripts loaded from inside |
|
Common and host specific X Resources. The |
||
General and app specific mouse button/wheel mappings. |
||
VIM configuration |
||
MPV configuration and key bindings. |
||
Old MPlayer configuration and key bindings (switched to |
Custom host / OS specific ZSH configurations, aliases, functions, xsessions and xresources can be created and they are dynamically loaded in case of a match. This provides a convenient way to enrich the environment in case of a specific host / os without messing around with the core files.
This is the sequence in which zshrc’s, aliases and functions are loaded from within .zshrc:
# top of zshrc (always loaded)
.zsh.d/functions.zsh
.zsh.d/aliases.zsh
# bottom of zshrc (loaded in given sequence if host/os matches)
.zsh.d/functions-${OS}.zsh
.zsh.d/functions-${HOST}.zsh
.zsh.d/functions-${HOST}-${OS}.zsh
.zsh.d/functions-${HOST}-${OS}_wsl.zsh
.zsh.d/aliases-${OS}.zsh
.zsh.d/aliases-${HOST}.zsh
.zsh.d/aliases-${HOST}-${OS}.zsh
.zsh.d/aliases-${HOST}-${OS}_wsl.zsh
.zsh.d/zshrc-${OS}.zsh
.zsh.d/zshrc-${HOST}.zsh
.zsh.d/zshrc-${HOST}-${OS}.zsh
.zsh.d/zshrc-${HOST}-${OS}_wsl.zshThe special suffix _wsl is used on Windows Subsystem Linux, this allows the -linux files to be loaded in addition to (followed by) a WSL specific -linux_wsl file.
Some examples can be seen in the Dot-files list above.
| File | Description |
|---|---|
Script to be used from within X (e.g. media key mappings) for media player control (play/pause, prev/next song) and pulse audio volume control (+/-5% and toggle mute) optionally showing an OSD. |
|
Quietly update apt package indexes and store a timestamp. |
|
Organize image files into a directory hierarchy based on EXIF star ratings (0-5) and color labels. Features smart caching, directory mapping with regex patterns, and move/copy modes. See |
|
Fetch RTMP and direct HTTP media links from broadcaster pages using wget and rtmpdump. |
|
aria2c downloader wrapper. |
|
Diff INI files. |
|
Firefox copy utility. |
|
Copy MPV bookmarks from Firefox. |
|
Get files by extension from a given URL using wget. |
|
GIF frame cycling utility. |
|
GIF frame delay inspector/modifier. |
|
Fix Git file permissions (chmod). |
|
Concatenate images. |
|
Find media files and play with mpv. |
|
Parallel rsync backup. |
|
rsync with limited throughput. |
|
Parallel file fetching wrapper for wget. |
|
Execute a command for each line read from stdin. |
|
Suspend the X session. |
Scripts intended for system administrators or privileged operations (some require root).
| File | Description |
|---|---|
System backup script with exclusion list; supports full and incremental backups. |
|
Force system shutdown at a configured bedtime with grace periods, desktop notifications, and emergency overrides. See |
|
Backup script for MySQL and PostgreSQL databases. |
|
Send a weekly Fail2Ban summary email from recent log data (intended for cron). |
|
Run routine Nextcloud maintenance tasks (DB indices, repair, integrity checks, app updates). Intended for cron with cronic. |
|
Generate OpenVPN client configuration bundles from server PKI assets; manage static IPs, CCD, and certificate revocation. |
| File | Description |
|---|---|
Symlink all files in |
|
Update dotfile repo file permissions. |
|
Normalize and deduplicate editor modelines (Emacs, Vim, VS Code, ShellCheck) across shell scripts. |
|
Apply style fixes to shell scripts. |
|
README.adoc |
This file. |
Some of the shell functions contained in .zsh.d/functions.zsh will be described in the following chapters.
| Function | Description |
|---|---|
|
Returns the current function’s name: |
|
Returns the function’s caller name (if caller is a function): |
| Function | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Function | Description |
|---|---|
|
Print the |
|
Checks if the given file exists, if so asks wether to overwrite it via (y)es/(n)o input. Returns |
| Function | Description |
|---|---|
|
Join array / arguments using the given delimiter. On ZSH consider using |
| Function | Description |
|---|---|
|
Execute a command with a delay (using |
|
Monitor input (read lines) and execute command in foreground using input as command argument. Example: |
|
Monitor input (read lines) and execute command in background (job) using input as command argument. Example: |
|
Monitor X clipboard and execute command using clipboard content as command argument. Example: |
| Function | Description |
|---|---|
|
Download media files using |
|
The same as |
| Function | Description |
|---|---|
|
Find any media file (default: |
|
Convert the given |
|
Convert the given |
|
Concatenates all |
|
Crop |
| Function | Description |
|---|---|
|
Returns all frame indexes of a gif |
|
Concatenate images. |
|
Returns dimensions given images in format: |
Icon pack by Icons8


















