Skip to content

Commit

Permalink
Remove YMuse install/launch from menu, add Configure MusicPlayerPlus …
Browse files Browse the repository at this point in the history
…to menu, update man pages
  • Loading branch information
ron.record committed Jul 13, 2024
1 parent 9099ee0 commit 039c2c9
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 179 deletions.
91 changes: 48 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1568,49 +1568,51 @@ provide a brief summary of the command line options.
</summary>

```text
Usage: mppinit [-a] [-b] [-d] [-e] [-l music_dir] [-n] [-o] [-q] [-r] [-U] [-y] [-u] [bandcamp|discogs|discogs local|discogs upload vault folder|import|kitty|metadata|mopidy|mpd|navidrome|soundcloud|sync|yams|ymuse|youtube]
Usage: mppinit [-a] [-b] [-d] [-e] [-l music_dir] [-n] [-o] [-q] [-r] [-U] [-y] [-u] [bandcamp|cantata|discogs|discogs local|discogs upload vault folder|import|kitty|metadata|mopidy|mpd|navidrome|soundcloud|spotify|sync|yams|youtube]
Where:
'-a' use AcousticBrainz for acoustic audio analysis [deprecated]
'-b' use Blissify for MPD acoustic audio analysis
'-d' install latest Beets development branch rather than
the latest stable release (for testing purposes)
'-e' use Essentia for Beets acoustic audio analysis (default)
'-l music_dir' specifies the location of the music library
'-n' indicates perform a dry run, don't do anything just tell me
'-o' indicates overwrite any pre-existing configuration
'-q' indicates quiet execution, no status messages
'-r' indicates remove service
supported service removals: mopidy navidrome
'-U' indicates do not upgrade installed Python modules
'-y' indicates answer 'yes' to all and proceed
'-u' displays this usage message and exits
'bandcamp' downloads all albums in your Bandcamp collections
'discogs' generates an Obsidian vault from your Discogs user collection
'discogs local' generates an Obsidian vault from your local music library
'discogs upload vault folder' adds the releases in 'vault' to
Discogs user collection folder 'folder'
(DISCOGS_USER and DISCOGS_TOKEN in '~/.config/mpprc must be set)
'import' performs a Beets music library import
'kitty' installs the Kitty terminal emulator
'metadata' performs a library metadata update
'mopidy' installs and configures Mopidy extensible music server
Note: activating Mopidy deactivates MPD
'mpd' activates the MPD music server and deactivates Mopidy
'navidrome' installs and configures Navidrome music server
Note: 'mppinit navidrome <version>' can be used to specify
an alternate version of Navidrome to download and install
'soundcloud' downloads all favorites in your Soundcloud account
'sync' synchronizes MusicPlayerPlus configuration across configs
'yams' activates the YAMS Last.fm scrobbler service
'ymuse' installs the Ymuse MPD graphical client
'youtube' installs the YouTube Music client youtube-music
'-a' use AcousticBrainz for acoustic audio analysis [deprecated]
'-b' use Blissify for MPD acoustic audio analysis
'-d' install latest Beets development branch rather than
the latest stable release (for testing purposes)
'-e' use Essentia for Beets acoustic audio analysis (default)
'-l music_dir' specifies the location of the music library
'-n' indicates perform a dry run, don't do anything just tell me
'-o' indicates overwrite any pre-existing configuration
'-q' indicates quiet execution, no status messages
'-r' indicates remove service
supported service removals: mopidy navidrome
'-U' indicates do not upgrade installed Python modules
'-y' indicates answer 'yes' to all and proceed
'-u' displays this usage message and exits
'bandcamp' downloads all albums in your Bandcamp collections
'cantata' installs the Cantata MPD graphical client
'discogs' generates an Obsidian vault from your Discogs user collection
'discogs local' generates an Obsidian vault from your local music library
'discogs upload vault folder' adds the releases in 'vault' to
Discogs user collection folder 'folder'
(DISCOGS_USER and DISCOGS_TOKEN in '~/.config/mpprc must be set)
'import' performs a Beets music library import
'kitty' installs the Kitty terminal emulator
'metadata' performs a library metadata update
'mopidy' installs and configures Mopidy extensible music server
Note: activating Mopidy deactivates MPD
'mpd' activates the MPD music server and deactivates Mopidy
'navidrome' installs and configures Navidrome music server
Note: 'mppinit navidrome <version>' can be used to specify
an alternate version of Navidrome to download and install
'soundcloud' downloads all favorites in your Soundcloud account
'spotify' installs the Spotify Music client spotify_player
'sync' synchronizes MusicPlayerPlus configuration across configs
'yams' activates the YAMS Last.fm scrobbler service
'youtube' installs the YouTube Music client youtube-music
'mppinit' must be run as the MusicPlayerPlus user, not root.
'mppinit' must be run prior to 'mppinit sync', 'mppinit kitty',
'mppinit metadata', 'mppinit bandcamp', 'mppinit mopidy',
'mppinit navidrome', 'mppinit soundcloud', or 'mppinit import'
'mppinit metadata', 'mppinit bandcamp', 'mppinit mopidy',
'mppinit navidrome', 'mppinit soundcloud', or 'mppinit import'
```

