Last active
May 17, 2022 14:33
-
-
Save Cipher7/3a22688aec923237637c2c08dc417f3a to your computer and use it in GitHub Desktop.
My .bashrc config file for Arch Linux
This file contains 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
# Author: Cipher007 | |
# Date : 2nd October 2021 | |
# ~/.bashrc | |
# | |
# _____ _ _ ___ ___ ______ | |
# / ____(_) | | / _ \ / _ \____ | | |
#| | _ _ __ | |__ ___ _ __| | | | | | | / / | |
#| | | | '_ \| '_ \ / _ \ '__| | | | | | | / / | |
#| |____| | |_) | | | | __/ | | |_| | |_| |/ / | |
# \_____|_| .__/|_| |_|\___|_| \___/ \___//_/ | |
# | | | |
# |_| | |
# If not running interactively, don't do anything | |
[[ $- != *i* ]] && return | |
alias ls='ls --color=auto' | |
alias xx='xclip -sel clip' | |
source "/home/cipher/.custom_commands.sh" | |
#fzf config | |
[ -f ~/.fzf.bash ] && source ~/.fzf.bash | |
#interactive terminal prompt with git branching | |
function prompt() | |
{ | |
# Adding user name | |
PROMPT="[\[\e[;31m\]$(whoami)\[\e[m\]" | |
# Adding '@' sepparator | |
PROMPT="$PROMPT\[\e[;32m\]@\[\e[m\]" | |
# Adding hostname or git: branch | |
POS=$(git branch 2>/dev/null | grep '^*' | colrm 1 2) | |
ISOK=$(git status -s --ignore-submodules=dirty 2> /dev/null) | |
if [[ $POS ]]; then | |
PROMPT="$PROMPT\[\e[34m\]${PWD##*/}\[\e[m\]" | |
if [[ $ISOK ]]; then | |
PROMPT="$PROMPT \[\e[35m\]untracked/\[\e[m\]]" | |
else | |
PROMPT="$PROMPT \[\e[35m\]$POS/\[\e[m\]]" | |
fi | |
else | |
PROMPT="$PROMPT\[\e[34m\]$(cat /etc/hostname)\[\e[m\]" | |
PROMPT="$PROMPT \[\e[35m\]${PWD##*/}/\[\e[m\]]" | |
fi | |
export PS1="$PROMPT\$ " | |
} | |
#Seting up color prompt: | |
PROMPT_COMMAND="prompt" | |
PS2="[\[\e[;34m\]\W\[\e[m\]] \[\e[;31m\]->\[\e[m\] " | |
PS3="[\w] -> " | |
PS4=" \$ " | |
# set the window manager name for java apps | |
[ -z "$(wmname 2> /dev/null)" ] && wmname LG3D &> /dev/null | |
#exports | |
export PROMPT_COMMAND=$PROMPT_COMMAND | |
export PS2=$PS2 | |
export PS3=$PS3 | |
export PS4=$PS4 | |
export TERM="st-256color" | |
export SHELL=/bin/bash | |
export EDITOR=/usr/bin/vim | |
export BROWSER=/usr/bin/firefox | |
export TERMINAL=/usr/local/bin/st | |
export LANG=en_US.UTF-8 | |
# Add golang binaries path to PATH | |
export PATH="$PATH:$HOME/go/bin" | |
#fzf-custom-color | |
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS' --color=fg:#d0d0d0,bg:#121212,hl:#5f87af --color=fg+:#d0d0d0,bg+:#262626,hl+:#5fd7ff --color=info:#afaf87,prompt:#d7005f,pointer:#af5fff --color=marker:#87ff00,spinner:#af5fff,header:#87afaf' | |
#pacman | |
alias pacstore="pacman -Slq | fzf -m --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk \"{print \$2}\")' | xargs -ro sudo pacman -S" | |
alias yyt="paru -Slq | fzf -m --preview 'cat <(paru -Si {1}) <(paru -Fl {1} | awk \"{print \$2}\")' | xargs -ro paru -S" | |
alias yys='paru -S --mflags --skipinteg' |
This file contains 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
# Author: Cipher007 | |
# Date : 2nd October 2021 | |
# | |
# _____ _ _ ___ ___ ______ | |
# / ____(_) | | / _ \ / _ \____ | | |
#| | _ _ __ | |__ ___ _ __| | | | | | | / / | |
#| | | | '_ \| '_ \ / _ \ '__| | | | | | | / / | |
#| |____| | |_) | | | | __/ | | |_| | |_| |/ / | |
# \_____|_| .__/|_| |_|\___|_| \___/ \___//_/ | |
# | | | |
# |_| | |
#!/usr/bin/bash | |
#extract files | |
function ex () | |
{ | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2) tar xjf $1 ;; | |
*.tar.gz) tar xzf $1 ;; | |
*.bz2) bunzip2 $1 ;; | |
*.rar) unrar x $1 ;; | |
*.gz) gunzip $1 ;; | |
*.tar) tar xf $1 ;; | |
*.tbz2) tar xjf $1 ;; | |
*.tgz) tar xzf $1 ;; | |
*.zip) unzip $1 ;; | |
*.Z) uncompress $1;; | |
*.7z) 7z x $1 ;; | |
*.deb) ar x $1 ;; | |
*.tar.xz) tar xf $1 ;; | |
*.tar.zst) unzstd $1 ;; | |
*) echo "'$1' cannot be extracted via ex()" ;; | |
esac | |
else | |
echo "'$1' is not a valid file" | |
fi | |
} | |
#change the wallpaper | |
function wpch () | |
{ | |
wallpaper_path="/usr/src/dwm/Wallpapers" | |
file=$( ls $wallpaper_path | shuf -n 1 ) | |
hsetroot -center $wallpaper_path/$file | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment