config/shell: adjust utils

This commit is contained in:
xerus2000 2021-03-20 11:02:53 +01:00
parent 1028c5d46b
commit 7289de5e10
2 changed files with 12 additions and 3 deletions

View File

@ -75,11 +75,11 @@ addalbum() {
formatsongs() { formatsongs() {
_pwd="$PWD" _pwd="$PWD"
find "$PWD" "$@" -type d | while read d; do cd $d; findsongs | while read song; do find "$PWD" "$@" -type d | while read d; do builtin cd $d; findsongs | while read song; do
new="$(formatsong "$song")" new="$(formatsong "$song")"
test "$new" != "$song" && mv -v "$song" "$new" test "$new" != "$song" && mv -v "$song" "$new"
done; done done; done
cd "$_pwd" builtin cd "$_pwd"
IFS=$'\n' IFS=$'\n'
for f in $(find "$@" -name "*.wav"); do for f in $(find "$@" -name "*.wav"); do
echo "Converting $f to ${f%.*}.flac" echo "Converting $f to ${f%.*}.flac"
@ -89,5 +89,12 @@ formatsongs() {
} }
formatsong() { formatsong() {
echo "$1" | sed -e 's/\([ ([]\)\(ft\|Ft\|Feat\)\([ .]\)/\1feat\3/;s/\([ ([]\)feat /\1feat. /;s/ \((Original Mix)\|(Original)\|(Full Stream)\|.NCS Release.\)//i;s/ \(\..\{2,4\}\)$/\1/;s/---/ - /;s/^[0-9]\{6\}_//;s/ / /g;s/\(\w\)+\(\w\)/\1 \2/g' - echo "$1" | sed -e 's/\([ ([]\)\(ft\|Ft\|Feat\|featuring\)\([ .]\)/\1feat\3/;
s/\([ ([]\)feat /\1feat. /;
s/ \((Original Mix)\|(Original)\|(Full Stream)\|.NCS Release.\)//i;
s/ \(\..\{2,4\}\)$/\1/;
s/---/ - /;
s/^[0-9]\{6\}_//;
s/ / /g;
s/\(\w\)+\(\w\)/\1 \2/g' -
} }

2
.local/bin/scripts/airscan Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
scanimage --progress --device airscan --format=png "$@"