-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
124 lines (107 loc) · 3.87 KB
/
.bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Make colorcoding available for everyone
Black='\[\e[0;30m\]' # Black
Red='\[\e[0;31m\]' # Red
Green='\[\e[0;32m\]' # Green
Yellow='\[\e[0;33m\]' # Yellow
Blue='\[\e[0;34m\]' # Blue
Purple='\[\e[0;35m\]' # Purple
Cyan='\[\e[0;36m\]' # Cyan
White='\[\e[0;37m\]' # White
# Bold
BBlack='\[\e[1;30m\]' # Black
BRed='\[\e[1;31m\]' # Red
BGreen='\[\e[1;32m\]' # Green
BYellow='\[\e[1;33m\]' # Yellow BBlue='\[\e[1;34m\]' # Blue BPurple='\[\e[1;35m\]' # Purple
BCyan='\[\e[1;36m\]' # Cyan
BWhite='\[\e[1;37m\]' # White
# Background
On_Black='\[\e[40m\]' # Black
On_Red='\[\e[41m\]' # Red
On_Green='\[\e[42m\]' # Green
On_Yellow='\[\e[43m\]' # Yellow
On_Blue='\[\e[44m\]' # Blue
On_Purple='\[\e[45m\]' # Purple
On_Cyan='\[\e[46m\]' # Cyan
On_White='\[\e[47m\]' # White
NC='\[\e[m\]' # Color Reset
ALERT="${BWhite}${On_Red}" # Bold White on red background
# Useful aliases
alias c='clear'
alias ..='cd ..'
alias ls='ls -l --color=auto'
alias lsm="ls -al --color=auto"
alias mkdir='mkdir -pv'
alias free='free -mt'
alias ps='ps auxf'
alias psgrep='ps aux | grep -v grep | grep -i -e VSZ -e'
alias wget='wget -c'
alias histg='history | grep'
alias myip='curl ipv4.icanhazip.com'
alias grep='grep --color=auto'
alias ddg='w3m lite.duckduckgo.com/lite'
alias yayclean='pikaur -Rs $(pacman -Qqdt)'
alias inbox="neomutt -f /var/mail/$(whoami)"
alias wttr="curl wttr.in"
alias doom="~/.emacs.d/bin/doom"
alias todo="vim ~/Notes/Todo/todo.md"
# More custom alias
alias m_stopalarm="touch ~/startalarm && sleep 10 && rm ~/startalarm"
alias m_bedtime="sudo pacman -Syu --noconfirm && yay -Sayu --answerclean n --answerdiff n --answeredit n --answerupgrade y --removemake --cleanafter && shutdown now"
alias m_logto="sudo dmesg -w > "
alias m_firefox="firefox &"
alias m_wifi="echo Restarting wireless interface... && sudo ifconfig wlan0 down && sudo ifconfig wlan0 up && echo Waiting 10 seconds for network to restart... && sleep 10 && echo All set!"
alias m_rcwifi="sudo rc-service NetworkManager start && sudo rc-service smb start && sudo rc-service dnsmasq start && sudo rc-service netmount start"
alias m_xfce="cd && rm .xinitrc && echo exec startxfce4 >> .xinitrc && startx"
alias m_dwm="cd && rm .xinitrc && echo exec dwm >> .xinitrc && startx"
alias m_lxqt="cd && rm .xinitrc && echo exec startlxqt >> .xinitrc && startx"
alias m_awesome="cd && rm .xinitrc && echo exec awesome >> .xinitrc && startx"
alias m_plasmawayland="cd && rm .xinitrc && echo exec startplasma-wayland >> .xinitrc && startx"
alias m_qemu="qemu-system-x86_64 -m 3000 -boot d -smp 2 -net nic -net user -enable-kvm"
# Extract Function
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi
}
# Intro
#echo
#bat -p ~/Notes/Todo/todo.md
#echo
#echo "Use the todo command to edit your To-do list."
#echo
# Set PATH so it includes user's private bin directories
PATH="${HOME}/bin:${HOME}/.local/bin/:${PATH}"
exitstatus()
{
if [[ $? != 0 ]]; then
echo -en " ${?}"
fi
}
PS1="${Cyan}\u ${Blue}\w \n$(exitstatus)${Green}$ ${NC}"
#PS1="${Red}[${Cyan}\u${Yellow}@${Green}\h${Red}]${NC}: ${Red}\w${NC} \\$ "
# Activate command-not-found
#source /usr/share/doc/pkgfile/command-not-found.bash
# Start vi mode
set -o vi
PYTHON_BIN_PATH="$(python -m site --user-base)/bin"
export PATH="$PATH:$PYTHON_BIN_PATH"