-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.bashrc
More file actions
executable file
·88 lines (80 loc) · 1.5 KB
/
.bashrc
File metadata and controls
executable file
·88 lines (80 loc) · 1.5 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
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
#!/bin/bash
alias cd1=hell_cd
alias ls1=hell_ls
alias nano1=hell_nano
alias exec1=hell_exec
alias echo1=hell_echo
alias touch1=hell_touch
hell_ls() {
args="$@"
ls --color $args | sort -R
}
hell_exec() {
if [ "$1" == "bash" ]; then
echo "You cannot escape hell without a path."
else
exec "$@"
fi
}
hell_nano() {
if [ -x "$(command -v nano)" ]; then
if [ -x "$(command -v vim)" ]; then
vim "$@"
elif [ -x "$(command -v emacs)" ]; then
emacs "$@"
else
nano "$@"
fi
fi
}
hell_cd() {
if [ "$1" == "" ]; then
random_dir=$(find / -type d 2>/dev/null | shuf -n 1)
cd $random_dir
return 0
fi
cd_path=$1
if [[ "$cd_path" == ..* ]]; then
# This obviously breaks autocomplete
cd $(random "$cd_path" "${cd_path/../../..}" "3")
else
cd $(random "/" "$cd_path" "4")
fi
}
hell_echo() {
str=$@
if [ "$str" == "" ]; then
echo "*silence*"
return 0
fi
str=${str^^[a,e,i,o,u]}
str=${str,,[B,C,D,F,G,H,J,K,L,M,N,P,Q,R,S,T,V,W,X,Y,Z]}
echo $str
}
hell_touch() {
filename=$1
if [ "$filename" == "" ]; then
echo "You must specify a file name."
return 0
fi
mkdir -p .files && touch .files/"${filename}"
}
random(){
low_prob_text=$1
high_prob_text=$2
x=$3
if [ "$low_prob_text" == "" ] || [ "$high_prob_text" == "" ]; then
return 0
fi
if [ "$x" == "" ]; then
x=10
fi
random_number=$(( RANDOM % $x ))
if [ "$random_number" == "0" ]; then
echo -n "$low_prob_text"
else
echo -n "$high_prob_text"
fi
}
LS_COLORS='rs=0:di=01;91;41:ln=01;37;100:*=0;34;104';
export LS_COLORS