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

Launching a Program through a .desktop file with Vopono #241

Closed
Lcchy opened this issue Nov 10, 2023 · 2 comments
Closed

Launching a Program through a .desktop file with Vopono #241

Lcchy opened this issue Nov 10, 2023 · 2 comments

Comments

@Lcchy
Copy link

Lcchy commented Nov 10, 2023

Hi there,
First of all, thank you so much for this amazing tool! It is exactly what I have been looking for!

I am trying to set up Firefox to launch by default via Vopono.
I therefore modified my firefox.desktop file and replaced:

Exec=firefox %u

with

Exec=/usr/bin/vopono exec --provider mullvad --server uk firefox %u

But when launching the app through the (Gnome) launcher, Firefox doesn't start.
ps aux | grep firefox, vopono list or journalctl -f _COMM=firefox don't show anything.
The only sign of any activity is:

$ journalctl -f _COMM=vopono
Nov 10 23:10:25 pc firefox.desktop[759032]:  2023-11-10T23:10:25.156Z INFO  vopono_core::util > Calling sudo for elevated privileges, current user will be used as default user

and nothing else.

In contrast, when running vopono exec --provider mullvad --server uk firefox via the CLI it all works perfectly.

If anyone has some advice or can help, I would be very grateful, thank you.


EDIT:

I did manage to get a few more error logs:

Nov 10 23:30:19 pc firefox.desktop[776273]:  2023-11-10T23:30:19.760Z INFO  vopono_core::util > Calling sudo for elevated privileges, current user will be used as default user
Nov 10 23:30:19 pc firefox.desktop[776311]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Nov 10 23:30:22 pc firefox.desktop[776311]: sudo: a password is required
@jamesmcm
Copy link
Owner

Hey,

It seems the issue is that it expects the password over stdin, but can't get it when there is no terminal.

See: https://stackoverflow.com/questions/21659637/how-to-fix-sudo-no-tty-present-and-no-askpass-program-specified-error

So try either setting your user to NOPASSWD for sudo, so you can escalate privileges with no password, or set up an askpass program that sudo will use to request the password via a GUI.

@Lcchy
Copy link
Author

Lcchy commented Nov 14, 2023

Oh I see thanks! I did not realize vopono needed sudo rights to run as my terminal was already logged in when testing it.
Adding the line Terminal=true to the .desktop made it possible to run, but the prompt for a sudo password each time I open Firefox makes the UX a bit difficult.

I will refer to #189 to see if an alternative way is possible. Thanks again!

@Lcchy Lcchy closed this as completed Nov 14, 2023
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

2 participants