diff --git a/.bash_logout b/.bash_logout new file mode 100644 index 0000000..de4f5f7 --- /dev/null +++ b/.bash_logout @@ -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 diff --git a/.bashrc b/.bashrc index a5f6cf0..f6d837d 100644 --- a/.bashrc +++ b/.bashrc @@ -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 diff --git a/.byobu/.ssh-agent b/.byobu/.ssh-agent deleted file mode 120000 index 68371b5..0000000 --- a/.byobu/.ssh-agent +++ /dev/null @@ -1 +0,0 @@ -/tmp/ssh-XXXXXXCepcGI/agent.135 \ No newline at end of file diff --git a/.config/bash/aliases b/.config/bash/aliases new file mode 100644 index 0000000..219b81d --- /dev/null +++ b/.config/bash/aliases @@ -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' diff --git a/.config/bash/prompt.new b/.config/bash/prompt.new new file mode 100644 index 0000000..884b78e --- /dev/null +++ b/.config/bash/prompt.new @@ -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}" + diff --git a/.config/bash/prompt b/.config/bash/prompt.old similarity index 100% rename from .config/bash/prompt rename to .config/bash/prompt.old diff --git a/.env b/.env index aae2c07..fe99942 100644 --- a/.env +++ b/.env @@ -43,3 +43,6 @@ then export SAMUFLAGS="-j$nproc" fi ########################################################################################## + +# import aliases to shell too +. "$HOME/.config/bash/aliases" diff --git a/.gitconfig b/.gitconfig index 075b76d..b0fb6b7 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,6 +1,6 @@ [user] name = Andrei Jiroh Halili - email = ajhalili2006@gmail.com + email = ajhalili2006@andreijiroh.eu.org signingkey = 67BFC91B3DA12BE8 [commit] diff --git a/.profile b/.profile index 7d63a58..874fc9b 100644 --- a/.profile +++ b/.profile @@ -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"