RaySession icon indicating copy to clipboard operation
RaySession copied to clipboard

Externalize client templates

Open Houston4444 opened this issue 5 years ago • 3 comments

Hi. Here I tag @trebmuh , @eeickmeyer , @mxmilkiib because they provide a raysession package for various distributions, @BrunoVernay because he just made a template for MuseScore and @newlaurent62 because he is writing a wizard for some raysession use cases (I don't know if you are really concerned, but it could). If I forgot someone, feel free to tag in your comments.

It's something I've been thinking about for a long time, the PR #52 from @BrunoVernay for a MuseScore template activate this discussion.

Till now, RaySession provides factory templates only for NSM compatible softwares and softwares capable to be saved with LASH protocol. This means that all theses softwares will save their files at session save. In fact, even if it is not perfect, provide templates for some non saveable softwares would be useful for a lot of users. In addition to MuseScore, I think to LMMS, TuxGuitar, Audacity... maybe it could be useful also for non musical softwares (Kwrite, Pluma, libreoffice calc....).

Providing these client templates directly in RaySession is problematic, because these templates will often vary slightly depending on the version of the program being run. The biggest problem comes when one program become NSM compatible, I can't update quickly its template because in many distributions this program won't be up to date. That's why I'm thinking that you might want to be able to add factory templates with external package(s) to the raysession package. This problem already exists for Amsynth and for Hydrogen. Experience has shown that check the program version is sometime clearly insufficient.

Currently, factory client templates are in $DESTDIR/share/RaySession/client_templates (where DESTDIR is usually /usr or /usr/local). I think I could move them to /etc/xdg/RaySession/client_templates/ inside a folder named 50_raysession_factory . Then you could easily add or overwrite templates adding a folder starting with a < 50 number in /etc/xdg/RaySession/client_templates , this folder containing same type of data of course.

Obviously, RaySession code could contains a non saveable client templates list that could be useful for you (a quick test on your distribution is needed for each app), this list could be installed with a make option.

Thanks for reading me through! What do you think about ?

Houston4444 avatar May 18 '20 16:05 Houston4444

Interesting

  • First, as for MuseScore, the chances that NSM is ever supported are very low. It is a large multi platform application with focus on Notation, not rendition. It does not mean that other application would get this support (zRythm, ...), but given the actual number of application supporting NSM, I am not too optimistic. So the risk is low, if that is a good thing ...
  • Having Sessions supported at the Desktop level would be fantastic. FreeDesktop, Gnome and KDE would have to agree on something, but that would not be Open Sound Control. (Note that Qt has a notion of session, I guess they all have in a form or another, but not as we expect it to be.) Anyway it would be great. I guess you would have to get in touch with FreeDesktop folks, I don't know.
  • As for the solution using priorities in directories, allowing to "overwrite" a prior definition, I think it is great. Easy to understand and easy to work with.

Overall, I do not see this as a big issue given the pace of adoption of NSM. (But I hope I am wrong because, this is a super excellent feature!)

BrunoVernay avatar May 18 '20 18:05 BrunoVernay

More than a year already. I used it for a while and then went for different kind of music ... I am back and wondering if the status has changed on this?? Shall I use the client_templates.xml and the XXX_SESION_NAME_XXX... or the scripts? or something else? (I am using the MuseScore Flatpak edition).

BrunoVernay avatar Jul 10 '21 20:07 BrunoVernay

Hi @BrunoVernay , sorry for the delay.

The feature has been implemented a long time ago, probably in summer 2020, I forgot to mention this in this ticket. IIRC, it works exactly as I said in my top post, but it mainly concerns packagers, not users. It only concerns factory templates too.

The best is still to make your template graphically, see http://raysession.tuxfamily.org/fr/manual#ajouter_un_programme_non_fourni (in french), or http://raysession.tuxfamily.org/en/manual.html#add_program_not_provided (in english). Then if ever you want to transform an user template to a factory template, just move its files to a folder in /etc/xdg/raysession/client_templates and reproduce the scheme you will see in 60_ray_lash.

I remember that musescore may have an OSC entry to save its file, have you explored this ?

Houston4444 avatar Aug 04 '21 08:08 Houston4444