bin: fix oversights & improve freq
This commit is contained in:
parent
65201a3ba8
commit
32ccac9184
|
@ -44,9 +44,8 @@ fi
|
||||||
|
|
||||||
highlight "d to recursively remove development caches"
|
highlight "d to recursively remove development caches"
|
||||||
if [[ $1 =~ "d" ]]; then
|
if [[ $1 =~ "d" ]]; then
|
||||||
rm -rf .npm .yarn
|
find -name "src" -prune -o \
|
||||||
arg-test -name "src" -prune -o \
|
-type d \( -name 'cache' $(echo $DIRS_GENERATED | sed 's|-x \([^ ]\+\)|-o -name \1|g') \) \
|
||||||
-type d \( -name 'cache' $(echo $DIRS_GENERATED | sed 's|-x \([^ ]\+\)|-o -name "\1"|g') \
|
|
||||||
-print -exec rm -r {} + -prune
|
-print -exec rm -r {} + -prune
|
||||||
echo -n " " && highlight "build directories"
|
echo -n " " && highlight "build directories"
|
||||||
find $DATA/2-standards/dev/aur -mindepth 2 -maxdepth 2 -type d -not -name ".*" \
|
find $DATA/2-standards/dev/aur -mindepth 2 -maxdepth 2 -type d -not -name ".*" \
|
||||||
|
|
|
@ -1,6 +1,21 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Show a frequance spectrogram using sox and timg
|
# Show a frequence spectrogram using sox and timg
|
||||||
out=${2:-/tmp/$1-sox.png}
|
# https://sound.stackexchange.com/questions/40226/show-the-differences-between-two-similar-audio-files-using-graphical-method
|
||||||
|
case $1 in
|
||||||
|
(-a) shift
|
||||||
|
for arg; do $0 "$arg"; done
|
||||||
|
;;
|
||||||
|
(-d) shift
|
||||||
|
diff="/tmp/diff-$1-$2.wav"
|
||||||
|
ffmpeg -y -v warning -i "$1" "/tmp/$1.wav"
|
||||||
|
ffmpeg -y -v warning -i "$2" "/tmp/$2.wav"
|
||||||
|
sox -m -v 1 "/tmp/$1.wav" -v -1 "/tmp/$2.wav" "$diff"
|
||||||
|
$0 "$diff"
|
||||||
|
;;
|
||||||
|
(*)
|
||||||
|
out="${2:-/tmp/freq-$(basename "$1").png}"
|
||||||
mkdir -p "$(dirname "$out")"
|
mkdir -p "$(dirname "$out")"
|
||||||
sox "$1" -n spectrogram -o "$out"
|
sox "$1" -n spectrogram -o "$out"
|
||||||
timg --title "$out"
|
timg --title "$out"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# disk size usage information
|
# disk size usage information
|
||||||
|
if test "$1" = "f"
|
||||||
|
then df -B1M -x tmpfs -x devtmpfs -x squashfs | awk -v a="\033[31m" -v b="\033[33m" -v c="\033[35m" -v n="\033[0m" 'NR==1 {printf "%-20s %6s %7s %9s %s\n",$1,$5,$3,$4,$6} NR>1 {u=strtonum($5); printf (u > 99) ? a : (u > 97) ? b : (u > 94) ? c : ""; printf "%-20s %6s %6.1fG %8.1fG %s\n",$1,$5,$3/1000,$4/1000,$6; printf n}'
|
||||||
|
else
|
||||||
IFS="\n"
|
IFS="\n"
|
||||||
cols=$(tput cols)
|
cols=$(tput cols)
|
||||||
lsblk --output name,size,fsuse%,mountpoints,label$(test $cols -gt 110 && echo ',uuid,fstype') --width $cols |
|
lsblk --output name,size,fsuse%,mountpoints,label$(test $cols -gt 110 && echo ',uuid,fstype') --width $cols |
|
||||||
|
@ -8,4 +11,4 @@ lsblk --output name,size,fsuse%,mountpoints,label$(test $cols -gt 110 && echo ',
|
||||||
printf "$(expr "$line" : " " >/dev/null || echo "\033[$(test -z "$first" && echo "4" || expr "5;31" \& "$p" \> 98 \| "31" \& "$p" \> 97 \| "33" \& "$p" \> 94 \| "35" \& "$p" \> 90)m")%s\n" "$line"
|
printf "$(expr "$line" : " " >/dev/null || echo "\033[$(test -z "$first" && echo "4" || expr "5;31" \& "$p" \> 98 \| "31" \& "$p" \> 97 \| "33" \& "$p" \> 94 \| "35" \& "$p" \> 90)m")%s\n" "$line"
|
||||||
first=1
|
first=1
|
||||||
done
|
done
|
||||||
# df -B1M -x tmpfs -x devtmpfs -x squashfs | awk -v a="\033[31m" -v b="\033[33m" -v c="\033[35m" -v n="\033[0m" 'NR==1 {printf "%-20s %6s %7s %9s %s\n",$1,$5,$3,$4,$6} NR>1 {u=strtonum($5); printf (u > 99) ? a : (u > 97) ? b : (u > 94) ? c : ""; printf "%-20s %6s %6.1fG %8.1fG %s\n",$1,$5,$3/1000,$4/1000,$6; printf n}'
|
fi
|
||||||
|
|
Loading…
Reference in New Issue