-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zsh_aliases
43 lines (40 loc) · 2.73 KB
/
.zsh_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
spaste () {
curl -F "sprunge=<${1:--}" http://sprunge.us
}
pb () {
curl -F "c=@${1:--}" https://ptpb.pw/
}
transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
yd () {
ytdl_args="-o %(title)s.%(ext)s"
if [[ $1 == *"list"* ]]; then
ytdl_args="-o %(playlist_index)2d-%(title)s.%(ext)s"
fi
youtube-dl --ignore-errors -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' --external-downloader aria2c --external-downloader-args -x10 $(echo $ytdl_args) $1 && notify-send -t 3 "youtube-dl: Done" || notify-send -t 3 "youtube-dl: Error"
}
yad () {
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --ignore-errors -o "%(title)s.%(ext)s" --external-downloader aria2c --external-downloader-args -x10 $1 && notify-send -t 3 "youtube-dl: Done" || notify-send -t 3 "youtube-dl: Error"
}
alias h="unset HISTFILE"
alias au="sudo apt update"
alias afi="sudo apt-fast install -y"
alias appa="sudo add-apt-repository -y"
alias allupdate="sudo apt update && sudo apt-fast upgrade -y && sudo apt-fast dist-upgrade -y"
alias pi="yay --pacman powerpill --sync"
alias pu="yay --pacman powerpill --remove"
alias mplayer="mplayer -msgcolor -msgmodule -nolirc"
alias img="feh -FZrD3"
alias gcmsg="git commit --gpg-sign --signoff --message"
gcmf() {
git commit --gpg-sign --signoff --message $(curl -s https://whatthecommit.com/index.txt)
}
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias dip="docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'"
# Pretty print the path
alias path="echo $PATH | tr -s ':' '\n'"
alias gcssh="gcloud alpha cloud-shell ssh --ssh-flag='-o ServerAliveInterval=120' --ssh-flag='-o ServerAliveCountMax=30'"
alias config='/usr/bin/git --git-dir=${HOME}/.cfg/ --work-tree=${HOME}'
alias cat="bat"
alias inner="displayplacer 'id:68BE7096-C3E6-76C5-7AA1-082CC9742D4B res:3200x1800 hz:30 color_depth:8 scaling:on origin:(0,0) degree:0' 'id:42B0E1F5-E50A-CD78-E8E2-7CE88272CA3C res:1792x1120 hz:60 color_depth:8 scaling:on origin:(3200,2d95) degree:0'"
alias outer="displayplacer 'id:68BE7096-C3E6-76C5-7AA1-082CC9742D4B res:3200x1800 hz:30 color_depth:8 scaling:on origin:(0,0) degree:0' 'id:42B0E1F5-E50A-CD78-E8E2-7CE88272CA3C res:1792x1120 hz:60 color_depth:8 scaling:on origin:(-1792,299) degree:0'"