</details>
Expand All @@ -1626,11 +1628,11 @@ MusicPlayerPlus capabilities.

```text
Usage: mpplus [-A on|off] [-a] [-b] [-B] [-c] [-C client] [-E] [-e] [-F]
[-f] [-G] [-g] [-D art|bandcamp|discogs|local|soundcloud] [-d music_directory] [-h]
[-H] [-I] [-i] [-jJ] [-k] [-K] [-L] [-m] [-n num] [-N] [-U vault] [-Z]
[-M alsaconf|enable|disable|restart|start|stop|status] [-p]
[-P script] [-q] [-Q] [-r] [-R] [-s song] [-S] [-t] [-T on|off] [-u]
[-v viz_comm] [-w|W] [-x query] [-X query] [-y] [-Y] [-z fzmpopt]
[-f] [-G] [-g] [-D art|bandcamp|discogs|local|soundcloud] [-d music_directory]
[-h] [-H] [-I] [-i] [-jJ] [-k] [-K] [-l config|spotify|status] [-L] [-m]
[-n num] [-N] [-M alsaconf|enable|disable|restart|start|stop|status] [-p]
[-P script] [-q] [-Q] [-r] [-R] [-s song] [-S] [-t] [-T on|off] [-U vault]
[-u] [-v viz_comm] [-w|W] [-x query] [-X query] [-y] [-Y] [-z fzmpopt] [-Z]
MPCplus/Visualizer options:
-A 'on|off' specifies whether to display album cover art
-C 'client' indicates use 'client' MPD client rather than mpcplus
Expand Down Expand Up @@ -1684,6 +1686,9 @@ General options:
In conjunction with '-I', the '-A on' option disables auto-tagging
-i indicates start mpplus in interactive mode
-K indicates kill MusicPlayerPlus tmux sessions and ASCIImatics scripts
-l 'config' launches an editor in a terminal window to configure MusicPlayerPlus
-l 'spotify' launches the Spotify Player in a terminal window
-l 'status' displays services status and exits
-L indicates download lyrics to the Beets library and exit
-M 'action' can be used to control the Music Player Daemon (MPD)
or configure the ALSA sound system
Expand Down
13 changes: 1 addition & 12 deletions bin/mppinit
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ exp_music="${HOME}/Music"
usage() {
printf "\nUsage: mppinit [-a] [-b] [-d] [-e] [-l music_dir] [-n] [-o] [-q] [-r]"
printf " [-U] [-y] [-u] [bandcamp|cantata|discogs|discogs local|discogs upload vault folder|import|kitty|metadata|"
printf "mopidy|mpd|navidrome|soundcloud|spotify|sync|yams|ymuse|youtube]"
printf "mopidy|mpd|navidrome|soundcloud|spotify|sync|yams|youtube]"
printf "\nWhere:"
printf "\n\t'-a' use AcousticBrainz for acoustic audio analysis [deprecated]"
printf "\n\t'-b' use Blissify for MPD acoustic audio analysis"
Expand Down Expand Up @@ -110,7 +110,6 @@ usage() {
printf "\n\t'spotify' installs the Spotify Music client spotify_player\n"
printf "\n\t'sync' synchronizes MusicPlayerPlus configuration across configs"
printf "\n\t'yams' activates the YAMS Last.fm scrobbler service"
printf "\n\t'ymuse' installs the Ymuse MPD graphical client"
printf "\n\t'youtube' installs the YouTube Music client youtube-music\n"
printf "\n\n'mppinit' must be run as the MusicPlayerPlus user, not root."
printf "\n'mppinit' must be run prior to 'mppinit sync', 'mppinit kitty',"
Expand Down Expand Up @@ -2556,16 +2555,6 @@ remove_kitty() {
exit 0
}

[ "${argument}" == "ymuse" ] && {
if [ -x ${SCPTDIR}/install-ymuse.sh ]; then
${SCPTDIR}/install-ymuse.sh
exit 0
else
printf "\nERROR: ${SCPTDIR}/install-ymuse.sh not found or not executable\n"
exit 1
fi
}

[ "${argument}" == "youtube" ] && {
if [ -x ${SCPTDIR}/install-youtube-music.sh ]; then
${SCPTDIR}/install-youtube-music.sh
Expand Down
123 changes: 61 additions & 62 deletions bin/mpplus
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ MPPCONF="${HOME}/.config/mpprc"

usage() {
printf "\nUsage: mpplus [-A on|off] [-a] [-b] [-B] [-c] [-C client] [-E] [-e] [-F]"
printf "\n\t[-f] [-G] [-g] [-D art|bandcamp|discogs|local|soundcloud] [-d music_directory] [-h]"
printf "\n\t[-H] [-I] [-i] [-jJ] [-k] [-K] [-L] [-m] [-n num] [-N] [-U vault] [-Z]"
printf "\n\t[-M alsaconf|enable|disable|restart|start|stop|status] [-p]"
printf "\n\t[-P script] [-q] [-Q] [-r] [-R] [-s song] [-S] [-t] [-T on|off] [-u]"
printf "\n\t[-v viz_comm] [-w|W] [-x query] [-X query] [-y] [-Y] [-z fzmpopt]"
printf "\n\t[-f] [-G] [-g] [-D art|bandcamp|discogs|local|soundcloud] [-d music_directory]"
printf "\n\t[-h] [-H] [-I] [-i] [-jJ] [-k] [-K] [-l config|spotify|status] [-L] [-m]"
printf "\n\t[-n num] [-N] [-M alsaconf|enable|disable|restart|start|stop|status] [-p]"
printf "\n\t[-P script] [-q] [-Q] [-r] [-R] [-s song] [-S] [-t] [-T on|off] [-U vault]"
printf "\n\t[-u] [-v viz_comm] [-w|W] [-x query] [-X query] [-y] [-Y] [-z fzmpopt] [-Z]"
printf "\nMPCplus/Visualizer options:"
printf "\n\t-A 'on|off' specifies whether to display album cover art"
printf "\n\t-C 'client' indicates use 'client' MPD client rather than mpcplus"
Expand Down Expand Up @@ -109,6 +109,9 @@ usage() {
printf "\n\t\tIn conjunction with '-I', the '-A on' option disables auto-tagging"
printf "\n\t-i indicates start mpplus in interactive mode"
printf "\n\t-K indicates kill MusicPlayerPlus tmux sessions and ASCIImatics scripts"
printf "\n\t-l 'config' launches an editor in a terminal window to configure MusicPlayerPlus"
printf "\n\t-l 'spotify' launches the Spotify Player in a terminal window"
printf "\n\t-l 'status' displays services status and exits"
printf "\n\t-L indicates download lyrics to the Beets library and exit"
printf "\n\t-M 'action' can be used to control the Music Player Daemon (MPD)"
printf "\n\t or configure the ALSA sound system"
Expand Down Expand Up @@ -261,30 +264,24 @@ center_window() {
pick_terminal() {
if [ "${have_kitty}" ]
then
echo "Continuing with Kitty as the terminal emulator."
KITTY=1
else
if [ "${have_gnome}" ]
then
echo "Continuing with gnome-terminal as the terminal emulator."
GNOME=1
else
if [ "${have_tilix}" ]
then
echo "Continuing with tilix as the terminal emulator."
TILIX=1
else
if [ "${have_retro}" ]
then
echo "Continuing with cool-retro-term as the terminal emulator."
RETRO=1
else
if [ "${have_simple}" ]
then
echo "Continuing with st as the terminal emulator."
SIMPLE=1
else
echo "No supported terminal emulator located."
return 1
fi
fi
Expand Down Expand Up @@ -1263,14 +1260,6 @@ make_it_so() {
}
[ "${can_win}" ] && center_window "${can_win}" "top"
}
[ "${MPCOMM}" == "ymuse" ] && [ "${USE_EWMH}" ] && {
sleep 1
ymu_win=$(wmctrl -l -G -x | grep ymuse.ymuse | grep "Ymuse")
[ "${ymu_win}" ] || {
ymu_win=$(wmctrl -l -G -x | grep ymuse.ymuse | grep -i "ymuse")
}
[ "${ymu_win}" ] && center_window "${ymu_win}" "top"
}
fi
fi
fi
Expand Down Expand Up @@ -3207,7 +3196,6 @@ show_main_menu() {
[ "${have_tilix}" ] && options+=("Launch ${MPD_CLIENT} with Tilix [lt]")
[ "${have_cantata}" ] && options+=("Cantata Music Player Plus [C]")
[ "${have_spot}" ] && options+=("Spotify Music Player Plus [sp]")
[ "${have_ymuse}" ] && options+=("YMuse Music Player Plus [Y]")
[ "${have_ytm}" ] && options+=("YouTube Music Player Plus [y]")
[ "${need_yams}" ] && options+=("Activate Last.fm Scrobbler [S]")
options+=("ASCIImatics Animations [a]")
Expand All @@ -3231,12 +3219,12 @@ show_main_menu() {
options+=("Toggle Fullscreen ${fullstat} [F]")
[ "${have_cantata}" ] || options+=("Install Cantata MPD client [ic]")
[ "${have_spot}" ] || options+=("Install Spotify Player [is]")
[ "${have_ymuse}" ] || options+=("Install YMuse MPD client [im]")
[ "${have_ytm}" ] || options+=("Install YouTubeMusic Player [iy]")
[ "${have_ascii}" ] && options+=("Asciiville Menu [am]")
[ "${have_kc}" ] && options+=("Kitty Control Menu [km]")
[ "${have_mirror}" ] && options+=("MagicMirror Command Menu [mm]")
[ "${have_roon}" ] && options+=("RoonCommandLine Menu [rm]")
options+=("Configure MusicPlayerPlus [E]")
options+=("About [A]")
options+=("Info [i]")
options+=("Quit [q]")
Expand Down Expand Up @@ -3336,24 +3324,7 @@ show_main_menu() {
break
;;
"Spotify Music Player Plus"*,*|*,"Spotify Music Player Plus"*|"sp",*|*,"sp")
MPCPLUS="spotify_player"
MPCPLUS_TMUX="${MPCPLUS}"
MTITLE="Spotify Player"
USE_MPCPLUS=1
USE_TMUX=1
SPLASH=
CURRENT=
pick_terminal || CONSOLE_MODE=1
break
;;
"Install YMuse"*,*|*,"Install YMuse"*|"im",*|*,"im")
mppinit ymuse
have_ymuse=$(type -p ymuse)
skip_it_so=1
break
;;
"YMuse Music Player Plus"*,*|*,"YMuse Music Player Plus"*|"Y",*|*,"Y")
ymuse >/dev/null 2>&1 &
mpplus -l spotify &
skip_it_so=1
break
;;
Expand Down Expand Up @@ -3483,6 +3454,11 @@ show_main_menu() {
skip_it_so=1
break
;;
"Configure"*,* | *,"Configure"* | "configure"*,* | *,"configure"* | "E",* | *,"E")
mpplus -l config &
skip_it_so=1
break
;;
"Info"*,*|*,"Info"*|"i",*|*,"i")
show_info
prompt_continue
Expand Down Expand Up @@ -3939,7 +3915,6 @@ have_xrandr=$(type -p xrandr)
have_xdpy=$(type -p xdpyinfo)
have_cantata=$(type -p cantata)
have_spot=$(type -p spotify_player)
have_ymuse=$(type -p ymuse)
have_ytm=$(type -p youtube-music)
have_gnome=$(type -p gnome-terminal)
have_retro=$(type -p cool-retro-term)
Expand Down Expand Up @@ -4126,7 +4101,6 @@ set_need_yams
if [ "${CONSOLE_MODE}" ]
then
have_cantata=
have_ymuse=
have_ytm=
have_gnome=
have_retro=
Expand Down Expand Up @@ -4203,7 +4177,7 @@ KITTY_SOCKET="/tmp/__mppkitty__"
debug=
dryrun=
vault=
while getopts "A:abBcC:D:d:eEFfGghHiIjJkKlLmM:n:NpP:qQrRSs:tT:U:v:VwWx:X:yYZz:u" flag
while getopts "A:abBcC:D:d:eEFfGghHiIjJkKl:LmM:n:NpP:qQrRSs:tT:U:v:VwWx:X:yYZz:u" flag
do
case $flag in
a)
Expand Down Expand Up @@ -4258,26 +4232,21 @@ do
echo "Continuing, using cantata rather than ${CLIENT}."
CLIENT=cantata
else
if [ "${have_ymuse}" ]; then
echo "Continuing, using ymuse rather than ${CLIENT}."
CLIENT=ymuse
else
CLIENT=
if [ "${MPD_CLIENT}" ]; then
MPCPLUS="${MPD_CLIENT}"
mpcbase=$(basename ${MPCPLUS})
type -p ${mpcbase} > /dev/null || {
[ -x "${MPCPLUS}" ] || {
MPCPLUS=mpcplus
}
CLIENT=
if [ "${MPD_CLIENT}" ]; then
MPCPLUS="${MPD_CLIENT}"
mpcbase=$(basename ${MPCPLUS})
type -p ${mpcbase} > /dev/null || {
[ -x "${MPCPLUS}" ] || {
MPCPLUS=mpcplus
}
echo "Continuing, using ${MPCPLUS} rather than ${CLIENT}."
else
MPCPLUS="mpcplus"
echo "Continuing, using mpcplus rather than ${CLIENT}."
fi
MPD_CLIENT="${MPCPLUS}"
}
echo "Continuing, using ${MPCPLUS} rather than ${CLIENT}."
else
MPCPLUS="mpcplus"
echo "Continuing, using mpcplus rather than ${CLIENT}."
fi
MPD_CLIENT="${MPCPLUS}"
fi
}
[ "${CLIENT}" ] && {
Expand Down Expand Up @@ -4409,8 +4378,38 @@ do
}
;;
l)
show_full_status
farewell_exit "Exiting MusicPlayerPlus"
case "${OPTARG}" in
config*|Config*)
MPCPLUS="vi ${HOME}/.config/mpprc"
MPCPLUS_TMUX="${MPCPLUS}"
MTITLE="Configure MusicPlayerPlus"
USE_MPCPLUS=1
USE_TMUX=1
SPLASH=
CURRENT=
USE_EWMH=
pick_terminal || CONSOLE_MODE=1
make_it_so
exit 0
;;
Spotify*|spotify*)
MPCPLUS="spotify_player"
MPCPLUS_TMUX="${MPCPLUS}"
MTITLE="Spotify Player"
USE_MPCPLUS=1
USE_TMUX=1
SPLASH=
CURRENT=
USE_EWMH=
pick_terminal || CONSOLE_MODE=1
make_it_so
exit 0
;;
status|Status)
show_full_status
farewell_exit "Exiting MusicPlayerPlus"
;;
esac
;;
L)
FETCH_LYRICS=1
Expand Down
Loading

0 comments on commit 039c2c9

Please sign in to comment.