1
0
Fork 0

zsh: Try splitting zprofile by OS

This commit is contained in:
Jeremy Kaplan 2024-09-25 18:16:06 -04:00 committed by Jeremy Kaplan
commit 8599d7c7cf
7 changed files with 40 additions and 13 deletions

View file

@ -1,6 +1,5 @@
- shell: - shell:
- - command: brew/install
command: brew/install
stdout: true stdout: true
stderr: true stderr: true
quiet: false quiet: false
@ -12,3 +11,4 @@
~/.config/aerospace: aerospace/ ~/.config/aerospace: aerospace/
~/.config/karabiner: karabiner/ ~/.config/karabiner: karabiner/
~/.config/tridactyl: tridactyl/ ~/.config/tridactyl: tridactyl/
~/.profile: etc/profile.darwin

View file

@ -32,12 +32,10 @@
~/.ignore: etc/ignore ~/.ignore: etc/ignore
~/.my.cnf: mysql/.my.cnf ~/.my.cnf: mysql/.my.cnf
~/.npmrc: npm/.npmrc ~/.npmrc: npm/.npmrc
~/.profile: etc/profile
~/.psqlrc: psql/.psqlrc ~/.psqlrc: psql/.psqlrc
~/.rgignore: etc/rgignore ~/.rgignore: etc/rgignore
~/.tmux.conf: tmux/.tmux.conf ~/.tmux.conf: tmux/.tmux.conf
~/.vimrc: vim/.vimrc ~/.vimrc: vim/.vimrc
~/.vim: vim/ ~/.vim: vim/
~/.zprofile: zsh/.zprofile
~/.zshenv: zsh/.zshenv ~/.zshenv: zsh/.zshenv
~/.zshrc: zsh/.zshrc ~/.zshrc: zsh/.zshrc

View file

@ -1,8 +0,0 @@
has() {
command -V "$1" > /dev/null 2>&1
}
if has gnome-keyring-daemon; then
eval "$(gnome-keyring-daemon --start)"
export SSH_AUTH_SOCK
fi

View file

@ -1,3 +1,7 @@
has() {
command -V "$1" > /dev/null 2>&1
}
source_if() { source_if() {
if [ -e "$1" ]; then if [ -e "$1" ]; then
source "$1" source "$1"

33
etc/profile.linux Normal file
View file

@ -0,0 +1,33 @@
has() {
command -V "$1" > /dev/null 2>&1
}
source_if() {
if [ -e "$1" ]; then
source "$1"
fi
}
path_if() {
if [ -d "$1" ]; then
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${1}${PATH:+:$PATH}"
esac
fi
}
source_if "${HOME}/.nix-profile/etc/profile.d/nix.sh"
path_if "$HOME/bin"
path_if "$HOME/.local/bin"
unset -f source_if
unset -f path_if
if has gnome-keyring-daemon; then
eval "$(gnome-keyring-daemon --start)"
export SSH_AUTH_SOCK
fi

View file

@ -1,4 +1,5 @@
- link: - link:
~/.config/user-dirs.dirs: etc/user-dirs.dirs ~/.config/user-dirs.dirs: etc/user-dirs.dirs
~/.profile: etc/profile.linux
./alacritty/os.toml: alacritty/linux.toml ./alacritty/os.toml: alacritty/linux.toml
./zsh/os.zshrc: zsh/linux.zshrc ./zsh/os.zshrc: zsh/linux.zshrc

View file

@ -73,7 +73,6 @@ ${prompt}"
export RPROMPT='' export RPROMPT=''
# aliases # aliases
source $HOME/.zprofile
source $HOME/.config/zsh/aliases source $HOME/.config/zsh/aliases
source $HOME/.config/zsh/j.sh source $HOME/.config/zsh/j.sh