Development/Tutorials/Desktop File: Difference between revisions
(what does this have to do with my project) |
No edit summary |
||
Line 36: | Line 36: | ||
== Your project == | == Your project == | ||
In your project you need to take care the .desktop file is distributed to the appropriate place. | In your project you need to take care the .desktop file is distributed to the appropriate place. | ||
=== qmake based projects === | |||
In case you are working on a qmake based project, add the following to your .pro file: | In case you are working on a qmake based project, add the following to your .pro file: | ||
'''target.path = /usr/local/bin''' | '''target.path = /usr/local/bin''' | ||
Line 44: | Line 46: | ||
Note that the bold strings above should be in your project anyway. | Note that the bold strings above should be in your project anyway. | ||
An example .pro file can be found [https://github.com/tstaerk/quickpen/blob/dc7a5560b0cbac159d1c443572c676ee7d8fbb23/quickpen.pro here]. The related .desktop file can be found [https://github.com/tstaerk/quickpen/blob/e3b03c5949085e87a659303ae7866378f6539542/quickpen.desktop here]. | |||
=== cmake based projects === | |||
[[Category:Programming]] | [[Category:Programming]] | ||
[[Category:Tutorial]] | [[Category:Tutorial]] | ||
[[Category:FAQs]] | [[Category:FAQs]] |
Revision as of 16:32, 9 September 2011
Development/Tutorials/Desktop File
Languages: عربي | Asturianu | Català | Česky | Kaszëbsczi | Dansk | Deutsch | English | Esperanto | Español | Eesti | فارسی | Suomi | Français | Galego | Italiano | 日本語 | 한국어 | Norwegian | Polski | Português Brasileiro | Română | Русский | Svenska | Slovenčina | Slovenščina | српски | Türkçe | Tiếng Việt | Українська | 简体中文 | 繁體中文
Tutorial Series | Basics |
Previous | Session Management |
What's Next | |
Further Reading | the .desktop Free Desktop Spec; |
Desktop File
In order for your application to show up in menus and/or to be automatically associated with mime types in file browsers, you need to provide a .desktop file like follows:
[Desktop Entry]
Type=Application
Exec=your-app %u
MimeType=application/x-your-mime-type;
Icon=some-icon
X-DocPath=yourapp/index.html
Terminal=false
Name=Your App
GenericName=Some Generic Name
Comment=Short Description Of Your App
Categories=Qt;KDE;
Take a look at the .desktop Free Desktop Spec to find our more about the key/value pairs above. It's important to pick a good set of Categories, see the spec for a list of valid values.
Your project
In your project you need to take care the .desktop file is distributed to the appropriate place.
qmake based projects
In case you are working on a qmake based project, add the following to your .pro file:
target.path = /usr/local/bin desktop.path = /usr/share/applications desktop.files += your-app.desktop
INSTALLS += target desktop
Note that the bold strings above should be in your project anyway.
An example .pro file can be found here. The related .desktop file can be found here.