[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

xdg integration



I just found myself setting up for someone emacs-w3m integration with
the xdg free-desktop standard, so that emacs-w3m would become the
default browser for all gui clicks, across all gui programs, for all
desktops that comply with the free-desktop standard.

What I did was:

1] Copy the attached file as
   ~/.local/share/applications/emacs-w3m.desktop

2] Run
   xdg-settings set default-web-browser emacs-w3m.desktop

Note that the exec line in the .desktop file required trimming
occurrences of single quotes, because xdg-open is 'helpful' that way in
wrapping urls in a way emacs-w3m won't properly parse.

Is this the optimal solution? Does it work in all cases? If so, it
should be documented somewhere, preferably in the project internal
documentation, and somewhere on the internet.

My plan is to add it to the emacs-wiki page(s) for the project, so if
this is wrong or sub-optimal, either let me know or just perform the
edit there.


-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0
[Desktop Entry]
Name=emacs-w3m
GenericName=Emacs Web Browser
X-GNOME-FullName=Emacs w3m Web Browser

Encoding=UTF-8
Version=1.0
Comment=Using emacsclient
NoDisplay=true

# Exec=firefox-esr %u
Exec=emacsclient --eval "(browse-url (replace-regexp-in-string \"'\" \"\" \"%u\"))"

Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox-esr
Categories=Network;WebBrowser;
StartupWMClass=Firefox-esr
StartupNotify=true
MimeType=x-scheme-handler/unknown;x-scheme-handler/about;text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;