-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
56 lines (49 loc) · 1.08 KB
/
.bashrc
File metadata and controls
56 lines (49 loc) · 1.08 KB
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
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
PS1='[\u@\h \W]\$ '
export EDITOR='nvim'
export VISUAL='nvim'
# ALIASES
alias cat="bat"
alias ll="ls -la"
alias streamlink="nohup streamlink"
alias myip="curl ipinfo.io/ip"
alias ls='ls --color=auto'
alias mkdir="mkdir -p"
alias vi="nvim"
alias mount="mount | column -t"
alias ping="ping -c 5"
alias mv="mv -i"
alias cp="cp -i"
alias ln="ln -i"
alias wget="wget -c"
alias grep='grep --color=auto'
alias ..="cd .."
alias neofetch="fastfetch"
alias bat-status='sudo tlp-stat -b'
alias bat-full='sudo tlp setcharge 0 99 BAT0'
alias bat-reserve='sudo tlp setcharge 75 80 BAT0'
pdf() {
pdftotext "$1" - | less
}
sudo() {
if [ "$1" = "nvim" ]; then
command sudoedit "${@:2}"
else
command sudo "$@"
fi
}
run() {
if [[ "$1" == *.c ]]; then
output="${1%.c}"
log_file="$output.log"
command gcc -O -Wall -W -pedantic -ansi -std=c99 -o "$output" "$1" &> "$log_file" && "./$output"
cat "$log_file"
rm "$log_file"
else
echo "Error: File needs to be .c"
fi
}