From: jordan e. <je...@gm...> - 2014-06-14 00:18:26
|
I've created a PyGi 'screenwriting/comic book scriptwriting' application that creates documents with the extension ".story". I want make it installable on Lubuntu specifically. (I will briefly tell you how I've installed my app in that really is the issue.) __________________________________________________________________________________ HOW I INSTALLED MY APP __________________________________________________________________________________ (1) PyGi Modules I have copied my PyGi application folder to /opt/ I have a bash script in /usr/bin that lauches the script and sends a filePath (a story document) as the first arguement: python /opt/Story/modules/story.py $1 (2) Desktop Entry I copy a Deskop Entry file with these contents to /usr/share/applications/: [Desktop Entry] Exec=story %f Icon=story Terminal=false Type=Application Categories=Office;WordProcessor;GNOME;GTK;X-Red-Hat-Base; StartupNotify=true MimeType=application/x-story Name=Story GenericName=Scriptwriter Comment=Compose, edit, and view scripts (3) Application Icon I copy my icon to /usr/share/icons cp story.png /usr/share/icons __________________________________________________________________________________ At this point I can see my desktop shortcut with it's icon. When I click on it, my application launches fine. On the command line, if I type: story myScreenplayDocument.story ...it does open the document fine. Now, what I am looking are commands that I can put in an 'insallation script' that will create two things: (1) I want a double click on a pcmanfm icon that represent a ".story" file and launch the 'story' app. (2) I want all files with extension ".story" to have the icon of my choice. I've found these steps online to follow, but they don't work. Where am I going wrong? __________________________________________________________________________________ ADD MIME TYPE, FIRST TRY __________________________________________________________________________________ (1) I open mime.types: gksudo leafpad /etc/mime.types (2) Copy the following text at the end of the file: text/story story __________________________________________________________________________________ I save mime.types and close leafpad. I then double click a ".story" file. leafpad opens it, not "story" app. I'm assuming the above step was supposed to take care of that. So, I try a second method: __________________________________________________________________________________ ADD MIME TYPE, SECOND TRY __________________________________________________________________________________ (1) I create the following xml with these contents: <?xml version="1.0" encoding="UTF-8"?> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="application/x-story"> <comment>Example file type </comment> <magic priority="50"> <match value="search-string" type="string" offset="10:140"/> </magic> <glob pattern="*.story"/> </mime-type> </mime-info> (2) I save it at this path: /usr/share/mime/application/story.xml (3) I run this command: sudo update-mime-database /usr/share/mime __________________________________________________________________________________ No errors with command in step (3) above. I try to open a ".story" document. leafpad is launched instead of 'story' app. I log out and back in. Still, leafpad opens it. __________________________________________________________________________________ ADD ICON __________________________________________________________________________________ (1) I create a simple black star with Inkscape, set it's width and height to the star object, then export as svg with this name: text-x-story.svg (2) I run the following two commands: sudo cp text-x-story.svg /usr/share/icons/gnome/scalable/mimetypes sudo gtk-update-icon-cache-3.0 I get this output: gtk-update-icon-cache-3.0: Cache file created successfully. __________________________________________________________________________________ I log out and back in. The Story Icon does not show up for the ".story" extension document in pcmanfm. What the heck is going on? |