-
Notifications
You must be signed in to change notification settings - Fork 0
/
.funcrc
125 lines (104 loc) · 2.58 KB
/
.funcrc
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
e() {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjvf $1 ;;
*.tar.gz) tar xzvf $1 ;;
*.tar.xz) tar xJvf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar xv $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xjvf $1 ;;
*.tgz) tar xzvf $1 ;;
*.zip) unzip $1 ;;
*.7z) 7z x $1 ;;
*.xz) xz -vd $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
superls() { printf "\n" && colorls "$@" -a --sd && printf "\n"; }
bim() {
for album in "$@"
do
beet import -i ~/music/*/*"$album"*;
beet embedart -y "$album"
done
}
bf() {
IFS=$'\n'
NOVOS=( $(find ~/music -mindepth 2 -type d -mtime 0) )
unset IFS
for album in $NOVOS
do
beet import -i $album
beet embedart -y $album
done
}
pwlog() { git log "$@" --graph --oneline --decorate --color | less -SEXIER }
mkill() { for pid in $(ps -ef | awk '/'"$@"'/ {print $2}'); do kill -9 $pid; done }
unhistory () {
LC_ALL=C sed -i '/'$1'/d' $HISTFILE
histdb --forget "$1"
}
alertd() {
success=$?
export DISPLAY=:0
notify-send --urgency=low -i "$([ $success = 0 ] && echo info || echo error)" "Terminou o birinights"
aplay ~/.local/share/sounds/chime31.wav 2>/dev/null
}
#git dot add
da() {
dit ls-files | grep "$1" | xargs git --git-dir=$HOME/.cfg/ --work-tree=$HOME add
}
#git dot difftool
gdd() {
dit ls-files | grep "$1" | xargs git --git-dir=$HOME/.cfg/ --work-tree=$HOME diff
}
#dit difftool
gdt() {
dit ls-files | grep "$1" | xargs git --git-dir=$HOME/.cfg/ --work-tree=$HOME difftool -y
}
#dit difftool
gt() {
git ls-files | grep "$1" | xargs git difftool -y
}
snpadd(){
echo $2 >> ~/.config/snippet_paste/$1
echo "criado snippet $1"
}
snped() {
find ~/.config/snippet_paste -iname "*$@*" -type f -print0 | xargs -0 vim
}
snprm() {
found=$(find ~/.config/snippet_paste -iname "*$@*" -type f)
set -f
printf "%s\n\t" $found
printf "remove snippet?[y/N]"
read ans
[ $ans = "y" ] && mv $found ~/.local/share/Trash/files
}
lem() {
files=$@
emacsclient -s $EMACS_SERVER_SOCKET -c ${files:="."} & disown
}
# crop=width:height:initial-x:initial-y
# par expansion da ext = ${file##*.}
cropedp() {
for file in $@
do
ffmpeg -i $file -vf crop=1366:768:0:900 ${file%%.*}.jpg
done
}
crophdmi() {
for file in $@
do
ffmpeg -i $file -vf crop=1600:900:0:0 ${file%%.*}.jpg
done
}
medula() {
rsync -vPhua $@ [email protected]:~
}