Does Geany or Gedit provide a browser protocol in the way Textmate does with txmt://?
it's possible to easily create new protocol handlers in Gnome, all you have to do is add some keys in gconf.
In a terminal, type:
gconftool-2 -s /desktop/gnome/url-handlers/foo/command '/path/to/app %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/foo/enabled --type Boolean true
Replace foo on both lines with the protocol you want to register and /path/to/app with the path to the application you want to run. (from : http://kb.mozillazine.org/Register_protocol#All_Firefox_versions )
The accepted answer does not work on 11.04.
Here's my solution for gedit on 11.04: http://rystraum.com/blog/2012/05/rails-footnotes-with-gedit/
TLDR; version:
-
Create
/usr/share/applications/foo-uri.desktop
:[Desktop Entry] Name=Foo GenericName=Foo Comment=Open foo links in Gedit TryExec=open_gedit Exec=open_gedit %u Terminal=false Type=Application MimeType=x-scheme-handler/foo NoDisplay=true
Run
sudo update-desktop-database
-
open_gedit
script inside location that is in $PATH#!/bin/bash FILE=$1 FILE=${FILE/foo\:\/\//} LINE=$(echo $FILE | grep -o "\&line=[0-9]\+") LINE=$(echo $LINE | grep -o "[0-9]\+") FILE=$(echo $FILE | grep -o "\(.\+\)\&") FILE=$(echo $FILE | cut -d'&' -f1) gedit +$LINE $FILE
Call as foo:///path/to/file&line=299