From feaac11fe2ce1200d7fa5605f36c73bb43d29741 Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Sat, 18 Oct 2025 21:57:13 +0100 Subject: Add node/npm rootless setup & refactor shell command check --- dot-profile | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'dot-profile') diff --git a/dot-profile b/dot-profile index fcf834b..0224be7 100755 --- a/dot-profile +++ b/dot-profile @@ -4,11 +4,27 @@ # PROFILE # +# FUNCTIONS +installed() { + command -v $1 >/dev/null 2>&1 +} + # SCRIPTS [ -d ~/repos/scripts ] && PATH=$PATH:~/repos/scripts +# NODE & NPM +# use ~/.local directory for global 'npm -g ' installs +# and therefore not requiring root privileges +export PATH=~/.local/bin:$PATH +if installed node; then + export NODE_PATH=~/.local/lib/node_modules:$NODE_PATH +fi +if installed npm; then + export npm_config_prefix=~/.local +fi + # EDITOR -if command -v vim >/dev/null 2>&1; then +if installed vim; then export EDITOR=vim export VISUAL=vim fi @@ -29,7 +45,7 @@ export LESS_TERMCAP_us=$'\e[1;37m' # start underlining export LESS_TERMCAP_ue=$'\e[0m' # end underline # BEMENU -if command -v bemenu >/dev/null 2>&1; then +if installed bemenu; then fg="#eeeeee" bg="#000000" mg="#111111" @@ -61,7 +77,7 @@ fi # GUI THEMES export QT_QPA_PLATFORMTHEME=gtk3 -# START SWAY +# AUTOSTART WINDOW MANAGER if [ -z $DISPLAY ] && [ $(tty) = /dev/tty1 ]; then export XDG_CURRENT_DESKTOP=sway dbus-run-session sway -- cgit