debian/0000775000000000000000000000000012122400746007166 5ustar debian/changelog0000664000000000000000000003024612122400746011045 0ustar xdg-utils (1.1.0~rc1-2ubuntu7) raring; urgency=low * Mark as Multi-Arch: foreign (Closes: #688681, LP: #1123710) -- Scott Ritchie Wed, 20 Mar 2013 19:37:26 +0100 xdg-utils (1.1.0~rc1-2ubuntu6) oneiric; urgency=low * Use D-Bus API for GNOME screensaver - debian/patches/xdg-screensaver-dbus.patch - LP: #805386 -- Daniel Hahler Mon, 03 Oct 2011 16:06:10 +0200 xdg-utils (1.1.0~rc1-2ubuntu5) oneiric; urgency=low * rename debian/patches/debian-changes-1.1.0~rc1-2ubuntu4 to lp779156-lubuntu.diff and make DEP-3 compliant. Correctly reference LP: #779156 so the bug gets auto-closed. -- Jamie Strandboge Wed, 13 Jul 2011 08:50:04 -0500 xdg-utils (1.1.0~rc1-2ubuntu4) oneiric; urgency=low * scripts/xdg-mime: - Fix detectDE to detect LXDE. - Create ~/.local/share/applications/mimeapps.list when needed in non-gnome/kde environments. * scripts/xdg-email: - Fix detectDE to detect LXDE. - Added open_lxde shell function, used when LXDE detected. - Added run_sylpheed function, used to call sylpheed (LP: 779156). -- Jonathan Marsden Sat, 07 May 2011 18:12:59 -0700 xdg-utils (1.1.0~rc1-2ubuntu3) natty; urgency=low * No-change rebuild to correct archive vs bzr tree delta: lp:~ubuntu-branches/ubuntu/natty/xdg-utils/natty-201104080911 -- Kees Cook Fri, 08 Apr 2011 13:13:57 -0700 xdg-utils (1.1.0~rc1-2ubuntu2) natty; urgency=low * Fix LP: #670128 - gnome-open uses firefox while it's not the preferred browser. Backport upstream changes to use the x-scheme-handler types for checking/setting the default browser/mail client in xdg-settings and xdg-email. In addition to this, we fix xdg-mime to get/set default mimetype handlers using the users mimeapps.list, rather than the defaults.list, which doesn't work anywhere - add debian/patches/gnome-3.0.diff - update debian/patches/series -- Chris Coulson Fri, 08 Apr 2011 02:00:05 +0100 xdg-utils (1.1.0~rc1-2ubuntu1) natty; urgency=low [ Martin Pitt ] * Add xdg-update-menu-caonicalize-defaults.list.diff: Don't overwrite a /usr/share/applications/defaults.list symlink. Thanks to Joel Ebel for the original patch! (LP: #703106) [ Scott Ritchie ] * debian/patches/xdg-generic-use-mimetype.diff: - Update to fallback to generic on Gnome (LP: #602799) -- Martin Pitt Wed, 30 Mar 2011 13:11:39 +0200 xdg-utils (1.1.0~rc1-2) unstable; urgency=low * Tag patches with upstream bug URLs. * Add patch xdg-mime-follow-symlinks.diff: Follow symlinks when querying MIME type in xdg-mime. * Add patch xdg-open-browser-multiword.diff: Fix support for multi-word $BROWSER commands. Closes: #612339. * Add patch xdg-open-printf.diff: Use /usr/bin/printf if available when decoding URLs. dash's printf doesn't understand \xHH sequences. Closes: #613272. -- Per Olofsson Sun, 20 Feb 2011 18:34:53 +0100 xdg-utils (1.1.0~rc1-1) unstable; urgency=low * New upstream release. * Drop patches included upstream: - xdg-email-mawk-support.diff - run-mailcap-decode.diff - xdg-open-spaces.diff * Add debian/source/local-options with option unapply-patches. * Recommend libfile-mimeinfo-perl instead of file, mime-support, shared-mime-info, www-browser. * Add patch xdg-mime-generic-use-mimetype.diff: Try mimetype first as the generic method for xdg-mime. Closes: #609630. * Add patch bashism.diff fixing some new bashisms. -- Per Olofsson Fri, 14 Jan 2011 09:45:41 +0100 xdg-utils (1.0.2+cvs20100307-3) unstable; urgency=low * debian/patches/xserver-blanking.diff: Support X server blanking in xdg-screensaver. Thanks to Ben Hutchings. Closes: #511248. * debian/patches/xdg-email-envvar.diff: Add $MAILER support to xdg-email. Thanks to Jonathan Nieder and Jan Braun for input. Info about this added to NEWS.Debian. Closes: #574131. * debian/patches/xdg-email-mutt-detect.diff: Fallback to mutt if ~/.muttrc exists. Thanks to Jan Braun. * Replace sensible-browser.diff with x-www-browser.diff. Instead of using sensible-browser, try x-www-browser as the first choice when $BROWSER is unset (and using generic method). This will approximate sensible-browser's behaviour. * Bump Standard-Version to 3.9.1. No changes. * debian/patches/xdg-open-spaces.diff: Support paths with spaces in open_generic_xdg_mime(). Thanks to Fabien Bochu. Closes: #592682. -- Per Olofsson Mon, 25 Oct 2010 10:42:32 +0200 xdg-utils (1.0.2+cvs20100307-2) unstable; urgency=low * Add patch xdg-email-mawk-support.diff: Fix bug in awk script in xdg-email so that it works with mawk. Closes: #589133. -- Per Olofsson Wed, 15 Sep 2010 13:06:41 +0200 xdg-utils (1.0.2+cvs20100307-1) unstable; urgency=low * Make a new upstream release from CVS. - Make xdg-open's open_generic() check for URLs before trying to open them with non-browsers. Closes: #571557. -- Per Olofsson Sun, 07 Mar 2010 12:59:45 +0100 xdg-utils (1.0.2+cvs20100223-1) unstable; urgency=low * Make a new upstream release from CVS. - Add gvfs-copy and gvfs-info support. Closes: 479578. - Add email attachments support to Thunderbird from xdg-email. Closes: #531850. - Add KDE 4 support to xdg-email. Closes: #555212. - Add dbus commands to xdg-screensaver for KDE 4. Closes: #557104. [ Per Olofsson ] * Use source format 3.0 (quilt). * Use dh override rules in debian/rules. Build-dep on debhelper 7.4.15. * Add ${misc:Depends} to make lintian happy. * Ack NMU. Closes: #508125. * Bump standards-version to 3.8.4. No changes. * Update Suggests to refer to GVfs and KDE4 packages for opening files, etc. * Remove libgtk2.0-bin and desktop-file-utils from Suggests. They are not interesting for users and are usually installed anyway. * Both kdebase-runtime and exo-utils are pretty much guaranteed to be installed if KDE or Xfce is installed. So don't suggest those. Keep gvfs-bin, however. * mimeopen doesn't work as it should, so don't use it. [ Fathi Boudra ] * Add myself to Uploaders field. * Remove debian/postinst and debian/postrm: they are not required. Closes: 566165. * Add xdg-settings to xdg-utils description. -- Per Olofsson Wed, 15 Jul 2009 11:35:01 +0200 xdg-utils (1.0.2-6.1) unstable; urgency=low * Non-maintainer upload. * debian/patches/fix-xdg-screensaver-race: Fix race condition which leads to process leak. Closes: #508125. -- Ben Hutchings Fri, 02 Jan 2009 17:47:19 +0000 xdg-utils (1.0.2-6) unstable; urgency=low * debian/patches/run-mailcap.diff: Test $1 instead of $file which has not been assigned yet. Fixes failure to open URLs other than file:// when xdg-open is called under a generic desktop environment (regression in 1.0.2-5). Closes: #484602. -- Per Olofsson Fri, 06 Jun 2008 00:00:04 +0200 xdg-utils (1.0.2-5) unstable; urgency=low * debian/patches/xdg-open-generic: Use 'local' according to policy. * Add a .diff extension to all patch filenames. * Split up patches to make them more fine-grained (one feature per patch). * Remove libexo alternative dep for exo-utils, now that exo-utils is in lenny. * Remove xsltproc from Recommends, not used anymore. * Add debian/patches/xdg-mime-xfce.diff: Fix xdg-mime under Xfce. Closes: #430654. * Add debian/patches/xdg-mime-errorchecking.diff: Check return code from programs invoked by "xdg-mime query filetype". Closes: #465443. -- Per Olofsson Mon, 02 Jun 2008 09:50:48 +0200 xdg-utils (1.0.2-4) unstable; urgency=low * Update debian/patches/xdg-email-generic: - Don't add things already added by upstream now. - Don't check if gnome-open/exo-open exists, because they almost certainly do if running under the corresponding desktop environment. - Remove upstream's default BROWSER list, sensible-browser will take care of it instead. * Update debian/patches/xdg-open-generic: - Don't check if gnome-open/exo-open exists, because they almost certainly do if running under the corresponding desktop environment. Check for kfmclient though, as the user might not have konqueror. - Decode file:/// URLs correctly before passing them to run-mailcap, expanding any percent-encoded characters. * Remove menu from Suggests. Was only ever used by xdg-su which does not exist anymore. * Switch to the new, cool debhelper v7. Rewrite debian/rules so it gets much smaller. * Remove the -1 revision from the quilt build-dep. * Add debian/patches/bashisms.patch, correcting some bashisms. Thanks to Chris Lamb for part of it. Closes: #472890. -- Per Olofsson Sun, 04 May 2008 22:59:35 +0200 xdg-utils (1.0.2-3) unstable; urgency=low * Suggest the new exo-utils package. Keep libexo-0.3-0 as an alternative. Closes: #462498. -- Per Olofsson Tue, 29 Jan 2008 20:40:16 +0100 xdg-utils (1.0.2-2) unstable; urgency=low * Recommend iceweasel instead of firefox. * Suggest kdelibs4c2a instead of kdelibs-bin. (Provides the dcop command.) * Recommend x11-utils and x11-xserver-utils instead of xbase-clients. (Provide xprop and xset.) -- Per Olofsson Fri, 21 Dec 2007 18:33:51 +0100 xdg-utils (1.0.2-1) unstable; urgency=low * New upstream release. Closes: #454925. * Point Vcs-{Git,Browser} to new repo at git.debian.org. Also remove XS- prefix. * Bump Standards-Version to 3.7.3 (no changes). * Add new Homepage field. Remove Website psuedo-field from description. * Don't ignore errors from make distclean in debian/rules. Check if Makefile exists first instead. * Leading lowercase character in short description. -- Per Olofsson Wed, 19 Dec 2007 11:32:57 +0100 xdg-utils (1.0.1-2) unstable; urgency=low * New upstream release * Fix debian/watch. * Use quilt's supplied make rules for patch handling. * Distribute RELEASE_NOTES and TODO * Update description -- Per Olofsson Tue, 16 Jan 2007 22:04:50 +0100 xdg-utils (1.0-2) UNRELEASED; urgency=low * Use XS-Vcs-Git: instead of XS-X-Vcs-Git:. -- Per Olofsson Sun, 29 Oct 2006 22:15:28 +0100 xdg-utils (1.0-1) unstable; urgency=low * New upstream release. - Remove debian/patches/xdg-open-xfce, integrated upstream. - Remove debian/patches/xdg-icon-resource-check-for-cache, integrated upstream. - Remove debian/patches/no-tests-clean, integrated upstream. * Update debian/watch. * Added XS-X-Vcs-Git reference to repository in source control file. -- Per Olofsson Sun, 22 Oct 2006 21:31:18 +0200 xdg-utils (1.0~beta3-1) unstable; urgency=low * New upstream release. - xdg-su is gone. * Fix xfce support in xdg-open. Closes: #382836. * Added debian/watch. * Check for icon-theme.cache before running gtk-update-icon-cache. If we create a cache where none was, things will break for other packages. * Disable tests-clean rule (does nasty things). * Added postinst/prerm which create/remove the following directories in /usr/local: - /usr/local/share/applications - /usr/local/share/desktop-directories - /usr/local/share/icons - /usr/local/share/icons/hicolor - /usr/local/share/mime - /usr/local/share/mime/packages * Recommend: shared-mime-info. -- Per Olofsson Tue, 29 Aug 2006 17:35:02 +0200 xdg-utils (0.9+1.0beta1-2) unstable; urgency=low * Remove comments from debian/rules. * Move Depends: to Recommends:. Closes: #380141. * Recommend: mime-support. * Use run-mailcap for generic xdg-open support. * Use generic fallbacks even if running a desktop environment (if the needed program is not found). * Try su-to-root as a generic fallback in xdg-su. Suggest: menu. -- Per Olofsson Sat, 29 Jul 2006 11:51:16 +0200 xdg-utils (0.9+1.0beta1-1) unstable; urgency=low * Initial release. Closes: #375362 -- Per Olofsson Mon, 26 Jun 2006 10:56:12 +0200 debian/control0000664000000000000000000000301512122400535010564 0ustar Source: xdg-utils Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Per Olofsson Uploaders: Fathi Boudra Section: utils Priority: optional Standards-Version: 3.9.1 Build-Depends: debhelper (>= 7.4.15) Vcs-Git: git://git.debian.org/git/collab-maint/xdg-utils.git Vcs-Browser: http://git.debian.org/?p=collab-maint/xdg-utils.git Homepage: http://portland.freedesktop.org/ Package: xdg-utils Architecture: all Multi-Arch: foreign Depends: ${misc:Depends} Recommends: libfile-mimeinfo-perl, x11-utils, x11-xserver-utils Suggests: gvfs-bin Description: desktop integration utilities from freedesktop.org xdg-utils contains utilities for integrating applications with the desktop environment, regardless of which desktop environment is used. They are part of freedesktop.org's Portland project. . The following utilities are included: . * xdg-desktop-menu - Install desktop menu items * xdg-desktop-icon - Install icons on the user's desktop * xdg-icon-resource - Install icon resources * xdg-mime - Gather MIME information about a file * xdg-open - Open a URL in the user's preferred application that handles the respective URL or file type * xdg-email - Open the user's preferred email client, potentially with subject and other info filled in * xdg-screensaver - Enable, disable, or suspend the screensaver * xdg-settings - get various settings (default web browser) from the desktop environment debian/compat0000664000000000000000000000000211444121521010361 0ustar 7 debian/watch0000664000000000000000000000016011444121521010211 0ustar version=3 http://portland.freedesktop.org/ \ http://portland.freedesktop.org/download/xdg-utils-([\d\.]+)\.tgz debian/docs0000664000000000000000000000003211444121521010031 0ustar README RELEASE_NOTES TODO debian/patches/0000775000000000000000000000000011642454545010631 5ustar debian/patches/xdg-open-printf.diff0000664000000000000000000000135511530246460014477 0ustar Description: Use /usr/bin/printf if available when decoding URLs. dash's printf doesn't understand \xHH sequences. Author: Per Olofsson Bug: http://bugs.debian.org/613272 --- a/scripts/xdg-open +++ b/scripts/xdg-open @@ -420,7 +420,11 @@ open_generic() # Decode URLs if echo "$file" | grep -q '^file:///'; then file=${file#file://} - file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" + local printf=printf + if [ -x /usr/bin/printf ]; then + printf=/usr/bin/printf + fi + file="$($printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" fi check_input_file "$file" debian/patches/bashisms.diff0000664000000000000000000001146311514016165013267 0ustar Description: Fix some bashisms. Author: Per Olofsson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33093 --- a/scripts/xdg-mime +++ b/scripts/xdg-mime @@ -430,7 +430,7 @@ detectDE() elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; else DE="" fi } --- a/scripts/xdg-desktop-icon +++ b/scripts/xdg-desktop-icon @@ -408,7 +408,7 @@ detectDE() elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; else DE="" fi } --- a/scripts/xdg-desktop-menu +++ b/scripts/xdg-desktop-menu @@ -604,7 +604,7 @@ detectDE() elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; else DE="" fi } --- a/scripts/xdg-email +++ b/scripts/xdg-email @@ -361,7 +361,7 @@ detectDE() elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; elif [ -r ~/.muttrc ] && which mutt > /dev/null 2>&1; then DE=envvar MAILER="x-terminal-emulator -e mutt" --- a/scripts/xdg-icon-resource +++ b/scripts/xdg-icon-resource @@ -400,7 +400,7 @@ detectDE() elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; else DE="" fi } --- a/scripts/xdg-open +++ b/scripts/xdg-open @@ -307,7 +307,7 @@ detectDE() elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; else DE="" fi } --- a/scripts/xdg-screensaver +++ b/scripts/xdg-screensaver @@ -335,7 +335,7 @@ detectDE() elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; else DE="" fi } --- a/scripts/xdg-settings +++ b/scripts/xdg-settings @@ -315,7 +315,7 @@ detectDE() elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; else DE="" fi } debian/patches/xdg-update-menu-caonicalize-defaults.list.diff0000664000000000000000000000236611547666200021531 0ustar From ef69d3b384fc9de1269d4304b3c1cd18555b2253 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 30 Mar 2011 13:05:33 +0200 Subject: [PATCH] Don't overwrite a /usr/share/applications/defaults.list symlink Canonicalize the defaults.list file name before overwriting it, to avoid replacing symlinks with files. Thanks to Joel Ebel for the original patch! Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35794 Bug-Ubuntu: https://launchpad.net/bugs/703106 --- scripts/xdg-desktop-menu | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Index: xdg-utils-1.1.0~rc1/scripts/xdg-desktop-menu =================================================================== --- xdg-utils-1.1.0~rc1.orig/scripts/xdg-desktop-menu 2011-03-30 13:08:54.000000000 +0200 +++ xdg-utils-1.1.0~rc1/scripts/xdg-desktop-menu 2011-03-30 13:09:26.217621591 +0200 @@ -686,7 +686,7 @@ # App already listed as default continue; fi - default_file="$1/defaults.list" + default_file="$(readlink -f "$1/defaults.list")" DEBUG 1 "Updating $default_file" grep -v "$MIME=" $default_file > ${default_file}.new 2> /dev/null if ! grep "[Default Applications]" ${default_file}.new > /dev/null; then debian/patches/gnome-3.0.diff0000664000000000000000000002357411547545577013113 0ustar Description: Make the default mail client and browser settings work with the x-scheme-handler method of registering URI handlers in gnome3. Note, this is loosely based on http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=6f49c05ceb2a1935d07c49c2e100b5cf3cdf5f26, however, we don't maintain separate methods for gnome and gnome3. The upstream gnome3 detection doesn't work on Natty because we're not really using gnome3. In addition to this, when we set the defaults we use both the new and old methods so that we preserve the functionality of legacy apps using gnomevfs. This also contains additional changes to get/set default mimetype handlers from the users mimeapps.list rather than defaults.list, which isn't used by anything (see http://www.freedesktop.org/wiki/Specifications/mime-actions-spec) Author: Bastien Nocera Author: Chris Coulson Bug-Ubuntu: https://launchpad.net/bugs/670128 --- a/scripts/xdg-email +++ b/scripts/xdg-email @@ -310,6 +310,24 @@ check_output_file() fi } +desktop_file_to_binary() +{ + search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" + desktop="`basename "$1"`" + IFS=: + for dir in $search; do + unset IFS + [ "$dir" -a -d "$dir/applications" ] || continue + file="$dir/applications/$desktop" + [ -r "$file" ] || continue + # Remove any arguments (%F, %f, %U, %u, etc.). + command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + command="`which "$command"`" + readlink -f "$command" + return + done +} + #---------------------------------------- # Checks for shared commands, e.g. --help @@ -479,7 +497,9 @@ open_kde() open_gnome() { local client - client=`gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -d ' ' -f 1` || "" + local desktop + desktop=`xdg-mime query default "x-scheme-handler/mailto"` + client=`desktop_file_to_binary "$browser"` echo $client | grep thunderbird > /dev/null 2>&1 if [ $? -eq 0 ] ; then run_thunderbird "$client" "$1" --- a/scripts/xdg-settings +++ b/scripts/xdg-settings @@ -418,21 +418,26 @@ desktop_file_to_binary() # This function is hard-coded for text/html but it could be adapted if needed. fix_local_desktop_file() { + if test -z "$2" ; then + MIME="text/html" + else + MIME="$2" + fi apps="${XDG_DATA_HOME:-$HOME/.local/share}/applications" # No local desktop file? [ ! -f "$apps/$1" ] && return - MIME="`grep "^MimeType=" "$apps/$1" | cut -d= -f 2-`" - case "$MIME" in - text/html\;*|*\;text/html\;*|*\;text/html\;|*\;text/html) - # Already has text/html? Great! + MIMETYPES="`grep "^MimeType=" "$apps/$1" | cut -d= -f 2-`" + case "$MIMETYPES" in + $MIME\;*|*\;$MIME\;*|*\;$MIME\;|*\;$MIME) + # Already has the mime-type? Great! return 0 ;; esac - # Add text/html to the list + # Add the mime-type to the list temp="`mktemp "$apps/$1.XXXXXX"`" || return grep -v "^MimeType=" "$apps/$1" >> "$temp" - echo "MimeType=text/html;$MIME" >> "$temp" + echo "MimeType=$MIME;$MIMETYPES" >> "$temp" oldlines="`wc -l < "$apps/$1"`" newlines="`wc -l < "$temp"`" @@ -466,22 +471,32 @@ xdg_mime_fixup() get_browser_mime() { + if test -z "$1" ; then + MIME="text/html" + else + MIME="$1" + fi xdg_mime_fixup - xdg-mime query default text/html + xdg-mime query default "$MIME" } set_browser_mime() { xdg_mime_fixup - orig="`get_browser_mime`" + if test -z "$2" ; then + MIME="text/html" + else + MIME="$2" + fi + orig="`get_browser_mime $MIME`" # Fixing the local desktop file can actually change the default browser all # by itself, so we fix it only after querying to find the current default. - fix_local_desktop_file "$1" || return + fix_local_desktop_file "$1" "$MIME" || return mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/applications" - xdg-mime default "$1" text/html || return - if [ x"`get_browser_mime`" != x"$1" ]; then + xdg-mime default "$1" "$MIME" || return + if [ x"`get_browser_mime $MIME`" != x"$1" ]; then # Put back the original value - xdg-mime default "$orig" text/html + xdg-mime default "$orig" "$MIME" exit_failure_operation_failed fi } @@ -585,32 +600,32 @@ set_browser_kde() get_browser_gnome() { - binary="`gconftool-2 --get /desktop/gnome/applications/browser/exec | first_word`" - if [ x"$binary" = x ]; then - # No default browser; GNOME might use the MIME type text/html. - get_browser_mime - else - # gconftool gives the binary (maybe with %s etc. afterward), - # but we want the desktop file name, not the binary. So, we - # have to find the desktop file to which it corresponds. - desktop="`binary_to_desktop_file "$binary"`" - basename "$desktop" - fi + get_browser_mime "x-scheme-handler/http" } check_browser_gnome() { + desktop="$1" check="`desktop_file_to_binary "$1"`" if [ -z "$check" ]; then echo no exit_success fi + # Check HTTP and HTTPS, but not about: and unknown:, using the GNOME 3 scheme. + for protocol in http https; do + browser="`get_browser_mime "x-scheme-handler/$protocol"`" + if [ x"$browser" != x"$desktop" ]; then + echo no + exit_success + fi + done + binary="`gconftool-2 --get /desktop/gnome/applications/browser/exec | first_word`" if [ x"$binary" != x"$check" ]; then echo no exit_success fi - # Check HTTP and HTTPS, but not about: and unknown:. + # Check HTTP and HTTPS, but not about: and unknown:, using the legacy GNOME scheme. for protocol in http https; do binary="`gconftool-2 --get /desktop/gnome/url-handlers/$protocol/command | first_word`" if [ x"$binary" != x"$check" ]; then @@ -634,7 +649,12 @@ set_browser_gnome() [ "$binary" ] || exit_failure_file_missing set_browser_mime "$1" || return - # Set the default browser. + # Set the default browser using the GNOME 3 scheme. + for protocol in http https about unknown; do + set_browser_mime "$1" "x-scheme-handler/$protocol" || return + done + + # Set the default browser using the legacy GNOME scheme. gconftool-2 --type string --set /desktop/gnome/applications/browser/exec "$binary" gconftool-2 --type bool --set /desktop/gnome/applications/browser/needs_term false gconftool-2 --type bool --set /desktop/gnome/applications/browser/nremote true --- a/scripts/xdg-mime +++ b/scripts/xdg-mime @@ -667,15 +667,57 @@ make_default_generic() # Add $2=$1 to XDG_DATA_HOME/applications/defaults.list xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" - default_file="$xdg_user_dir/applications/defaults.list" + default_file="$xdg_user_dir/applications/mimeapps.list" DEBUG 2 "make_default_generic $1 $2" DEBUG 1 "Updating $default_file" - grep -v "$2=" $default_file > ${default_file}.new 2> /dev/null - if ! grep "[Default Applications]" ${default_file}.new > /dev/null; then - echo "[Default Applications]" >> ${default_file}.new - fi - echo $2=$1 >> ${default_file}.new - mv ${default_file}.new $default_file + awk -v mimetype="$2" -v application="$1" ' + BEGIN { + prefix=mimetype "=" + indefault=0 + added=0 + blanks=0 + found=0 + } + { + suppress=0 + if (index($0, "[Default Applications]") == 1) { + indefault=1 + found=1 + } else if (index($0, "[") == 1) { + if (!added && indefault) { + print prefix application + added=1 + } + indefault=0 + } else if ($0 == "") { + suppress=1 + blanks++ + } else if (indefault && !added && index($0, prefix) == 1) { + $0=prefix application + added=1 + } + if (!suppress) { + while (blanks > 0) { + print "" + blanks-- + } + print $0 + } + } + END { + if (!added) { + if (!found) { + print "" + print "[Default Applications]" + } + print prefix application + } + while (blanks > 0) { + print "" + blanks-- + } + } +' $default_file > ${default_file}.new && mv ${default_file}.new $default_file } defapp_generic() @@ -687,7 +729,34 @@ defapp_generic() xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ - for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do + for x in `echo "$xdg_user_dir" | sed 's/:/ /g'`; do + mimeapps_list="$x/applications/mimeapps.list" + if [ -f "$mimeapps_list" ] ; then + trader_result=`awk -v mimetype="$MIME" ' + BEGIN { + prefix=mimetype "=" + indefault=0 + found=0 + } + { + if (index($0, "[Default Applications]") == 1) { + indefault=1 + } else if (index($0, "[") == 1) { + indefault=0 + } else if (!found && indefault && index($0, prefix) == 1) { + print substr($0, length(prefix) +1, length) + found=1 + } + } +' $mimeapps_list` + if [ -n "$trader_result" ] ; then + echo $trader_result + exit_success + fi + fi + done + + for x in `echo "$xdg_system_dirs" | sed 's/:/ /g'`; do DEBUG 2 "Checking $x/applications/defaults.list" trader_result=`grep "$MIME=" $x/applications/defaults.list 2> /dev/null | cut -d '=' -f 2 | cut -d ';' -f 1` if [ -n "$trader_result" ] ; then debian/patches/xdg-screensaver-dbus.patch0000664000000000000000000000706511642454545015715 0ustar Description: Use D-Bus API for GNOME screensaver (BR29860) Origin: http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=666d65cae0f2e66d33ec0dc48c054afbf16c9e3f Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29860 Ubuntu-Bug: https://bugs.launchpad.net/xdg-utils/+bug/805386 Author: Michael T. Dean Reviewed-by: Rex Dieter Last-Update: 2011-03-31 Applied-Upstream: http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=666d65cae0f2e66d33ec0dc48c054afbf16c9e3f Index: xdg-utils-1.1.0~rc1/scripts/xdg-screensaver =================================================================== --- xdg-utils-1.1.0~rc1.orig/scripts/xdg-screensaver 2011-10-03 16:03:24.499235760 +0200 +++ xdg-utils-1.1.0~rc1/scripts/xdg-screensaver 2011-10-03 16:03:43.895236218 +0200 @@ -809,16 +809,18 @@ screensaver_gnome_screensaver() { -# TODO -# There seems to be a DBUS interface for gnome-screensaver -# See http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2006-April/042579.html and -# http://cvs.gnome.org/viewcvs/gnome-screensaver/src/gs-listener-dbus.c?rev=1.36&view=log -# A problem seems to be that Inhibit is tied to the lifetime of the DBUS appname and -# this can not be used from a script +# DBUS interface for gnome-screensaver +# http://people.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html case "$1" in suspend) - screensaver_suspend_loop gnome-screensaver-command --poke - result=0 + screensaver_suspend_loop \ + dbus-send --session \ + --dest=org.gnome.ScreenSaver \ + --type=method_call \ + /org/gnome/ScreenSaver \ + org.gnome.ScreenSaver.SimulateUserActivity \ + 2> /dev/null + result=$? ;; resume) @@ -827,7 +829,13 @@ ;; activate) - gnome-screensaver-command --activate > /dev/null 2> /dev/null + dbus-send --session \ + --dest=org.gnome.ScreenSaver \ + --type=method_call \ + /org/gnome/ScreenSaver \ + org.gnome.ScreenSaver.SetActive \ + boolean:true \ + 2> /dev/null result=$? ;; @@ -838,18 +846,31 @@ reset) # Turns the screensaver off right now - gnome-screensaver-command --deactivate > /dev/null 2> /dev/null + dbus-send --session \ + --dest=org.gnome.ScreenSaver \ + --type=method_call \ + /org/gnome/ScreenSaver \ + org.gnome.ScreenSaver.SimulateUserActivity \ + 2> /dev/null result=$? ;; status) - result=0 - if [ -f "$screensaver_file" ] ; then - echo "disabled" - elif gnome-screensaver-command --query > /dev/null 2> /dev/null; then + status=`dbus-send --session \ + --dest=org.gnome.ScreenSaver \ + --type=method_call \ + --print-reply \ + --reply-timeout=2000 \ + /org/gnome/ScreenSaver \ + org.gnome.ScreenSaver.GetActive \ + | grep boolean | cut -d ' ' -f 5` + result=$? + if [ x"$status" = "xtrue" -o x"$status" = "xfalse" ]; then echo "enabled" + elif [ x"$result" != "x0" ]; then + echo "ERROR: dbus org.gnome.ScreenSaver.GetActive returned '$status'" >&2 + return 1 else - # Something is wrong echo "disabled" fi ;; debian/patches/series0000664000000000000000000000051511642454545012047 0ustar xdg-mime-follow-symlinks.diff x-www-browser.diff xserver-blanking.diff xdg-email-envvar.diff xdg-email-mutt-detect.diff xdg-mime-generic-use-mimetype.diff bashisms.diff xdg-open-browser-multiword.diff xdg-open-printf.diff xdg-update-menu-caonicalize-defaults.list.diff gnome-3.0.diff lp779156-lubuntu.diff xdg-screensaver-dbus.patch debian/patches/xdg-mime-generic-use-mimetype.diff0000664000000000000000000000351111544626000017211 0ustar Description: Try mimetype first as the generic method for xdg-mime. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33094 Bug-Debian: http://bugs.debian.org/609630 Bug-Debian: http://bugs.debian.org/618624 Author: Per Olofsson Author: Scott Ritchie Index: xdg-utils-1.1.0~rc1/scripts/xdg-mime =================================================================== --- xdg-utils-1.1.0~rc1.orig/scripts/xdg-mime 2011-03-16 16:26:44.000000000 -0700 +++ xdg-utils-1.1.0~rc1/scripts/xdg-mime 2011-03-28 07:57:17.113065100 -0700 @@ -498,9 +498,15 @@ if gvfs-info --help 2>/dev/null 1>&2; then DEBUG 1 "Running gvfs-info \"$1\"" gvfs-info "$1" 2> /dev/null | grep standard::content-type | cut -d' ' -f4 + elif gnomevfs-info --help 2>/dev/null 1>&2; then + DEBUG 1 "Running gnomevfs-info \"$1\"" + gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "// + elif mimetype --version >/dev/null 2>&1; then + DEBUG 1 "Running mimetype -b \"$1\"" + mimetype -b "$1" else - DEBUG 1 "Running gnomevfs-info \"$1\"" - gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "// + DEBUG 1 "Running file -i \"$1\"" + /usr/bin/file -i "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^ "// fi if [ $? -eq 0 ]; then @@ -512,8 +518,13 @@ info_generic() { - DEBUG 1 "Running file -i \"$1\"" - /usr/bin/file -i "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^ "// + if mimetype --version >/dev/null 2>&1; then + DEBUG 1 "Running mimetype -b \"$1\"" + mimetype -b "$1" + else + DEBUG 1 "Running file -i \"$1\"" + /usr/bin/file -i "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^ "// + fi if [ $? -eq 0 ]; then exit_success debian/patches/xdg-open-browser-multiword.diff0000664000000000000000000000130111530250101016656 0ustar Description: Fix support for multi-word $BROWSER commands. Author: Per Olofsson Bug-Debian: http://bugs.debian.org/612339 --- a/scripts/xdg-open +++ b/scripts/xdg-open @@ -442,8 +442,10 @@ open_generic() fi fi + OLDIFS="$IFS" IFS=":" for browser in $BROWSER; do + IFS="$OLDIFS" if [ x"$browser" != x"" ]; then browser_with_arg=`printf "$browser" "$1" 2>/dev/null` @@ -452,7 +454,7 @@ open_generic() fi if [ x"$browser_with_arg" = x"$browser" ]; then - "$browser" "$1"; + $browser "$1"; else eval '$browser_with_arg'$xdg_redirect_output; fi debian/patches/xdg-mime-follow-symlinks.diff0000664000000000000000000000224611514044413016330 0ustar Description: Follow symlinks when querying MIME type in xdg-mime. Otherwise we get stuff like inode/symlink back. Author: Per Olofsson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33097 --- a/scripts/xdg-mime +++ b/scripts/xdg-mime @@ -495,14 +495,12 @@ info_kde() info_gnome() { - file=`readlink -f "$1"` # Normalize path - if gvfs-info --help 2>/dev/null 1>&2; then - DEBUG 1 "Running gvfs-info \"$file\"" - gvfs-info "$file" 2> /dev/null | grep standard::content-type | cut -d' ' -f4 + DEBUG 1 "Running gvfs-info \"$1\"" + gvfs-info "$1" 2> /dev/null | grep standard::content-type | cut -d' ' -f4 else - DEBUG 1 "Running gnomevfs-info \"$file\"" - gnomevfs-info --slow-mime "$file" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "// + DEBUG 1 "Running gnomevfs-info \"$1\"" + gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "// fi if [ $? -eq 0 ]; then @@ -751,6 +749,7 @@ case $1 in ;; esac check_input_file "$filename" + filename=$(readlink -f -- "$filename") ;; default) debian/patches/xserver-blanking.diff0000664000000000000000000000273311514016010014724 0ustar Description: Support X server blanking in xdg-screensaver. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30561 Bug-Debian: http://bugs.debian.org/511248 Author: Ben Hutchings --- a/scripts/xdg-screensaver +++ b/scripts/xdg-screensaver @@ -435,6 +435,10 @@ perform_action() '') screensaver_xserver "$1" ;; + + '') + screensaver_xserver "$1" + ;; esac if [ "$1" = "suspend" ] ; then @@ -682,6 +686,49 @@ screensaver_kde() return 1 fi ;; + + *) + echo "ERROR: Unknown command '$1'" >&2 + return 1 + ;; + esac +} + +screensaver_xserver() +{ + case "$1" in + suspend) + xset s off > /dev/null + result=$? + ;; + + resume) + xset s default > /dev/null + result=$? + ;; + + activate) + xset s activate > /dev/null + result=$? + ;; + + reset) + xset s reset > /dev/null + result=$? + ;; + + status) + timeout=`xset q | sed '/^Screen Saver:/,/^[^ ]/ { s/.*timeout: *\([0-9]*\).*/\1/; t }; d'` + result=$? + if [ "$timeout" -gt 0 ]; then + echo "enabled" + elif [ "$timeout" -eq 0 ]; then + echo "disabled" + else + echo "ERROR: xset q did not report the screensaver timeout" >&2 + return 1 + fi + ;; *) echo "ERROR: Unknown command '$1'" >&2 debian/patches/lp779156-lubuntu.diff0000664000000000000000000000775511607321207014300 0ustar Author: Jonathan Marsden Description: update for LXDE * scripts/xdg-mime: - Fix detectDE to detect LXDE. - Create ~/.local/share/applications/mimeapps.list when needed in non-gnome/kde environments. * scripts/xdg-email: - Fix detectDE to detect LXDE. - Added open_lxde shell function, used when LXDE detected. - Added run_sylpheed function, used to call sylpheed (LP: 779156). Bug-Ubuntu: https://launchpad.net/bugs/779156 --- xdg-utils-1.1.0~rc1.orig/scripts/xdg-mime +++ xdg-utils-1.1.0~rc1/scripts/xdg-mime @@ -431,6 +431,7 @@ detectDE() elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; + elif [ x"XDG_CURRENT_DESKTOP" = x"LXDE" ]; then DE=lxde; else DE="" fi } @@ -670,6 +671,8 @@ make_default_generic() default_file="$xdg_user_dir/applications/mimeapps.list" DEBUG 2 "make_default_generic $1 $2" DEBUG 1 "Updating $default_file" + mkdir -p `dirname "$default_file"` + touch "$default_file" awk -v mimetype="$2" -v application="$1" ' BEGIN { prefix=mimetype "=" --- xdg-utils-1.1.0~rc1.orig/scripts/xdg-email +++ xdg-utils-1.1.0~rc1/scripts/xdg-email @@ -321,7 +321,7 @@ desktop_file_to_binary() file="$dir/applications/$desktop" [ -r "$file" ] || continue # Remove any arguments (%F, %f, %U, %u, etc.). - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | sed -e 's/ .*$//'`" command="`which "$command"`" readlink -f "$command" return @@ -380,11 +380,13 @@ detectDE() elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde; + elif [ x"$XDG_CURRENT_DESKTOP" = x"LXDE" ]; then DE=lxde; elif [ -r ~/.muttrc ] && which mutt > /dev/null 2>&1; then DE=envvar MAILER="x-terminal-emulator -e mutt" else DE="" fi + DEBUG 2 "DE is \"$DE\"" } #---------------------------------------------------------------------------- @@ -456,6 +458,17 @@ run_thunderbird() fi } +run_sylpheed() +{ + DEBUG 1 "Running $1 --compose \"$2\"" + "$1" --compose "$2" + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + open_kde() { local client kde_email_profile_name @@ -550,6 +563,39 @@ open_envvar() exit_failure_operation_failed } +open_lxde() +{ + DEBUG 3 "Running open_lxde \"$1\"" + + local client + local desktop + desktop=`xdg-mime query default "x-scheme-handler/mailto"` + client=`desktop_file_to_binary "$desktop"` + + # If no xdg-mime default was set, + # and if we are running Lubuntu, fallback to sylpheed + if [ -z "$desktop" -a "$DESKTOP_SESSION" = "Lubuntu" ]; then + client=`desktop_file_to_binary "sylpheed.desktop"` + fi + + echo $client | grep thunderbird > /dev/null 2>&1 + if [ $? -eq 0 ] ; then + run_thunderbird "$client" "$1" + fi + + echo $client | grep sylpheed > /dev/null 2>&1 + if [ $? -eq 0 ] ; then + DEBUG 3 "Running run_sylpheed \"$client\" \"$1\"" + run_sylpheed "$client" "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + open_generic() { IFS=":" @@ -761,7 +807,11 @@ case "$DE" in open_xfce "${mailto}" ;; - generic|lxde) + lxde) + open_lxde "${mailto}" + ;; + + generic) open_generic "${mailto}" ;; debian/patches/xdg-email-envvar.diff0000664000000000000000000000235111514016070014613 0ustar Description: Add $MAILER support to xdg-email. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=6615 Bug-Debian: http://bugs.debian.org/574131 Author: Per Olofsson --- a/scripts/xdg-email +++ b/scripts/xdg-email @@ -356,7 +356,8 @@ fi detectDE() { - if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; + if [ x"$MAILER" != x"" ]; then DE=envvar; + elif [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; @@ -509,6 +510,23 @@ open_xfce() fi } +open_envvar() +{ + local OLDIFS="$IFS" + IFS=: + for i in $MAILER; do + IFS="$OLDIFS" + + eval "$i" '"$1"' + + if [ $? -eq 0 ]; then + exit_success + fi + done + + exit_failure_operation_failed +} + open_generic() { IFS=":" @@ -704,6 +722,10 @@ if [ x"$BROWSER" = x"" ]; then fi case "$DE" in + envvar) + open_envvar "${mailto}" + ;; + kde) open_kde "${mailto}" ;; debian/patches/xdg-email-mutt-detect.diff0000664000000000000000000000122511514001652015550 0ustar Description: Fallback to mutt if ~/.muttrc exists. Author: Per Olofsson --- a/scripts/xdg-email +++ b/scripts/xdg-email @@ -362,6 +362,9 @@ detectDE() elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + elif [ -r ~/.muttrc ] && which mutt > /dev/null 2>&1; then + DE=envvar + MAILER="x-terminal-emulator -e mutt" else DE="" fi } debian/patches/x-www-browser.diff0000664000000000000000000000163111514014766014231 0ustar Description: When $BROWSER is unset, try x-www-browser first. Author: Per Olofsson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33095 --- a/scripts/xdg-email +++ b/scripts/xdg-email @@ -699,7 +699,7 @@ fi if [ x"$BROWSER" = x"" ]; then BROWSER=links2:links:lynx:w3m if [ -n "$DISPLAY" ]; then - BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER + BROWSER=x-www-browser:firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER fi fi --- a/scripts/xdg-open +++ b/scripts/xdg-open @@ -526,7 +526,7 @@ fi if [ x"$BROWSER" = x"" ]; then BROWSER=links2:links:lynx:w3m if [ -n "$DISPLAY" ]; then - BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER + BROWSER=x-www-browser:firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER fi fi debian/gbp.conf0000664000000000000000000000003611444121521010601 0ustar [DEFAULT] pristine-tar = True debian/copyright0000664000000000000000000000312011444121521011112 0ustar This is work was packaged for Debian by: Per Olofsson It was downloaded from: http://portland.freedesktop.org Upstream authors: Portland Project Copyright: Copyright 2006, Kevin Krammer Copyright 2006, Jeremy White License: # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. and is licensed under the MIT licence. The Debian packaging is: Copyright (C) 2006-2010 Per Olofsson and is licensed under the MIT license, see above. debian/rules0000775000000000000000000000016311444121521010243 0ustar #!/usr/bin/make -f %: dh $@ # don't test, the tests require a desktop environment .PHONY: override_dh_auto_test debian/NEWS0000664000000000000000000000074611461237453007704 0ustar xdg-utils (1.0.2+cvs20100307-3) unstable; urgency=low * xdg-email now honors the $MAILER variable when deciding which mail user agent to use. Remember to wrap it in a terminal window if you're using a text-based mailer. For example: MAILER="xterm -e mutt" You can also list multiple mailers separated by colons, in which case xdg-email will try each one in order until one of them succeeds. -- Per Olofsson Mon, 25 Oct 2010 10:23:18 +0200 debian/source/0000775000000000000000000000000011472520332010467 5ustar debian/source/format0000664000000000000000000000001411444121521011671 0ustar 3.0 (quilt)