LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-18-2012, 06:23 AM   #1
akamikeym
Member
 
Registered: May 2008
Posts: 112

Rep: Reputation: 21
XDG MIME type for .desktop file?


Hi, I'm trying to find out if there's a mime type for .desktop files themselves? I'm trying to create a file dialogue for selecting a .desktop file and I'm failing to find info on this. Thanks for your help.
 
Old 09-18-2012, 09:53 AM   #2
kabamaru
Member
 
Registered: Dec 2011
Location: Greece
Distribution: Slackware
Posts: 276

Rep: Reputation: 134Reputation: 134
Well,
Code:
xdg-mime query filetype /usr/share/applications/xterm.desktop
returns
Code:
text/plain; charset=us-ascii
That said, I did a
Code:
grep -R '*.desktop' /usr/share/mime/*
Output:
Code:
/usr/share/mime/application/x-desktop.xml:  <glob pattern="*.desktop"/>
/usr/share/mime/globs:application/x-desktop:*.desktop
/usr/share/mime/globs2:50:application/x-desktop:*.desktop
/usr/share/mime/packages/freedesktop.org.xml:    <glob pattern="*.desktop"/>
Don't know if that helps.
 
Old 09-19-2012, 09:28 AM   #3
akamikeym
Member
 
Registered: May 2008
Posts: 112

Original Poster
Rep: Reputation: 21
That application/x-desktop looks promising. I've been rewriting my code to use an optional pattern i.e. *.desktop as well as mime types.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xdg-mime file type halj Linux - Software 0 08-17-2011 01:53 PM
Getting Content-type/Mime type of the file using shellscript swathikumar Linux - Newbie 9 05-24-2011 11:48 PM
xdg-mime linuxsavar Programming 0 10-10-2008 07:25 AM
Get file icon from extension, file type, or mime-type Guitarist88 Programming 3 04-21-2008 10:58 AM
How do you get the mime type of a file using C++ in KDE? ManuPeng Programming 2 04-02-2007 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration