linux - Ubuntu custom URL protocol handler -
i want ask question, first show files
<html> <body> <a href="cloudje:firefox">open firefox</a> </body> </html>
my .desktop file:
[desktop entry] encoding=utf-8 version=1.0 type=application terminal=false exec=/usr/bin/cloudjerun -c gedit name[en_us]=gedit comment[en_us]=small, easy-to-use program access itunesu media name=tunesviewer comment=small, easy-to-use program access itunesu media icon=/usr/share/icons/hicolor/scalable/apps/tunesview.svg categories=application;network; mimetype=x-scheme-handler/cloudje; comment[en_us.utf8]=small, easy-to-use program access itunesu media
tutorial: http://jarrpa.net/2011/10/28/creating-custom-url-handlers-in-ubuntu-11-04-11-10-gnome-3-0/
ok, cool. .desktop file placed in /usr/share/applications. if execute command 'xdg-open cloudje:firefox' or 'xdg-open cloudje:example', execute gedit using python script named 'cloudjerun'. how can execute firefox using command 'xdg-open cloudje:firefox'?
do need replace 'exec=/usr/bin/cloudjerun -c gedit' 'exec=/usr/bin/cloudjerun -c %u' or 'exec=/usr/bin/cloudjerun -c %s' or something?
thanks, amanush.
in desktop file following parameters possible exec
add... accepts... %f single filename. %f multiple filenames. %u single url. %u multiple urls. %d single directory. used in conjunction %f locate file. %d multiple directories. used in conjunction %f locate files. %n single filename without path. %n multiple filenames without paths. %k uri or local filename of location of desktop file. %v name of device entry.
so in case can adjust exec entry described following:
exec=/usr/bin/cloudjerun -c %u
note though %u complete uri e.g. when run xdg-open cloudje:firefox %u cloudje:firefox. easiest assume adjust cloudjerun python script removing first part of uri before running it.
Comments
Post a Comment