Skip to content

Commit fb70ff5

Browse files
authored
Create .bashrc
1 parent 2d7908a commit fb70ff5

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.bashrc

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#
2+
# ~/.bashrc
3+
#
4+
5+
# If not running interactively, don't do anything
6+
# If not running interactively, don't do anything
7+
[[ $- != *i* ]] && return
8+
# Load starship prompt if starship is installed
9+
if [ -x /usr/bin/starship ]; then
10+
__main() {
11+
local major="${BASH_VERSINFO[0]}"
12+
local minor="${BASH_VERSINFO[1]}"
13+
if ((major > 4)) || { ((major == 4)) && ((minor >= 1)); }; then
14+
source <("/usr/bin/starship" init bash --print-full-init)
15+
else
16+
source /dev/stdin <<<"$("/usr/bin/starship" init bash --print-full-init)"
17+
fi
18+
}
19+
__main
20+
unset -f __main
21+
fi
22+
# Advanced command-not-found hook
23+
#source /usr/share/doc/find-the-command/ftc.bash
24+
## Useful aliases
25+
# Replace ls with exa
26+
alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing
27+
alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs
28+
alias ll='exa -l --color=always --group-directories-first --icons' # long format
29+
alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing
30+
alias l.='exa -ald --color=always --group-directories-first --icons .*' # show only dotfiles
31+
# Replace some more things with better alternatives
32+
#alias cat='bat --style header --style snip --style changes --style header'
33+
[ ! -x /usr/bin/yay ] && [ -x /usr/bin/paru ] && alias yay='paru'
34+
# Common use
35+
alias grubup="sudo update-grub"
36+
alias fixpacman="sudo rm /var/lib/pacman/db.lck"
37+
alias tarnow='tar -acf '
38+
alias untar='tar -zxvf '
39+
alias wget='wget -c '
40+
alias rmpkg="sudo pacman -Rdd"
41+
alias psmem='ps auxf | sort -nr -k 4'
42+
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
43+
alias upd='/usr/bin/garuda-update'
44+
alias ..='cd ..'
45+
alias ...='cd ../..'
46+
alias ....='cd ../../..'
47+
alias .....='cd ../../../..'
48+
alias ......='cd ../../../../..'
49+
alias dir='dir --color=auto'
50+
alias vdir='vdir --color=auto'
51+
alias grep='ugrep --color=auto'
52+
alias fgrep='ugrep -F --color=auto'
53+
alias egrep='ugrep -E --color=auto'
54+
alias hw='hwinfo --short' # Hardware Info
55+
alias big="expac -H M '%m\t%n' | sort -h | nl" # Sort installed packages according to size in MB (expac must be installed)
56+
alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages
57+
alias ip='ip -color'
58+
# Get fastest mirrors
59+
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
60+
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
61+
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
62+
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
63+
# Help people new to Arch
64+
alias apt='man pacman'
65+
alias apt-get='man pacman'
66+
alias please='sudo'
67+
alias tb='nc termbin.com 9999'
68+
alias helpme='cht.sh --shell'
69+
alias pacdiff='sudo -H DIFFPROG=meld pacdiff'
70+
# Cleanup orphaned packages
71+
alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'
72+
# Get the error messages from journalctl
73+
alias jctl="journalctl -p 3 -xb"
74+
75+
nerdfetch

0 commit comments

Comments
 (0)