chore(global): regular configuration hellscape for now

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.eu.org>
This commit is contained in:
Andrei Jiroh Halili 2023-05-12 18:55:54 +02:00
parent 2667c38f2d
commit 01c95345a3
No known key found for this signature in database
GPG key ID: 67BFC91B3DA12BE8
9 changed files with 110 additions and 5 deletions

7
.bash_logout Normal file
View file

@ -0,0 +1,7 @@
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi

View file

@ -10,12 +10,12 @@
## This stage also initalizes oh-my-posh here. ##
if [[ $TERMUX ]]; then
export SSH_AGENT_=todo
else
elif command -v keychain >> /dev/null; then
export KEYCHAIN_PATh=$(command -v keychain)
eval $(keychain --agents gpg,ssh --eval)
fi
export GPG_TTY=$(tty)
# Tip: I don't want to f**k things up on POSIX-based stuff, I might try
# using
# TODO: Implement feature flag disabling this.
if command -v oh-my-posh >>/dev/null; then
eval "$(oh-my-posh init bash)"
fi

View file

@ -1 +0,0 @@
/tmp/ssh-XXXXXXCepcGI/agent.135

35
.config/bash/aliases Normal file
View file

@ -0,0 +1,35 @@
# General
alias clear="printf '\033c'" # faster than ncurses clear by a lot
alias c='clear'
alias bashrc="vim ~/.bashrc && source ~/.bashrc"
# LS
alias ls='ls --color=auto -FAh'
alias ll='ls -l'
alias la='ls'
alias l.='ls | egrep "^\."'
alias l=ls
# GREP
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# GIT
alias ga='git add'
alias gc='git commit'
alias gp='git push'
alias lc='fc -nl $HISTCMD'
# CADDY
alias rc='caddy reload --config ~/Caddyfile'
alias ft='caddy fmt --overwrite ~/Caddyfile'
alias vt='caddy validate --config ~/Caddyfile'
# Navigation
alias ..='cd ..'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
# Readability
alias cp="cp -iv"
alias mv='mv -iv'
alias rm='rm -iv'
alias df='df -h'
alias free='free -m'
alias mkdir='mkdir -pv'

57
.config/bash/prompt.new Normal file
View file

@ -0,0 +1,57 @@
__sig() {
# Giant switch case for getting the name of the signal (`kill -l`)
a=0
for i in $@; do
a=$((a+1))
case $i in
126) printf ACCES ;;
127) printf NOENT ;;
129) printf HUP ;;
130) printf INT ;;
131) printf QUIT ;;
132) printf ILL ;;
133) printf TRAP ;;
134) printf ABRT ;;
135) printf BUS ;;
136) printf FPE ;;
137) printf KILL ;;
138) printf USR1 ;;
139) printf SEGV ;;
140) printf USR2 ;;
141) printf PIPE ;;
142) printf ALRM ;;
143) printf TERM ;;
144) printf STKFLT ;;
145) printf CHLD ;;
146) printf CONT ;;
147) printf STOP ;;
148) printf TSTP ;;
149) printf TTIN ;;
150) printf TTOU ;;
151) printf URG ;;
152) printf XCPU ;;
153) printf XFSZ ;;
154) printf VTALRM ;;
155) printf PROF ;;
156) printf WINCH ;;
157) printf IO ;;
158) printf PWR ;;
159) printf SYS ;;
16[3-9]|1[7-8][0-9]|19[0-2]) printf RT$(($i-128)) ;; # Savagery
*) printf $i ;; # Print exit code if not in list
esac
done
}
sig() {
PLC=(${PIPESTATUS[@]})
printf "$(__sig ${PLC[@]})"
}
NO_COLOUR="\[\033[0m\]"
# Bold Colours
RED="\[\033[01;31m\]"
GREEN="\[\033[01;32m\]"
YELLOW="\[\033[01;33m\]"
BLUE="\[\033[01;34m\]"
PS1="[${RED}\$(sig)${NO_COLOUR}] [\t] [${RED}\u${NO_COLOUR}@${GREEN}\h${NO_COLOUR}|${BLUE}\w${NO_COLOUR}] [${YELLOW}#\#${NO_COLOUR}] ${GREEN}\$ ${NO_COLOUR}"

3
.env
View file

@ -43,3 +43,6 @@ then
export SAMUFLAGS="-j$nproc"
fi
##########################################################################################
# import aliases to shell too
. "$HOME/.config/bash/aliases"

View file

@ -1,6 +1,6 @@
[user]
name = Andrei Jiroh Halili
email = ajhalili2006@gmail.com
email = ajhalili2006@andreijiroh.eu.org
signingkey = 67BFC91B3DA12BE8
[commit]

View file

@ -15,6 +15,10 @@ source "$HOME/.env"
source "$HOME/.config/aliases"
export POSIX_PROFILE_SOURCED=true
# how about detecting local configs
if [ ! -f "$HOME/.config/localconfig.env" ]; then
. "$HOME/.config/localconfig.env"
fi
# Added by Toolbox App
export PATH="$PATH:/home/ajhalili2006/.local/share/JetBrains/Toolbox/scripts"