aboutsummaryrefslogtreecommitdiff
path: root/dot-profile
diff options
context:
space:
mode:
authorBlake Romero <blake@developercraft.com>2025-10-18 21:57:13 +0100
committerBlake Romero <blake@developercraft.com>2025-10-18 21:57:13 +0100
commitfeaac11fe2ce1200d7fa5605f36c73bb43d29741 (patch)
treecfd658a92bfdab26359f39adea75378eef4b1908 /dot-profile
parentd8262f6c0eaef7daed9244197fb926994f2b1857 (diff)
Add node/npm rootless setup & refactor shell command checkHEADmain
Diffstat (limited to 'dot-profile')
-rwxr-xr-xdot-profile22
1 files changed, 19 insertions, 3 deletions
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 <PKG>' 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