commit df0b70c9f5dae84807056dd7b5a64ac897198a37
parent 4a66c68add318612d958d0e11da78e33cb67eb36
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Fri, 9 Apr 2021 18:34:04 -0700
Simplify and improve mf shell function
Instead of switching between two hardcoded formats this function
simply undefines MPC_FORMAT if no arguments are given and defines
it as it's arguments otherwise.
Diffstat:
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/local/shell/.local/share/shell/mpc b/local/shell/.local/share/shell/mpc
@@ -1,13 +1,7 @@
# mpc shell functions
m() mpc "$@"
-mf() {
- if test "$MPC_FORMAT" = '%file%'; then
- export MPC_FORMAT='%position%\t"[%title%|%file%]" [by %artist%]'
- else
- export MPC_FORMAT='%file%'
- fi
-}
+mf() { test $# -gt 0 && export MPC_FORMAT="$@" || unset MPC_FORMAT ;}
# player
mP() m prev "$@"