diff --git a/bash/bash_profile b/bash/bash_profile index 3df2e4392..9c53ff40c 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -22,10 +22,7 @@ GTK_THEME="Gruvbox" THEME="dark" # Perl junk to allow scripts to run for non-interactive sessions -PERL5LIB="${HOME}/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; -PERL_LOCAL_LIB_ROOT="${HOME}/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; -PERL_MB_OPT="--install_base \"${HOME}/perl5\""; export PERL_MB_OPT; -PERL_MM_OPT="INSTALL_BASE=${HOME}/perl5"; export PERL_MM_OPT; +eval "$(plenv init -)" if [ -f "/run/.containerenv" ]; then source "$HOME/.dotfiles/bash/bash_profile.distrobox" diff --git a/bash/bashrc b/bash/bashrc index c99a515fa..5f6e3e9a0 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -84,14 +84,6 @@ if [ -f ${HOME}/.dotfiles/bash/bash_aliases ]; then . "${HOME}/.dotfiles/bash/bash_aliases" fi -# Perl configs -PERL5LIB="${HOME}/perl5/lib/perl5/x86_64-linux-gnu-thread-multi:${HOME}/.local/usr/local/lib/perl5/5.38.0:${HOME}/perl5/lib/perl5:${HOME}/perl5/lib/perl5/x86_64-linux-thread-multi:${PERL5LIB}"; export PERL5LIB; -PERL_LOCAL_LIB_ROOT="/var/home/jpm/.local/usr/local/lib/perl5/5.38.0:${HOME}/perl5/lib/perl5:${HOME}/perl5/lib/perl5/x86_64-linux-thread-multi:${PERL_LOCAL_LIB_ROOT}"; export PERL_LOCAL_LIB_ROOT; -#PERL_LIB="/var/home/jpm/.local/usr/local/lib/perl5/5.38.0"; export PERL_LIB; -PERL_LIB="/usr/local/lib/perl"; export PERL_LIB; -PERL_MB_OPT="--install_base \"${HOME}/perl5\""; export PERL_MB_OPT; -PERL_MM_OPT="INSTALL_BASE=${HOME}/perl5"; export PERL_MM_OPT; - # Android configs JDK_HOME=/etc/java STUDIO_JDK=/usr/lib/jvm/jre-openjdk @@ -109,6 +101,9 @@ export TERM="xterm" # Set initial title echo -e -n "\033]2;Welcome to Bash\007" +# Perl +eval "$(plenv init -)" +source ${HOME}/.dotfiles/bash/plenv-path.sh if [ -f "/run/.containerenv" ]; then source "$HOME/.dotfiles/bash/bashrc.distrobox" diff --git a/bash/path b/bash/path index 234bbec9e..7a33f1232 100644 --- a/bash/path +++ b/bash/path @@ -23,6 +23,11 @@ if [ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then source $HOME/.nix-profile/etc/profile.d/nix.sh fi +# Perl plenv +if [ -d "$HOME/.plenv/bin" ]; then + export PATH="$HOME/.plenv/bin:$PATH" +fi + # Private scripts if [ -d "$HOME/.private-scripts" ]; then PATH="$HOME/.private-scripts:$PATH" diff --git a/bash/plenv-path.sh b/bash/plenv-path.sh new file mode 100644 index 000000000..5cbef02f4 --- /dev/null +++ b/bash/plenv-path.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +PLENV_VERSION=$(plenv version | cut -d ' ' -f 1) + +PERL5LIB="$(pwd)/local/lib/perl5/x86_64-linux/:$(pwd)/local/lib/perl5:${HOME}/.plenv/versions/$PLENV_VERSION/lib/perl5/site_perl/${PLENV_VERSION}/x86_64-linux:${HOME}/.plenv/versions/$PLENV_VERSION/lib/perl5/site_perl/${PLENV_VERSION}:${HOME}/perl5/lib/perl5/x86_64-linux-gnu-thread-multi:${HOME}/.local/usr/local/lib/perl5/5.38.0:${HOME}/perl5/lib/perl5:${HOME}/perl5/lib/perl5/x86_64-linux-thread-multi"; export PERL5LIB; diff --git a/bash/prompt.sh b/bash/prompt.sh index accc7f03d..8e34a17f3 100755 --- a/bash/prompt.sh +++ b/bash/prompt.sh @@ -11,6 +11,7 @@ fi # If directory was just changed to the root of a git repository, print onefetch if [ -n "$DIRCHANGED" ]; then + source ${HOME}/.dotfiles/bash/plenv-path.sh if [ -d "$PWD/.git" ]; then if [[ "$(which onefetch)" == "" ]]; then echo "This is a git directory, but you don't have 'onefetch' in your PATH"