Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

desktop-file clarifications #802

Closed
umlaeute opened this issue Nov 10, 2022 · 11 comments
Closed

desktop-file clarifications #802

umlaeute opened this issue Nov 10, 2022 · 11 comments

Comments

@umlaeute
Copy link
Contributor

umlaeute commented Nov 10, 2022

The generated FreeDesktop .desktop file (on Linux) currently looks like this:

[Desktop Entry]
Type=Application
Name=JackTrip
Comment=Network Music Performance over the Internet
Comment[fr]=Performance de musique en réseau sur internet
Exec=/bin/bash -c "if [ -z ""\$"1" ]; then jacktrip; else jacktrip --gui --deeplink ""\$"1"; fi" /bin/bash %u
Icon=org.jacktrip.JackTrip
Terminal=false
StartupWMClass=org.jacktrip.jacktrip
MimeType=application/jacktrip;x-scheme-handler/jacktrip;

my automatic checkers complained about the /bin/bash invocation in Exec, so I took a deeper look.

afaict, there is really no reason to force the shell to /bin/bash - any POSIX compliant shell should do, so probably sh should be used instead.

also, I don't understand that second use of /bin/bash - afaict this is just a place-holder that is not used anyhow, and thus it is a bit confusing to read /bin/bash here (as it somehow implies that /bin/bash %u is going to be executed, which is never true).

I would therefore suggest to change the Exec-key in the desktop to something like:

Exec=sh -c "if [ -z ""\$"1" ]; then jacktrip; else jacktrip --gui --deeplink ""\$"1"; fi" jacktrip %u

(or even Exec=sh -c "if [ -z ""\$"1" ]; then jacktrip; else jacktrip --gui --deeplink ""\$"0"; fi" %u)

the other question is: what exactly is the purpose of this invocation?
if i drag some file on my JackTrip application icon, this will just start jacktrip and open the file with the default handler for this file (e.g. a PDF-reader if i drop a PDF on the JackTrip).
I don't think this is very useful per se (at best it teaches anti-patterns to use JackTrip as a generic file-opening application).

i would have expected to be able to drop something like a configuration-file, but afaict, JackTrip doesn't really support config-files (at least I haven't found any documentation on how to create such a config-file).

finally, the .desktop-file mentions application/jacktrip and x-scheme-handler/jacktrip as valid mimetypes. are these mimetypes a thing, or are they three "just in case"?

ping @mattahorton

@umlaeute
Copy link
Contributor Author

as a side-note: the --gui and --deeplink flags are nowhere documented. what is there purpose? (and would it make sense to add them to the --help output?)

@psiborg112
Copy link
Collaborator

The --gui flag forces the program to run in GUI mode even when command switches are passed to it. (That's the mechanism that usually determines whether it should run in GUI or command line mode.) Until recently, it was of very limited use, since most command switches were ignored, so it was really only useful for development. That's changed with #934, so going forward you'll see it on the help screen.

As for the deeplink stuff, and the way it's used in the desktop file, I'm afraid I'm of no help there. It's for the VirtualStudio side of things rather than the community led part of the project. You'd need to get clarification from one of the JackTrip Labs people.

@umlaeute
Copy link
Contributor Author

So where would I ask these ominous "JackTrip Labs people"? Do the follow this repository, or do they just do their own thing?

@psiborg112
Copy link
Collaborator

They do follow this repository. @mattahorton and @dhing1024 might be your best bet.

@mattahorton
Copy link
Contributor

mattahorton commented Feb 27, 2023

👋

The --deeplink flag allows us to pass jacktrip:// urls to the process via the command line. These are used by Virtual Studio to automatically open JackTrip when you click "Join" on one of our studios (aka servers).

@mattahorton
Copy link
Contributor

It's been long enough since I updated the desktop file that I don't have clear answers on things like the shell or your other questions.

I do know that the Exec line here is intended to pass the deeplink URL to the jacktrip process to open JackTrip and do things automatically for the user. Right now we only use it to join servers.

@umlaeute
Copy link
Contributor Author

umlaeute commented Feb 27, 2023 via email

@mattahorton
Copy link
Contributor

Haha. Yeah. That shouldn't work that way. That's likely an issue of me not being an every day Linux user.

In this case, when you click a jacktrip:// link, the exec file takes that url (argument $1) and passes it to jacktrip if it exists. The jacktrip process parses it and takes an action if the URL is formed properly.

@umlaeute
Copy link
Contributor Author

sorry if i appear dense, but

how do you click these jacktrip:// links? i mean:

  • is this a URL of the form jacktrip://example.com/session?
  • or a Windows "shortcut", aka: "link" (which is more file-like)

i guess a Windows "shortcut" can point to a URL...

@dhing1024
Copy link
Contributor

It's a URL of the form jacktrip://join/SERVER_ID, where SERVER_ID is the Virtual Studio server ID in https://app.jacktrip.org/studios/SERVER_ID. It's used so that, for example, a Virtual Studio user can click a button in the browser web app to automatically open the installed software app and connect to a studio.

There aren't really many other use cases for them (they don't serve a purpose when using Classic mode and they weren't meant to be shareable links), though I guess you could save a deeplink URL as a desktop shortcut if you found it useful.

@mikedickey
Copy link
Collaborator

I updated parsing of deeplinks in #1203, eliminating the need for any of the bash stuff in the desktop file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants