From f7783831e91ab7c3262c00ca1bf4007f858c44a8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 27 Feb 2024 22:44:57 -0500 Subject: make path setting more consistent --- bash/.bashrc | 16 ---------------- sh/.config/sh/rc.d/00path | 1 + xbindkeys/.config/systemd/user/xbindkeys.service | 2 +- xorg/.xprofile | 4 ++-- zsh/.zshrc | 9 --------- 5 files changed, 4 insertions(+), 28 deletions(-) create mode 100644 sh/.config/sh/rc.d/00path diff --git a/bash/.bashrc b/bash/.bashrc index 0700cf3..9b7177e 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -1,19 +1,3 @@ -# language environments {{{ -test -d "$HOME/.cargo/bin" && export PATH="$HOME/.cargo/bin:$PATH" -# }}} -# environment {{{ -PATH="${HOME}/.bin/local:${HOME}/.bin/$(hostname):${HOME}/.bin:$PATH" -export PATH -# }}} -# Test for an interactive shell. {{{ -# There is no need to set anything past this point for scp and rcp, and it's -# important to refrain from outputting anything in those cases. -if [[ $- != *i* ]] ; then - # Shell is non-interactive. Be done now! - return -fi -[ -z "$PS1" ] && return -# }}} for file in ~/.config/sh/rc.d/*; do # shellcheck disable=SC1090 source "$file" diff --git a/sh/.config/sh/rc.d/00path b/sh/.config/sh/rc.d/00path new file mode 100644 index 0000000..c9275f4 --- /dev/null +++ b/sh/.config/sh/rc.d/00path @@ -0,0 +1 @@ +export PATH="${HOME}/.bin/local:${HOME}/.bin:${HOME}/.cargo/bin:${PATH}" diff --git a/xbindkeys/.config/systemd/user/xbindkeys.service b/xbindkeys/.config/systemd/user/xbindkeys.service index 516e8b2..d1f83e5 100644 --- a/xbindkeys/.config/systemd/user/xbindkeys.service +++ b/xbindkeys/.config/systemd/user/xbindkeys.service @@ -1,5 +1,5 @@ [Service] -ExecStart=/bin/sh -c 'PATH="$HOME/.bin/local:$HOME/.bin/$(hostname):$HOME/.bin:$PATH" xbindkeys -p -n' +ExecStart=/bin/sh -c '. ${HOME}/.config/sh/rc.d/00path && xbindkeys -p -n' Restart=always # otherwise any applications launched via a keybinding will be killed when # the service is restarted diff --git a/xorg/.xprofile b/xorg/.xprofile index 2b01b23..8f968f8 100644 --- a/xorg/.xprofile +++ b/xorg/.xprofile @@ -1,7 +1,7 @@ #!/bin/sh -PATH="$HOME/.bin/local:$HOME/.bin/$(hostname):$HOME/.bin:$PATH" -export PATH +# shellcheck disable=SC1091 +. "${HOME}/.config/sh/rc.d/00path" eval "$(ssh-agent)" diff --git a/zsh/.zshrc b/zsh/.zshrc index c60e8d7..5bd948b 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,12 +1,3 @@ -# language environments {{{ -test -d "$HOME/.cargo/bin" && export PATH="$HOME/.cargo/bin:$PATH" -# }}} -# environment {{{ -# not using .zshenv, because it runs before /etc/profile, and /etc/profile -# tends to hard-set $PATH and such -PATH="${HOME}/.bin/local:${HOME}/.bin/$(hostname):${HOME}/.bin:$PATH" -export PATH -# }}} for file in ~/.config/sh/rc.d/*; do # shellcheck disable=SC1090 source "$file" -- cgit v1.2.3-54-g00ecf