Scenario: I want my Zsh and Oh-My-Zsh setup to be the same across my personal Mac, my work Mac, my Linux Desktop, my raspberry pis.
Each of these have different usernames (and even different paths to their home directory /Users/MyUserName
for Mac and /home/MyUserName
for Linux.
I tried creating a git repo for my .zshrc
and created some basic scripts that git pull all my plugins but the problems arose when i tried to install on a new raspberry pi and noticed that the path to my home directory depended on my system and .oh-my-zsh install script uses the ZSH
environmental variable to install itself. This meant that i needed to create a pre-oh-my-zsh .zshrc that detected the system with uname -s
and set the prefix for the ZSH
variable appropriately.
Unfortunately .oh-my-zsh
just overwrites this so whenever I would want to make edits to my config and push it the git repo i'll have to re-install each time. It seems like there must be a solution.
How do I make it so my zsh dotfiles are agnostic to my machine environment and my username for paths so that I can install .oh-my-zsh and make updates to my dotfiles that I can propagate to my other machines?