doctorfree / MusicPlayerPlus

Featureful ncurses based MPD client inspired by ncmpc with integration for Beets, spectrum visualization,Bandcamp/Soundcloud, asciimatics, cantata, and more
https://musicplayerplus.dev
MIT License
72 stars 1 forks source link

[FEATURE] Remove dependency on gnome-terminal and provide native terminal emulator support #2

Closed doctorfree closed 2 years ago

doctorfree commented 2 years ago

MusicPlayerPlus version 2.0.1 release 1 and prior have dependencies on gnome-terminal, tilix, and cool-retro-term terminal emulators. Both gnome-terminal and tilix require complex configuration of profiles prone to error. MusicPlayerPlus users may not like being tied to these terminal emulators. This is a feature request calling for greater flexibility in terminal emulator usage. Support alternate terminal emulators or simply support whatever terminal emulator the user prefers.

[Note:] implementation of this feature request must satisfy the following MusicPlayerPlus requirements.

Execution of mpplus in a terminal emulator must be able to:

One way to simply use whatever terminal emulator is being used is to always run in a tmux session. MusicPlayerPlus is already using tmux in some scenarios like console usage where there is no terminal emulator. Running multiple commands in a single terminal emulator window with tmux satisfies most of the above. Color support in tmux varies. Can you have different font sizes in different tmux panes? Since tmux support is already available on console screens, then make it available for use in the current terminal, whatever that may be.

Another route would be to select a terminal emulator dependency that is cross-platform, always available, and has features that support all requirements. For example, replace the gnome-terminal and tilix dependencies with a dependency on kitty. Use kitty's sessions and layouts features to accomplish something similar to what tmux can do. Other terminal emulators like alacritty or st might suffice. Perhaps a set of terminal emulators could be supported, at startup a check for available supported terminals performed, if none found then use current terminal or prompt to select which supported terminal to install.

This feature request is intended to serve as an area of discussion around the use of terminal emulators in MusicPlayerPlus. All ideas, suggestions, criticisms, and thoughts are welcome.

doctorfree commented 2 years ago

One problem with Kitty, and probably an issue with any implementation, is the disparity between versions and features supported on various platforms. Currently the version of Kitty varies between 0.15.0 on Ubuntu 20.04 (horribly out-of-date) to 0.25.2 on Arch Linux. Some features like remote control of Kitty using a Unix socket and configuration via included environment variables are only available in recent versions of Kitty.

Whatever solution is implemented, it must work on all MusicPlayerPlus supported platforms. This means either abandoning Ubuntu 20.04 as a supported platform or restricting terminal emulator feature use to older versions of Kitty or whatever terminals are supported.

doctorfree commented 2 years ago

I want to add st, the simple terminal, as a supported terminal emulator in MusicPlayerPlus. However, it looks like st does not have an option to specify fullscreen display. There are patches people have supplied to enable such a feature in st. If st is added as a supported terminal emulator then either it would need to be patched (unlikely I would do this) or it could only be supported in non-fullscreen mode. Not sure what to do with st support in MusicPlayerPlus.

doctorfree commented 2 years ago

In the current development version of MusicPlayerPlus, Kitty is installed by downloading the latest stable version with curl. This avoids the issue raised above with some distributions like Ubuntu having older versions of Kitty in their package repository.

This version/feature disparity is still an issue for systems that have previously installed Kitty from a repository containing an older version. I'm still unsure how to use recent Kitty features like remote control over a socket since I cannot totally control what version of Kitty is installed.

doctorfree commented 2 years ago

Package dependencies on terminal emulators have been removed. Cool-retro-term is an optional dependency. Kitty is installed during mppinit if not already present. If no supported terminal emulator is found then the current terminal/console is used and multiple commands are run in a tmux session. Command line switches have been implemented to allow the user to specify which terminal emulator to use or to use the current terminal/console window.

All of these changes are in v2.0.1r2