config/shell: some formatting

This commit is contained in:
xeruf 2022-01-05 18:42:20 +01:00
parent cc54645159
commit e80992e33b
4 changed files with 28 additions and 27 deletions

View File

@ -57,5 +57,5 @@ map <leader>lw :setlocal colorcolumn=81 textwidth=80<CR>
map <leader>ln :setlocal colorcolumn= textwidth=0 wrap<CR> map <leader>ln :setlocal colorcolumn= textwidth=0 wrap<CR>
" Quickly switch indentation settings " Quickly switch indentation settings
map <leader>t :setlocal shiftwidth=2 expandtab<CR> map <leader>t :setlocal tabstop=2 expandtab<CR>
map <leader>T :setlocal shiftwidth=3 tabstop=3 noexpandtab<CR> map <leader>T :setlocal tabstop=3 noexpandtab<CR>

View File

@ -16,7 +16,7 @@
}, },
"main": { "main": {
"lang": "auto", "lang": "auto",
"lastfolder": "/home/janek/data/music/Mixes", "lastfolder": "/home/janek/data/music/Canto/Minecraft",
"maximized": false "maximized": false
}, },
"playlist": { "playlist": {
@ -43,7 +43,7 @@
"fontsize": 10, "fontsize": 10,
"rowsize": 43, "rowsize": 43,
"sort_fields": [ "sort_fields": [
"__filename" "__path"
], ],
"sort_reverse": false "sort_reverse": false
}, },
@ -118,14 +118,15 @@
"$num(%track%,2) %title%", "$num(%track%,2) %title%",
"%title%" "%title%"
], ],
"index": 3 "index": 0
}, },
"functions": { "functions": {
"last_used": "regex" "last_used": "regex"
}, },
"actions": { "actions": {
"checked": [ "checked": [
"Standard" "Standard",
"Artist splitting"
] ]
}, },
"quick_actions": { "quick_actions": {

View File

@ -37,23 +37,23 @@ gcn() {
# if in home or under XDG_CONFIG_HOME and not within a git directory, replace git by yadm # if in home or under XDG_CONFIG_HOME and not within a git directory, replace git by yadm
git() { git() {
case "$1" in case "$1" in
reset) test "$2" = "--hard" && return 1;; (reset) test "$2" = "--hard" && return 66;;
config) ;; (config) ;;
clone) ;; (clone) ;;
*) case "$PWD" in (*) case "$PWD" in
$HOME|$XDG_CONFIG_HOME|$LAST_YADM) ($HOME|$XDG_CONFIG_HOME|$LAST_YADM)
yadm "$@"
return
;;
$XDG_CONFIG_HOME*|$HOME/.local*)
if ! command git rev-parse --show-toplevel &>/dev/null; then
export LAST_YADM="$PWD"
yadm "$@" yadm "$@"
return return $?
fi;; ;;
($XDG_CONFIG_HOME*|$HOME/.local*)
if ! command git rev-parse --show-toplevel &>/dev/null; then
export LAST_YADM="$PWD"
yadm "$@"
return $?
fi;;
esac;; esac;;
esac esac
command git "$@"; command git "$@"
} }
# BRANCHES # BRANCHES

View File

@ -64,12 +64,12 @@ formatsongs() {
do builtin cd $d && findsongs | formatin do builtin cd $d && findsongs | formatin
done done
) )
IFS=$'\n' # fd --no-ignore-vcs --type f --extension opus --exec opusdec --quiet "{}" "{.}.wav" \; ".*" "$@"
for f in $(find "$@" -name "*.wav"); do find "$@" -type f -name "*.wav" -exec sh -c '
echo "Converting $f to ${f%.*}.flac" f="{}" &&
ffmpeg -i "$f" "${f%.*}.flac" -v warning && mv -v $f /tmp echo "Converting $f to ${f%.*}.flac" &&
done ffmpeg -i "$f" "${f%.*}.flac" -v warning &&
unset IFS mv -v "$f" /tmp' \;
} }
# Normalize filenames for files given from stdin # Normalize filenames for files given from stdin
@ -91,7 +91,7 @@ formatsong() {
s/ \(\..\{2,4\}\)$/\1/; s/ \(\..\{2,4\}\)$/\1/;
s/---/ - /; s/---/ - /;
s/^[0-9]\{6\}_//; s/^[0-9]\{6\}_//;
s/_/ /g; s/\([^/]\)_/\1 /g;
s/ \././g; s/ \././g;
s/ / /g; s/ / /g;
s/\(\w\)+\(\w\)/\1 \2/g' - s/\(\w\)+\(\w\)/\1 \2/g' -