-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
executable file
·108 lines (89 loc) · 3.31 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
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
[[ -f ~/.welcome_screen ]] && . ~/.welcome_screen
_set_liveuser_PS1() {
PS1='[\u@\h \W]\$ '
if [ "$(whoami)" = "liveuser" ] ; then
local iso_version="$(grep ^VERSION= /usr/lib/endeavouros-release 2>/dev/null | cut -d '=' -f 2)"
if [ -n "$iso_version" ] ; then
local prefix="eos-"
local iso_info="$prefix$iso_version"
PS1="[\u@$iso_info \W]\$ "
fi
fi
}
_set_liveuser_PS1
unset -f _set_liveuser_PS1
ShowInstallerIsoInfo() {
local file=/usr/lib/endeavouros-release
if [ -r $file ] ; then
cat $file
else
echo "Sorry, installer ISO info is not available." >&2
fi
}
[[ "$(whoami)" = "root" ]] && return
[[ -z "$FUNCNEST" ]] && export FUNCNEST=100 # limits recursive functions, see 'man bash'
## Use the up and down arrow keys for finding a command in history
## (you can write some initial letters of the command first).
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
################################################################################
## Some generally useful functions.
## Consider uncommenting aliases below to start using these functions.
##
## October 2021: removed many obsolete functions. If you still need them, please look at
## https://github.com/EndeavourOS-archive/EndeavourOS-archiso/raw/master/airootfs/etc/skel/.bashrc
_open_files_for_editing() {
# Open any given document file(s) for editing (or just viewing).
# Note1:
# - Do not use for executable files!
# Note2:
# - Uses 'mime' bindings, so you may need to use
# e.g. a file manager to make proper file bindings.
if [ -x /usr/bin/exo-open ] ; then
echo "exo-open $@" >&2
setsid exo-open "$@" >& /dev/null
return
fi
if [ -x /usr/bin/xdg-open ] ; then
for file in "$@" ; do
echo "xdg-open $file" >&2
setsid xdg-open "$file" >& /dev/null
done
return
fi
echo "$FUNCNAME: package 'xdg-utils' or 'exo' is required." >&2
}
#------------------------------------------------------------
## Aliases for the functions above.
## Uncomment an alias if you want to use it.
##
# alias ef='_open_files_for_editing' # 'ef' opens given file(s) for editing
# alias pacdiff=eos-pacdiff
################################################################################
export GOPATH=$HOME/go
export PATH=$HOME/scripts:$PATH
export PATH=$PATH:$GOPATH/bin
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/local/lib64
export COWPATH=/usr/share/cowsay/cows
alias ls='ls --color=auto'
alias ll='ls -lahv --ignore=..'
alias la='ls -axF'
alias update='~/scripts/update.sh'
alias emacs='~/scripts/emacs.sh'
alias update-grub='sudo grub2-mkconfig -o /boot/grub2/grub.cfg'
alias ssh='TERM=xterm ssh'
alias formatc='astyle --style=1tbs --indent=spaces=4 --pad-comma --convert-tabs'
alias formatrust='rustfmt --edition 2021'
alias rustdev='vim -c "cd ~/Documents/Development/rust" -c "NERDTree"'
alias dev='vim -c "cd ~/Documents/Development" -c "NERDTree"'
eval "$(starship init bash)"
eval "$(zoxide init --cmd cd bash)"
fortune | cowsay -f `ls /usr/share/cowsay/cows/ | shuf -n 1`
echo
echo " GREETINGS PROFESSOR ${USER^^}."
echo " SHALL WE PLAY A GAME?"