Last active
December 15, 2015 19:19
-
-
Save alseambusher/5310089 to your computer and use it in GitHub Desktop.
open_with_script.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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