-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfun.zsh
28 lines (25 loc) · 846 Bytes
/
fun.zsh
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
function dcleanup() {
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null
}
function jose::fast_git() {
color=""
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2> /dev/null; then
branch_name="$(git symbolic-ref HEAD 2>/dev/null)" ||
branch_name="" # detached HEAD
if [ -z $branch_name ]; then
branch_name="$(git rev-parse HEAD)"
else
branch_name=${branch_name##refs/heads/}
fi
state="$(git diff --stat)"
diff=""
if [ -n "$state" ]; then
diff="%F{red}+%f"
fi
echo "$branch_name $diff"
fi
}
function mkv_duration() {
mkvmerge --identify -J "$1" | jq -r '.tracks[0].properties.tag_duration'
}