Added bashrc and made some tweaks to accomodate

This commit is contained in:
swagg boi 2025-03-15 02:08:36 +00:00
parent 620e9bf57c
commit 5649195319
3 changed files with 97 additions and 7 deletions

88
my_home/.bashrc Normal file
View File

@ -0,0 +1,88 @@
# .bashrc 3/14/2025 <swaggboi@gangstalking.agency>
# Interactive shell check (the way Slackware does it)
if shopt -q login_shell; then
/usr/games/fortune
echo
fi
## Aliases ##
alias sudo='doas'
alias l='ls -blhF'
alias la='ls -balhF'
alias grep='grep -E'
alias ..='cd ..'
alias p='cat'
alias n='cat -n'
alias digg='dig +nocl +short +noshort'
alias emacs='emacs -nw'
alias gpg='gpg -a'
#alias open='xdg-open'
alias cdm='cd $HOME/misc'
alias h='echo $HOME'
if command -v netcat > /dev/null 2>&1; then
alias nc='netcat -v -z'
elif command -v nc > /dev/null 2>&1; then
alias nc='nc -v -z'
fi
#if command -v vim > /dev/null 2>&1; then
# alias vi='vim'
#fi
## Exports ##
# For Perl/CPAN
if [ -d $HOME/perl5 ]; then
export PATH="/home/daniel/perl5/bin${PATH:+:${PATH}}"
export PERL5LIB="/home/daniel/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"
export PERL_LOCAL_LIB_ROOT="/home/daniel/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"
export PERL_MB_OPT="--install_base \"/home/daniel/perl5\""
export PERL_MM_OPT="INSTALL_BASE=/home/daniel/perl5"
# For perlbrew
if [ -r $HOME/perl5/perlbrew/etc/bashrc ]; then
. $HOME/perl5/perlbrew/etc/bashrc
fi
fi
# For Raku/zef
if [ -d $HOME/.raku/bin ]; then
export PATH="$HOME/.raku/bin:$PATH"
fi
if command -v rakubrew > /dev/null 2>&1; then
eval "$(rakubrew init Bash)"
fi
# For Ruby/rbenv
# If not installed globally, see if it's installed locally
if ! command -v rbenv > /dev/null 2>&1; then
if [ -d $HOME/.rbenv/bin ]; then
export PATH="$HOME/.rbenv/bin:$PATH"
fi
if [ -d $HOME/.rbenv/plugins/ruby-build/bin ]; then
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
fi
fi
# If we have rbenv now, set up the environment
if command -v rbenv > /dev/null 2>&1; then
eval "$(rbenv init -)"
fi
# Editor
if command -v emacs > /dev/null 2>&1; then
export EDITOR='emacs -nw'
elif command -v mg > /dev/null 2>&1; then
export EDITOR='mg'
fi
export PKG_PATH="http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/10.1/All/"
export PS1='\u@\h:\w\$ '
## Misc ##
# Prevent line wrapping mess
shopt -s checkwinsize

View File

@ -1,10 +1,10 @@
# .kshrc 3/14/2025 <swaggboi@gangstalking.agency>
# Need to do the 'login shell' test before running this
#if [ -x /usr/games/fortune ]; then
# /usr/games/fortune
# echo
#fi
# Check login shell first
if [ -t 0 ] && [ -x /usr/games/fortune ]; then
/usr/games/fortune
echo
fi
# user specific aliases
alias l='ls -lhF'

View File

@ -38,6 +38,8 @@ export PATH
# Configure the shell to load .shrc at startup time.
# This will happen for every shell started, not just login shells.
if [ -f $HOME/.${SHELL}rc ]; then
export ENV=$HOME/.${SHELL}rc
if [ -r $HOME/.${SHELL}rc ]; then
export ENV=$HOME/.shrc
elif [ `basename $SHELL` = 'bash' ] && [ -r $HOME/.bashrc ]; then
. $HOME/.bashrc
fi