My core configuration (dot) files, shell functions and utility scripts.
-
ZSH
is the leading shell. -
Bash
configs exist for rare cases in which zsh is not availlable, they are not regularly maintained and usually outdated. -
If not clearly
ZSH
related, all alias, function, etc. files should beBash
compatible (but not always POSIX compliant). -
All files use the
" \{\{\{( .*)?$"
(or{{{ }}}
in short) folding comment pattern (use e.g. emacs, VS Code, eclipse)
-
Review
functions.zsh
and aliases (update ancient code, remove obsolete code, maybe modularize) -
Include additional shell and python scripts
File / Folder | App | Description |
---|---|---|
Common ZSH login shell environment (variables). |
||
Common ZSH logout cleanup |
||
Common ZSH config |
||
|
OS, distirbution, and/or host specific ZSH configs. |
|
Common aliases |
||
OS, distirbution, and/or host specific specific aliases. |
||
Common shell functions. |
||
OS, distirbution, and/or host specific shell aliases. |
||
Common Bash config (rarely maintained). |
||
Currently only loaded from insicede |
||
Used by the display manager. Currently only loades |
||
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 |
ip=(192 168 100 18)
printf "ip: %s\n" $(join_by .
Custom host / OS specific ZSH configurtaions, aliases, functions, xsessions and xresources can be created and they are dynamically loaded in case of a match. This provides a conveniant way to enrich the envoronment in case of a spicific host / os without messing around with the core files.
This is the sequence in which zshrc’s, aleases 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.zsh
The 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, perv/next song) and pulse audio volume control (+/-5% and toggle mute) optionally showing an OSD. |
File | Description |
---|---|
Link all dotfile repo files (except for loacl scripts and documentation) to the user’s home directory. Missing directories are created in the process. It currently moves existing files / links, that would be overwritten in the process, to a backup location inside the home directory. |
|
Updates the dotfile repo file permissions. |
|
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