Closed doctorfree closed 2 years ago
One approach with the Cava config would be to use crudini.py
to perform a merge as the format of the Cava config file is INI:
/usr/share/musicplayerplus/scripts/crudini.py --merge $HOME/.config/mppcava/config < $HOME/.config/cava/config
Crudini does a very good job with merges. The difficulty with this approach is we do not want to overwrite some of the mppcava
configuration. The method
and source
configuration parameters need to conform to MusicPlayerPlus expectations. For example, if method = fifo
then source = $HOME/.config/mpd/mpd.fifo
Initial crack at merging previously set cava
configuration with mppcava
configuration:
#!/bin/bash
#
# set_prev_cava.sh - merge previously configured cava user preferences
# with $HOME/.config/mppcava/config
USERCONF="${HOME}/.config"
CAV_USER_CONF="${USERCONF}/cava/config"
MPP_USER_CONF="${USERCONF}/mppcava/config"
SCPTDIR="/usr/share/musicplayerplus/scripts"
if [ -x "${SCPTDIR}/crudini.py" ]
then
CRUDINI="${SCPTDIR}/crudini.py"
else
have_crudini=`type -p crudini`
if [ "${have_crudini}" ]
then
CRUDINI=crudini
else
CRUDINI=
fi
fi
[ -f "${CAV_USER_CONF}" ] && [ -f "${MPP_USER_CONF}" ] && [ "${CRUDINI}" ] && {
mth=`${CRUDINI} --get ${MPP_USER_CONF} input method`
src=`${CRUDINI} --get ${MPP_USER_CONF} input source`
${CRUDINI} --merge ${MPP_USER_CONF} < ${CAV_USER_CONF}
${CRUDINI} --set ${MPP_USER_CONF} input method ${mth}
${CRUDINI} --set ${MPP_USER_CONF} input source ${src}
}
exit 0
This seems to work. Closing.
MusicPlayerPlus includes an enhanced fork of the Cava spectrum visualizer. If the user has previously installed and configured Cava then merge any user customization of Cava into the
mppcava
configuration, preserving user preferences.