-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
61 lines (48 loc) · 1.15 KB
/
.aliases
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
follow(){
tail -f /var/log/socklog/$1/current
}
open(){
xdg-open $@ > /dev/null &
}
alias ls='ls --color=auto'
alias la='ls -a'
alias please='sudo $(fc -ln -1)'
alias gs='north status'
alias gd='git diff'
alias switch='git checkout'
alias grep='grep --color=auto'
alias vi=run_nvim
alias vim="nvim"
alias cfg='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
run_nvim (){
if [ -d $1 ]; then
nvim "$@" -c term -c "Explore $1"
else
nvim "$@" -c term -c "buffer $1"
fi
}
chroot (){
sudo systemd-nspawn -bD $1 -E TERM=xterm --bind-ro=/dev/random --bind-ro=/dev/urandom
}
login() {
lxc-attach -n $1 -v TERM=xterm
}
lightup (){
arr=("0;31" "1;36" "0;34" "0;36" "0;37" "0;32")
reset='\e[0m'
res=""
indx=0
for i in "$@"; do
color=$(printf %s%s%s '\e[' ${arr[indx % ${#arr[@]}]} 'm')
res=$res"sed 's/$i/$(printf $color)$i$(printf $reset)/g' | "
((indx++))
done
eval $res less -r
}
comms() {
sudo picocom /dev/tty$1 -b115200
}
battery(){
cat /sys/class/power_supply/BAT0/capacity
}
cd() { builtin cd "$@" && ls ; }