Summary: | x11-misc/xdg-utils: `xdg-open` only supports "major" Desktop Environments | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Ralf Treu <smuf> |
Component: | Current packages | Assignee: | Freedesktop bugs <freedesktop-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | andrey.prok, ankh_symbool, leho |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
patch as own file
xdg-utils-1.0.2_p20100618.ebuild.patch xdg-utils-1.0.2_p20100618-mailcap.patch |
Description
Ralf Treu
2008-05-08 12:16:14 UTC
This should probably be submitted upstream. Others can benifit from it too. Also, attach patches (diff -u) instead of pasting them inline, please. Created attachment 152513 [details, diff]
patch as own file
(In reply to comment #1) > This should probably be submitted upstream. Others can benifit from it too. > I already sent it to Portland mailing list but got no answer. Hope one of the gentoo officials can submit it upstream and get an answer. *** Bug 252638 has been marked as a duplicate of this bug. *** I ran into this issue with google-chrome, it kept opening firefox for everything. I got this to work on non DE desktop. change xdg-open open_generic function to this: open_generic() { mimetype=`xdg-mime query filetype "$url"` opener=`xdg-mime query default $mimetype | xargs cat | grep Exec | cut -f 2 -d =` if [ -z "${opener}" ] ; then exit_failure_operation_impossible "no method available for opening '$url'" fi "$opener" "$url" } and add this script to add handlers for non DE desktops $ cat ./xdg-add-handler #!/bin/bash mimetype=`xdg-mime query filetype $2` name=$1 opener=`which $name` exit_failure_operation_impossible() { if [ $# -gt 0 ]; then echo "xdg-add-handler: $@" >&2 fi exit 3 } if [ -z "${opener}" ] ; then exit_failure_operation_impossible "no binary for name '$name'" fi if [ -z "${mimetype}" ] ; then exit_failure_operation_impossible "no mimetype for file '$2'" fi mkdir -p ~/.local/share/applications echo "[Desktop Entry] Exec=$opener MimeType=$mimetype; Name=$name NoDisplay=true Type=Application" > ~/.local/share/applications/$name.desktop xdg-mime default ~/.local/share/applications/$name.desktop $mimetype Also xdg-open only supports run-mailcap on debian systems (the script is pretty messed up imho). app-misc/run-mailcap is pretty safe default when no specific DE is running, (better than trying every browser it knows, which is what it does now), so I suggest pulling it as dependency by default. I created edited ebuild and patch for xdg-open, which pulls app-misc/run-mailcap on mime use-flag. Created attachment 245841 [details, diff]
xdg-utils-1.0.2_p20100618.ebuild.patch
patch xdg-open to allow run-mailcap and +mime use flag
Created attachment 245842 [details, diff]
xdg-utils-1.0.2_p20100618-mailcap.patch
patch for the xdg-utils-1.0.2_p20100618.ebuild.patch
This needs to be reported upstream. For the foreseen future, the maintaince of this package is creating snapshots from upstream version control, that's it. Actually, it does (also) have a fallback to mimeopen, which is provided in the dev-perl/File-MimeInfo package in portage. I only found out about this because someone mentioned this in a comment on a support ticket for mendeleydesktop, which uses xdg-open to open pdf files externally. I also found an extensive discussion on the LyX mailing list on this same issue (http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg133878.html starts the thread) which has a reference to the bugreport that included the mimeopen support (https://bugs.freedesktop.org/show_bug.cgi?id=13953). By the way, this issue apparently also occurs when using xdg-open over X-forwarding ssh, see https://bugs.freedesktop.org/show_bug.cgi?id=9822. I actually came here to complain about the fact that the File-MimeInfo package is listed as an (optional) dependency for this package. Even after finding out the script also calls "mimeopen", it cost me some time to find out which package provides this program. (In reply to comment #11) > I actually came here to complain about the fact that the File-MimeInfo package > is listed as an (optional) dependency for this package. Even after finding out > the script also calls "mimeopen", it cost me some time to find out which > package provides this program. > Re-reading my own comment, this sounds a bit harsh. I meant "complain" in a ironic way, but text-only is not a good medium to convey that. Please don't take my comment as criticism, I only wanted to point out something that I found was missing in my user experience :) This should be now solved by xdg-utils-1.1.0_rc1-r1 ( which includes fix for https://bugs.freedesktop.org/show_bug.cgi?id=13953 ) This problem still seems to exist in xdg-utils 1.1.0_rc1_p20110329. When running fluxbox the behavior with chromium-browser remains the same (tries to open all files in firefox). If this is a different problem from the one in this thread then I would happily open a new bug. that's different bug. the browser needs to have x-scheme-handler/http; and x-scheme-handler/https; in it's .desktop file to get recognized as a real browser. (In reply to comment #15) > that's different bug. > > the browser needs to have x-scheme-handler/http; and x-scheme-handler/https; in > it's .desktop file to get recognized as a real browser. and then you could (or should?) have ~/.local/share/applications/mimeapps.list replace foobar with yours... [Added Associations] x-scheme-handler/http=foobar.desktop x-scheme-handler/https=foobar.desktop and the file could continue like... for some older types... application/x-extension-htm=foobar.desktop; application/x-extension-html=foobar.desktop; application/x-extension-shtml=foobar.desktop; application/xhtml+xml=foobar.desktop; application/x-extension-xhtml=foobar.desktop; application/x-extension-xht=foobar.desktop; [Default Applications] text/html=foobar.desktop application/x-extension-htm=foobar.desktop application/x-extension-html=foobar.desktop application/x-extension-shtml=foobar.desktop application/xhtml+xml=foobar.desktop application/x-extension-xhtml=foobar.desktop application/x-extension-xht=foobar.desktop (In reply to comment #15) > that's different bug. > > the browser needs to have x-scheme-handler/http; and x-scheme-handler/https; in > it's .desktop file to get recognized as a real browser. and if it's missing, it's a bug in said browser (In reply to comment #14) > This problem still seems to exist in xdg-utils 1.1.0_rc1_p20110329. When > running fluxbox the behavior with chromium-browser remains the same (tries to > open all files in firefox). If this is a different problem from the one in this > thread then I would happily open a new bug. is this a good place to ask why: $ xdg-open --version xdg-open 1.1.0 rc1 530 BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER doesn't include firefox-bin, at least as a gentoo patch? (In reply to comment #18) > (In reply to comment #14) > > This problem still seems to exist in xdg-utils 1.1.0_rc1_p20110329. When > > running fluxbox the behavior with chromium-browser remains the same (tries to > > open all files in firefox). If this is a different problem from the one in this > > thread then I would happily open a new bug. > > is this a good place to ask why: > > $ xdg-open --version > xdg-open 1.1.0 rc1 > > 530 > BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER > > doesn't include firefox-bin, at least as a gentoo patch? The firefox-bin package has different command for running firefox? Intresting. But ... Note that the hardcoded list isn't used at all if you have properly setupped the default browser like sain in Comment #16, the dev-perl/File-MimeInfo depend was added for that, it should read the mime and get the browser from there, even firefox-bin. So the hardcoded list is only a fallback list, but feel free to open a new bug for it anyway |