linux-app
linux-app copied to clipboard
How to start ProtonVPN minimized on tray on startup?
We are happy to answer your questions about the code or discuss technical ideas.
Please complete the following checklist (by adding [x]):
- [ x] I have searched open and closed issues for duplicates
- [ x] This isn't a feature request
- [ x] This is not a report about my app not working as expected
I'm searching for a graphical or command-line solution to start ProtonVPN on startup but minimized on the tray. It doesn't need to connect to VPN, but I just want it to start and show the tray icon on startup. How is it possible?
Here are some alternatives: https://github.com/ProtonVPN/linux-app/issues/4. Linux app autostart to tray is obviously planned. But a solution is to use linux-cli to start ProtonVPN automatically. I can't get the systemd alternative to work. But it also includes the graphical Linux app.
My best solution, using Ubuntu 20.04, are to start it in ~/.config/autostart and my script including:
#!/bin/bash
sleep 20
# Kill switch
protonvpn-cli ks --off
protonvpn-cli ks --on
# Netshield
protonvpn-cli ns --off
protonvpn-cli ns --malware
# Start VPN
protonvpn-cli c -f
Regards
Here are some alternatives: #4. Linux app autostart to tray is obviously planned. But a solution is to use linux-cli to start ProtonVPN automatically. I can't get the systemd alternative to work. But it also includes the graphical Linux app.
My best solution, using Ubuntu 20.04, are to start it in ~/.config/autostart and my script including:
#!/bin/bash sleep 20 # Kill switch protonvpn-cli ks --off protonvpn-cli ks --on # Netshield protonvpn-cli ns --off protonvpn-cli ns --malware # Start VPN protonvpn-cli c -f
Regards
Would the appropriate way to implement this script be to save it as a .desktop file in one's autostart folder?
Yes, as I said above "start it in ~/.config/autostart".
Would the appropriate way to implement this script be to save it as a .desktop file in one's autostart folder?
I don't think that will work. Saving it as an executable script may work in some DE, but that may change in future. Regardless, it is better to do it "properly".
Save it in a file somewhere (in ~/.local/bin/
?) and make it executable (chmod 755 <file>
), and use that file's path in Exec
in a .desktop
file in ~/.config/autostart
. Refer to other .desktop
file in that directory for details and also read the spec [1].
[1] https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html
Yes, as I said above "start it in ~/.config/autostart".
Just curious: Which DE do you use? Does it run executable scripts in ~/.config/autostart
? Mine (XFCE) doesn't.
Save it in a file somewhere (in ~/.local/bin/?) and make it executable (chmod 755
), and use that file's path in Exec in a .desktop file in ~/.config/autostart. Refer to other .desktop file in that directory for details and also read the spec [1].
That is exactly what I mean. I thought it was obvious that it should be done that way. My script is saved in ~/bin directory.
no answer is related to the question
for others, who might not find it "obvious" (:roll_eyes:), here's all the steps you need to start the CLI connection to in the background on login. (no idea how to do it with the GUI minimized to tray though)
- create a script that will set up the connection and put it e.g. in ~/.local/bin/protonvpn-cli.sh`, and paste the following content:
#!/bin/bash
sleep 20
# Kill switch
protonvpn-cli ks --off
protonvpn-cli ks --on
# Netshield
protonvpn-cli ns --off
# or --malware if you don't want to block ads
protonvpn-cli ns --ads-malware
# Start VPN
protonvpn-cli c -f
-
chmod 755 protonvpn.sh
— make it executable - create a desktop startup entry in
~/.config/autostart/protonvpn-cli.desktop
:
[Desktop Entry]
Type=Application
Exec=~/.local/bin/protonvpn-cli.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_GB]=proton VPN CLI
Name=proton VPN CLI
Comment[en_GB]=
Comment=
for others, who might not find it "obvious" (roll_eyes), here's all the steps you need to start the CLI connection to in the background on login. (no idea how to do it with the GUI minimized to tray though)
- create a script that will set up the connection and put it e.g. in ~/.local/bin/protonvpn-cli.sh`, and paste the following content:
#!/bin/bash sleep 20 # Kill switch protonvpn-cli ks --off protonvpn-cli ks --on # Netshield protonvpn-cli ns --off # or --malware if you don't want to block ads protonvpn-cli ns --ads-malware # Start VPN protonvpn-cli c -f
chmod 755 protonvpn.sh
— make it executable- create a desktop startup entry in
~/.config/autostart/protonvpn-cli.desktop
:[Desktop Entry] Type=Application Exec=~/.local/bin/protonvpn-cli.sh Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name[en_GB]=proton VPN CLI Name=proton VPN CLI Comment[en_GB]= Comment=
The question is not about "how to use CLI" or "how to create a Desktop file" on Linux. The question is about "start ProtonVPN minimized on tray on startup (GUI)" If @ariyadey accepts a different answer, then @ariyadey should change the question.