Skip to content

Instantly share code, notes, and snippets.

@alseambusher
Last active December 15, 2015 19:19
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 alseambusher/5310089 to your computer and use it in GitHub Desktop.
Save alseambusher/5310089 to your computer and use it in GitHub Desktop.
open_with_script.sh
#!/bin/bash
echo -n "Enter Application name:"
read Name
if [ "$Name" = "" ]
then
echo "ERROR: Application name can't be empty"
exit 1
fi
echo -n "Comment about Application:"
read Comment
echo -n "Exec (eg: java -jar /home/alse/somescript.jar %U):"
read Exec
echo -n "MimeType (eg:application/xml):"
read Mimetype
if [ "$Exec" = "" ]
then
echo "ERROR: Exec can't be empty"
exit 1
fi
echo "
[Desktop Entry]
Name=$Name
GenericName=$Name
Comment=$Comment
Exec=$Exec
Terminal=false
Type=Application
StartupNotify=true
MimeType=$MimeType
Categories=GNOME;GTK;Utility;
X-GNOME-FullName=$Name
Actions=Window;Document;
X-Ubuntu-Gettext-Domain=$Name
[Desktop Action Window]
Name=Open a New Window
Exec=$Exec
OnlyShowIn=Unity;
[Desktop Action Document]
Name=Open a New Document
Exec=$Exec
OnlyShowIn=Unity;">~/.local/share/applications/$Name.desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment