A first try in getting the posix shells (zsh and bash) into one configuration sourced..
Find a file
2026-07-22 11:39:47 +02:00
.shell.d exporting variables is essential.. 2026-07-22 11:39:47 +02:00
.gitignore wip 2026-02-22 14:30:53 +01:00
.shell fixes 2026-07-21 22:41:22 +02:00
.stow-local-ignore added README and stow ignore file 2026-01-18 22:50:04 +01:00
README.md fixing path name consistency 2026-06-20 17:36:23 +02:00

posix alias and environment

The configurations should work for bash AND zsh shells. You can essentially just source one file - the .shell file.

. "$HOME/.shell"

Thats it. done!

User configuration

You can now add userconfiguration in the .shell.d/user.d/ dir. In there, you should put shellscripts, which work with your configuration. If you need to have bash and zsh working at the same time, your scripts have to check edge cases. The easiest way to do this would be to check if [[ -n "$BASH_VERSION" ]] or if [[ -n "$ZSH_VERSION" ]]. You also can get your current shell with shell=$(shell:get-shell) and then putting that in either an if statement or case statement to check for "zsh" or "bash"

debugging

With shell:sourced you can view the sourced list of files. It even includes an ms timestamp, that is fairly accurate (calculated by date +%s%3N before and after source)

 shell:sourced
1| ~/.shell.d/00-colors:1ms
2| ~/.shell.d/01-lib:2ms
3| ~/.shell.d/02-env:139ms
4| ~/.shell.d/03-package-manager:4ms
5| ~/.shell.d/04-alias:9ms
6| ~/.shell.d/98-proxy:76ms
7| ~/.shell.d/99-after:2269ms