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

Use desktop-file-install To Install Launcher #29

Open
JavaScriptDude opened this issue Aug 19, 2021 · 0 comments
Open

Use desktop-file-install To Install Launcher #29

JavaScriptDude opened this issue Aug 19, 2021 · 0 comments

Comments

@JavaScriptDude
Copy link

The method of deploying desktop files did not work on my Ubuntu 20.04 system.

I updated the install script to use desktop-file-install to deploy the my desktop files as documented in ArchWiki. The advantage of using desktop-file-install is that Gnome and possibly other XDG based systems will detect the file without the need for logout or reboot.

FYI, here is my updated installer:

#!/bin/bash

# install dependencies

if ! [ -z `which apt-get 2> /dev/null` ] && [ `nmcli networking` = "enabled" ] ; # Debian
then sudo apt-get install network-manager-openvpn network-manager-openvpn-gnome
fi

if ! [ -z `which dnf 2> /dev/null` ] && [ `nmcli networking` = "enabled" ]; # Fedora
then sudo dnf install NetworkManager-openvpn NetworkManager-openvpn-gnome
fi

if ! [ -z `which pacman 2> /dev/null` ] && [ `nmcli networking` = "enabled" ]; # Arch Linux
then sudo pacman -Sy networkmanager-openvpn
fi

current_dir=`pwd`

echo "[Desktop Entry]
Type=Application
Name=Nord VPN
Comment=NordVPN client
Path="$current_dir"/NordVPN
Exec="$current_dir"/NordVPN/launch_nord
Icon=nordvpnicon
Terminal=false
Categories=System" | sudo tee ./nordvpn.desktop > /dev/null

sudo chmod +x ./nordvpn.desktop

cp ./NordVPN/nordvpnicon.png $HOME/.local/share/icons/

desktop-file-install --dir=$HOME/.local/share/applications ./nordvpn.desktop

echo NordVPN-NetworkManager-Gui launcher installed in '~'/.local/share/applications

Notes:

  • Version is the XDG version not the software version and was causing error
  • Updated Categories to only include System as others were flagged as invalid
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

1 participant