-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bashrc
83 lines (76 loc) · 2.41 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
# BEGIN My addittions
## Make ls be colored and format the output some more by default
alias ls="ls --color -CF"
alias grep="grep --color"
## Make typing commands easier if you havent messed up your file/project structure
bind 'set completion-ignore-case on'
## Make ctrl+r search in history more user friendly
source /usr/share/fzf/key-bindings.bash
source /usr/share/fzf/completion.bash
## Source bash-completions
if test -f /usr/share/bash-completion/bash_completion
then
source /usr/share/bash-completion/bash_completion
else
echo "Bash completions not found."
fi
## My color scheme in the PS1, comment in if not using powerline
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35m\]\u\[\033[01;36m\]@\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]\$ '
### The base variant without colors saying what to include when showing the path for reference:
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
## Upgrades
function upgrade() {
if command -v pacman &> /dev/null
then
echo "Begin upgrading pacman packages."
echo "=============================="
sudo pacman -Syu
echo "=============================="
echo "Finish upgrading pacman packages."
else
echo "Pacman is not installed, skipping upgrading it."
fi
if command -v yay &> /dev/null
then
echo "Begin upgrading AUR packages."
echo "=============================="
yay -Syu
echo "=============================="
echo "Finish upgrading AUR packages."
else
echo "yay is not installed, skipping upgrading it."
fi
if command -v flatpak &> /dev/null
then
echo "Begin upgrading flatpak packages."
echo "=============================="
sudo flatpak update
echo "=============================="
echo "Finish upgrading flatpak packages."
else
echo "flatpak is not installed, skipping upgrading it."
fi
if command -v snap &> /dev/null
then
echo "Begin upgrading snap packages."
echo "=============================="
sudo snap refresh
echo "=============================="
echo "Finish upgrading snap packages."
else
echo "snap is not installed, skipping upgrading it."
fi
if command -v apt-get &> /dev/null
then
echo "Begin upgrading apt packages."
echo "=============================="
sudo apt-get update
sudo apt-get upgrade
echo "=============================="
echo "Finish upgrading apt packages."
else
echo "apt-get is not installed, skipping upgrading it."
fi
}
export -f upgrade
# END My addittions