A news item about GLIB 2.28 upgrade on 2011-04-27 tells non-GNOME users to configure ~/.local/share/applications/mimeapps.list to set-up default browser and mailer, but those setting are ignored by xdg-open. Same if I defined them in ~/.local/share/applications/defaults.list or using xdg-mime default <app>.desktop x-scheme-handler/{http{,s},mailto} I recently decided to change from firefox/thunderbird to seamonkey as my default web browser and mailer, but I want to keep firefox for web development purposes Reproducible: Always Steps to Reproduce: 1. Have firefox installed, and another browser (chromium, seamonkey...) 1. Change the default browser using xdg-mime default seamonkey.desktop x-scheme-handler/http (or whatever browser that is not firefox), or edit $XDH_DATA_HOME/applications/mimetypes.list 2. Ensure that BROWSER is unset in the current environment 3. issue $ xdg-open http://www.gentoo.org/ Actual Results: Firefox is launched, and my settings are ignored Expected Results: Seamonkey is launched (or a new tab is opened if it was already running). Current configuration: Hand written $XDG_DATA_HOME/applications/mimeapps.list: [Added Associations] x-scheme-handler/http=seamonkey.desktop; x-scheme-handler/https=seamonkey.desktop; x-scheme-handler/mailto=seamonkey.desktop; xdg-mime generated $XDG_DATA_HOME/applications/defaults.list [Default Applications] x-scheme-handler/http=seamonkey.desktop x-scheme-handler/https=seamonkey.desktop x-scheme-handler/mailto=seamonkey.desktop strace-ing xdg-open shows that those two files are never read, and reading the xdg-open script shows that "xdg-mime query" is only used for file mime-types, not URI handlers. A workaround is to export BROWSER=seamonkey in my environment, but then there is no interest in defining default uri handlers through xdg-mime. $ emerge --info --ignore-default-opts =x11-misc/xdg-utils-1.1.0_rc1-r1 Portage 2.2.0_alpha31 (default/linux/x86/10.0/desktop, gcc-4.5.2, glibc-2.11.3-r0, 2.6.37-gentoo-r4 i686) ================================================================= System Settings ================================================================= System uname: Linux-2.6.37-gentoo-r4-i686-Intel-R-_Core-TM-2_Duo_CPU_T8100_@_2.10GHz-with-gentoo-2.0.2 Timestamp of tree: Sun, 08 May 2011 12:15:01 +0000 ccache version 2.4 [disabled] app-shells/bash: 4.1_p9 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.7.1-r1, 3.1.3-r1 dev-util/ccache: 2.4-r9 dev-util/cmake: 2.8.4-r1 sys-apps/baselayout: 2.0.2 sys-apps/openrc: 0.8.2-r1 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.13, 2.65-r1 sys-devel/automake: 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.5.2 sys-devel/gcc-config: 1.4.1-r1 sys-devel/libtool: 2.2.10 sys-devel/make: 3.81-r2 sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers) sys-libs/glibc: 2.11.3 Repositories: gentoo mozilla emacs lisp bitcoin fulax Installed sets: @system ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="* -@EULA" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=i686 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=i686 -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--alphabetical --keep-going --verbose" FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms sign split-elog split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://gentoo.osuosl.org/" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu" LINGUAS="en en_US" MAKEOPTS="--jobs=3 --load-average=3.5" PKGDIR="/usr/portage/packages" PORTAGE_COMPRESS="xz" PORTAGE_COMPRESS_FLAGS="-9" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/mozilla /var/lib/layman/emacs /var/lib/layman/lisp /var/lib/layman/bitcoin /home/cnicolas/DEV/gentoo/fulax-gentoo-overlay" SYNC="rsync://spiti.fulax.fr/gentoo-portage" USE="X a52 aac aalib acl acpi alsa amr apache2 apm archive automount bash-completion berkdb bluetooth branding bzip2 cairo caps cdda cddb cdio cdr cli consolekit cracklib crypt cups curl cvs cxx dbus dia directfb dri dts dv dvd dvdr emacs emboss enca encode exif fam fbcon ffmpeg firefox flac fortran ftp fuse gdbm gdu gif git gnome gnome-keyring gnutls gpg gstreamer gtk gzip iconv icu id3 idn imap ipv6 java java6 javascript jbig jpeg latex lcms ldap libcaca libnotify libwww live lm_sensors lua lzma lzo mad mercurial mmx mng modules mp3 mp4 mpeg mudflap musepack mysql mysqli nautilus ncurses network-cron nforce2 nls nptl nptlonly nss ogg openal opengl openmp oss oss4 pam pango pcre pdf perl pmu png pnm policykit ppds pppd python qt3 qt3support qt4 quicktime radio rar readline rtc samba sasl schroedinger sdl session smp speex spell sql sqlite sqlite3 sse sse2 ssl ssse3 startup-notification subversion suexec svg svga sysfs system-sqlite tcl tcpd tga theora threads tiff tk truetype udev unicode usb v4l2 vidix vorbis webkit wifi win32codecs wmf x264 x86 xanim xcb xft xml xorg xulrunner xv xvid xvmc zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386" QEMU_USER_TARGETS="i386" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS ================================================================= Package Settings ================================================================= x11-misc/xdg-utils-1.1.0_rc1-r1 was built with the following: USE="-doc"
From upstream ChangeLog, 2011-04-08 Rex Dieter <rdieter@fedoraproject.org> * xdg-mime: add mimeapps.list support. Thanks to Chris Coulson. From Gentoo ChangeLog, *xdg-utils-1.1.0_rc1_p20110519 (19 May 2011) 19 May 2011; Samuli Suominen <ssuominen@gentoo.org> +xdg-utils-1.1.0_rc1_p20110519.ebuild: New snapshot. Reopen the bug if this doesn't solve the problem.
(In reply to comment #1) > From upstream ChangeLog, > > 2011-04-08 Rex Dieter <rdieter@fedoraproject.org> > * xdg-mime: add mimeapps.list support. Thanks to Chris Coulson. > Reopen the bug if this doesn't solve the problem. Thanks Samuli for this bump. It does work well for local files, but still not for x-scheme-handler/*. I will report it upstream if nobody did already. Here are some traces, where one can see that chromium-browser-chromium.desktop is never read while emacs.desktop is. cnicolas@sita ~ $ xdg-mime query default text/plain emacs.desktop cnicolas@sita ~ $ xdg-mime query default x-scheme-handler/http chromium-browser-chromium.desktop cnicolas@sita ~ $ strace /usr/bin/xdg-open file:///home/cnicolas/tp7.scm 2>&1 | egrep "^(open|stat|faccessat|read)" open("/etc/ld.so.cache", O_RDONLY) = 3 open("/lib/libncurses.so.5", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\256\0\0004\0\0\0"..., 512) = 512 open("/lib/libdl.so.2", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\n\0\0004\0\0\0"..., 512) = 512 open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0po\1\0004\0\0\0"..., 512) = 512 open("/dev/tty", O_RDWR|O_NONBLOCK|O_LARGEFILE) = 3 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3 open("/proc/meminfo", O_RDONLY) = 3 read(3, "MemTotal: 2054984 kB\nMemF"..., 1024) = 1024 stat64("/home/cnicolas", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3 open("/usr/bin/xdg-open", O_RDONLY|O_LARGEFILE) = 3 read(3, "#!/bin/sh\n#---------------------"..., 80) = 80 read(255, "#!/bin/sh\n#---------------------"..., 8192) = 8192 read(255, " <= 3.5.4\n# It also always retur"..., 8192) = 5469 read(3, "", 128) = 0 read(255, "\nif [ x\"$DE\" = x\"\" ]; then\n D"..., 8192) = 630 read(3, "/home/cnicolas/tp7.scm", 128) = 22 read(3, "", 128) = 0 stat64("/home/cnicolas/tp7.scm", {st_mode=S_IFREG|0644, st_size=4242, ...}) = 0 faccessat(AT_FDCWD, "/home/cnicolas/tp7.scm", R_OK) = 0 read(3, "text/plain\n", 128) = 11 read(3, "", 128) = 0 read(3, "emacs.desktop\n", 128) = 14 read(3, "", 128) = 0 read(3, "/home/cnicolas/.local/share /usr"..., 128) = 56 read(3, "", 128) = 0 faccessat(AT_FDCWD, "/home/cnicolas/.local/share/applications/emacs.desktop", R_OK) = -1 ENOENT (No such file or directory) faccessat(AT_FDCWD, "/usr/local/share/applications/emacs.desktop", R_OK) = -1 ENOENT (No such file or directory) faccessat(AT_FDCWD, "/usr/share/applications/emacs.desktop", R_OK) = 0 read(3, "/usr/bin/emacs\n", 128) = 15 read(3, "", 128) = 0 read(3, "/usr/bin/emacs\n", 128) = 15 read(3, "", 128) = 0 faccessat(AT_FDCWD, "/usr/bin/emacs", X_OK) = 0 cnicolas@sita ~ $ strace /usr/bin/xdg-open http://localhost/cnicolas/tp7.scm 2>&1 | egrep "^(open|stat|faccessat|read)" open("/etc/ld.so.cache", O_RDONLY) = 3 open("/lib/libncurses.so.5", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\256\0\0004\0\0\0"..., 512) = 512 open("/lib/libdl.so.2", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\n\0\0004\0\0\0"..., 512) = 512 open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0po\1\0004\0\0\0"..., 512) = 512 open("/dev/tty", O_RDWR|O_NONBLOCK|O_LARGEFILE) = 3 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3 open("/proc/meminfo", O_RDONLY) = 3 read(3, "MemTotal: 2054984 kB\nMemF"..., 1024) = 1024 stat64("/home/cnicolas", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3 open("/usr/bin/xdg-open", O_RDONLY|O_LARGEFILE) = 3 read(3, "#!/bin/sh\n#---------------------"..., 80) = 80 read(255, "#!/bin/sh\n#---------------------"..., 8192) = 8192 read(255, " <= 3.5.4\n# It also always retur"..., 8192) = 5469 read(3, "", 128) = 0 read(255, "\nif [ x\"$DE\" = x\"\" ]; then\n D"..., 8192) = 630 read(3, "firefox", 128) = 7 read(3, "", 128) = 0 stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat64("/home/cnicolas/bin/firefox", 0xffa71d60) = -1 ENOENT (No such file or directory) stat64("/usr/local/bin/firefox", 0xffa71d60) = -1 ENOENT (No such file or directory) stat64("/usr/bin/firefox", {st_mode=S_IFREG|0755, st_size=38368, ...}) = 0 stat64("/usr/bin/firefox", {st_mode=S_IFREG|0755, st_size=38368, ...}) = 0 stat64("/usr/bin/firefox", {st_mode=S_IFREG|0755, st_size=38368, ...}) = 0 stat64("/usr/bin/firefox", {st_mode=S_IFREG|0755, st_size=38368, ...}) = 0 stat64("/usr/bin/firefox", {st_mode=S_IFREG|0755, st_size=38368, ...}) = 0 stat64("/usr/bin/firefox", {st_mode=S_IFREG|0755, st_size=38368, ...}) = 0
Finally fixed upstream in HEAD by the following commit: http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=5010c394ca7dd443cefd63b764687f98c2353577
(In reply to comment #3) > Finally fixed upstream in HEAD by the following commit: > http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=5010c394ca7dd443cefd63b764687f98c2353577 indeed, finally :) sorry it took so long from our part, but I seriously dislike custom patching xdg-utils as it can get scripts spagetti in a heartbeat. +*xdg-utils-1.1.0_rc1_p20111003 (03 Oct 2011) + + 03 Oct 2011; Samuli Suominen <ssuominen@gentoo.org> + +xdg-utils-1.1.0_rc1_p20111003.ebuild: + New snapshot for solving bugs #367993 (x-scheme-handler) and #374015 + (bashism). Thanks to Cyprien Nicolas, Naohiro Aota and "Faustus".