Skip to content

Instantly share code, notes, and snippets.

@J-Curragh
Created February 3, 2022 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save J-Curragh/08716aeaf73ad7a90382c1ba78276585 to your computer and use it in GitHub Desktop.
Save J-Curragh/08716aeaf73ad7a90382c1ba78276585 to your computer and use it in GitHub Desktop.
freedesktop.org desktop entry install script
#!/bin/sh
echo "Validating the desktop entry..."
desktop-file-validate $1
if [ $? -ne 0 ]; then
exit 1
fi
echo "The desktop entry has been validated."
echo "Installing desktop entry $(echo $1) to ~/.local/share/applications"
desktop-file-install --dir=$HOME/.local/share/applications $1
echo "Updating the desktop database..."
update-desktop-database ~/.local/share/applications
if [ $? -ne 0 ]; then
exit 1
fi
echo "The desktop database has been updated."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment