LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-24-2009, 02:29 AM   #1
linuxsavar
Member
 
Registered: May 2007
Distribution: slackware
Posts: 34

Rep: Reputation: 15
adding program name to right-click menu


hi all
I wrote a program in linux.i built this file whit name ds3.xml for mime type:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
  <mime-type type="application/x-ds">
    <comment>ds3 file</comment>
    <glob pattern="*.ds"/>
  </mime-type>
</mime-info>
and ds3.desktop:
Code:
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=DS
Exec=/home/john/code/ds3/bin/Debug/ds3 %F
Icon=ds3.png
Terminal=true
X-MultipleArgs=false
Type=Application
Categories=Application;Network;
StartupNotify=true
MimeType=application/x-ds;
i want when i right-click on one file with ds extension "open with DS" appeared in menu.
what should i do.
thanks.
 
Old 03-24-2009, 09:31 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I assume this is KDE? Did you make sure the file type shows up in KInfoCenter under "Protocols"? If not, add it in KControlCenter. Once that's done, you can either add the action to the right-click menu in KControlCenter or by viewing properties of a file of that type and clicking on the tool button next to the type. I don't know exactly how to automate this, however. You might take a look at the desktop integration RPMs for OpenOffice and see how they register the file types. Also, you might have to add something to the file-magic system (man magic) so it doesn't mistake your program's files for e.g. a web page (even with the extension.)
Kevin Barry

Last edited by ta0kira; 03-24-2009 at 09:34 PM.
 
Old 07-28-2011, 03:19 PM   #3
linuxsavar
Member
 
Registered: May 2007
Distribution: slackware
Posts: 34

Original Poster
Rep: Reputation: 15
sudo update-desktop-database
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
left click on kubuntu desktop (on laptop) brings up middle click menu =S darksmiley Ubuntu 2 06-14-2008 05:37 PM
Adding an item to the KDE desktop right-click menu jkhg Linux - Desktop 2 11-28-2007 06:28 PM
adding program to k menu in SuSE using KDE? suicideguy Linux - Newbie 2 11-09-2006 12:18 AM
adding an element to KDE's default right-click menu dizzutch Linux - Software 0 11-30-2004 11:56 AM
adding icon to newly installed program in menu craigl Linux - General 2 09-29-2004 05:58 PM


All times are GMT -5. The time now is 04:08 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration