Last active
February 13, 2025 10:14
-
-
Save mshafeeqkn/794d26711a7201552354493c7a2e77ee to your computer and use it in GitHub Desktop.
The PS1 variable for bashrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_git_branch() { | |
_branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/') | |
_branch="$_branch" | |
echo $_branch | |
} | |
export PS1="\[\033[38;5;42m\]\u@\h\[\033[00m\]:\[\033[38;5;39m\]\W\[\033[38;5;198m\]\$(parse_git_branch)\[\033[00m\]$ " | |
jk() { | |
JUNK_DIR=$HOME/.junk/ | |
JUNK_ARGS="$@" | |
if [ ! -d $JUNK_DIR ]; then | |
mkdir $JUNK_DIR | |
fi | |
if [ "$1" = "-e" ]; then | |
rm -rf $JUNK_DIR | |
return | |
fi | |
echo "" | |
for item in $@; do | |
RAND=$(tr -dc a-z0-9 </dev/urandom | head -c 5; echo) | |
if [ -d $item -o -f $item ]; then | |
mv $item $JUNK_DIR/$item.$RAND | |
echo -e "\033[0;32m$item junked\033[0m" | |
else | |
echo -e "\033[0;31m$item doesn't exist\033[0m" | |
fi | |
done | |
echo "" | |
} | |
alias ifconfig="ip -c a s" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment