xdg-utils-1.1.0-rc1/0000755000175000017500000000000011507576737013764 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/TODO0000644000175000017500000000141611507575742014451 0ustar fboudrafboudraxdg-icon-resource * Add pre-XDG Base Dir gnome-support * Add "query theme" * Add "query lookup" xdg-email * revisit decision to disable &attach= in mailto URLs xdg-screensaver * Return error when WindowID doesn't exist * support dbus org.freedesktop.ScreenSaver methods General * Support XDG_DATA_INSTALL * Support XDG_INSTALL_HOOK * Use "FILE" as argument everywhere instead of "file" * Add xdg-autostart xdg-su: * The summary is incorrect, it suggests that it can only run things as root which is incorrect according to the main body of the document. * The -c option is listed in the synopsis, but not in options. * It would be useful if it was possible to distinguish between a failure because of a bad password or some other failure. * use sudo style syntax, drop -c option xdg-utils-1.1.0-rc1/ChangeLog0000644000175000017500000002617411507575742015543 0ustar fboudrafboudra=== xdg-utils 1.1.0-rc1 === 2010-12-31 Fathi Boudra * xdg-mime: correct install text to use type/subtype. Thanks to Christopher Yeleighton. (BR31441) * xdg-open: declare file variable as local. (BR32487) * xdg-open: decode file:// urls. Thanks to Henning Garus. * xdg-screensaver: support X server blanking. Thanks to Ben Hutchings. 2010-11-18 Rex Dieter * xdg-utils-common: fixup kfmclient_fix_exit_code() for newer kde-config output * xdg-mime: fix typo in manpage * xdg-email: Thunderbird is not detected with localized (BR31740) 2010-10-28 Rex Dieter * add lxde support (BR26058) 2010-09-25 Fathi Boudra * xdg-settings: Only run KDE browser fallback when necessary. Otherwise, in some circumstances, read_kde_browser incorrectly prints the result twice. Thanks to David Benjamin. 2010-09-24 Fathi Boudra * xdg-email: Fix e-mail attachements support with Thunderbird3 (BR13435) 2010-09-24 Fathi Boudra * xdg-mime: update the required section "[Added Associations]" Thanks to Mike Mammarella: 2010-09-24 Fathi Boudra * xdg-email: Fix missing backslash in awk script so that it works with mawk. 2010-09-24 Fathi Boudra * xdg-desktop-icon: set the execute bit to desktop file. Thanks to Damjan Jovanovic. (BR28394) 2010-07-09 Rex Dieter * xdg-screensaver: consider gnome-screensaver a separate DE (BR20027) 2010-07-09 Rex Dieter * xdg-mime : use 'gnomevfs-info --slow-mime' (BR 13939) 2010-07-09 Rex Dieter * xdg-desktop-icon : use localized desktop folder name (BR19011) 2010-07-09 Rex Dieter * xdg-open : use mimeopen -L (follow symlinks) 2010-07-09 Rex Dieter * xdg-open.1 : add FILES, SEE ALSO sections 2010-05-16 Rex Dieter * xdg-open: Spaces in filename (BR27959) 2010-04-22 Fathi Boudra * xdg-email and xdg-open: perform BROWSER check in any case. Thanks to Andrea Florio. (BR27551) 2010-04-22 Fathi Boudra * xdg-email: try console mode browsers and update the browser list. 2010-02-28 Fathi Boudra * xdg-utils-common: fix the comment of exit_failure_file_permission_write function. (BR12821) 2010-02-28 Fathi Boudra * xdg-open: fix regression in open_generic as xdg-mime doesn't handle URLs (mimeopen and run-mailcap as well). Move xdg-mime call into a new function (open_generic_xdg_mime). Check input file before trying to open them with non-browsers. 2010-02-28 Fathi Boudra * xdg-open: fix failure if $BROWSER has arguments. (BR14374) Thanks to Johannes Wegener. 2010-02-28 Fathi Boudra * xdg-open: try console mode browsers and update the browser list. Thanks to Ville Skyttä and Pablo Castellano. (BR14361) 2010-02-24 Fathi Boudra * xdg-screensaver: use dbus-send instead of qdbus for freedesktop screensaver. 2010-02-23 Fathi Boudra * xdg-mime: improve MIME string check when using gnomevfs-info. (BR12818) 2010-02-23 Fathi Boudra * xdg-mime: report error on failure. 2010-02-21 Fathi Boudra * xdg-open: in open_generic, use xdg-mime to lookup mime type and association before the alternatives methods (mimeopen and run-mailcap). (BR23280) 2010-02-20 Fathi Boudra * Add gvfs-copy and gvfs-info support. (BR15828) 2010-01-27 Rex Dieter * xdg-settings: Add %s to the command in the Gnome url handlers (BR26284) 2010-01-18 Rex Dieter * xdg-screensaver resume activates the screensaver on KDE4 (BR26085) 2009-10-16 Rex Dieter * prefer gvfs-open over gnome-open * DE=gnome, if org.gnome.SessionManager exists on dbus 2009-10-12 Fathi Boudra * Fix xdg-email --attach failure with Evolution. (BR23007) Thanks to Dwayne Bailey 2009-10-12 Fathi Boudra * Add an extra check in xdg-open and call kfmclient openURL as a fallback on KDE 4. Thanks to Nicolas Lécureil 2009-10-12 Fathi Boudra * Add email attachments support to Thunderbird from xdg-email. (BR13435) Thanks to Lei Zhang 2009-10-12 Fathi Boudra * Fix xdg-open to handle URL with '#' symbol. (BR23319, BR24375) 2009-10-12 Fathi Boudra * Remove bash requirement to xdg-open and xdg-email. (BR20015) 2009-10-12 Fathi Boudra * Update xdg-settings - Thanks to Mike Mammarella: This fixes some issues where user-generated icons would be detected as the official .desktop file for a binary, rather than the actual version. (It resolves forward and compares binaries rather than resolving backward to a .desktop file from a binary) 2009-09-28 Rex Dieter * Use kde-open, if available (ie, KDE 4) 2009-09-13 Rex Dieter * detect_de: suppress xprop stderr. 2009-08-25 Rex Dieter * fix build for missing manpages (eg. xdg-settings) 2009-08-25 Fathi Boudra * Fix hardcoded KDE home directory. Use kde(4)-config to get path. 2009-08-25 Fathi Boudra * Apply patch from Mike Mammarella to fix 2 issues: - skip invisible desktop files when looking up the default web browser in GNOME. (http://codereview.chromium.org/159738) - check for localized settings by hand in xdg-settings if kreadconfig fails. (http://codereview.chromium.org/160376) 2009-08-10 Fathi Boudra * Replace kfmclient by kioclient usage under KDE 4. Thanks to Nicolas Lécureil 2009-08-03 Fathi Boudra * Remove fixup_mandriva_categories() function. It is not needed anymore since a year. Thanks to Nicolas Lécureil 2009-07-29 Fathi Boudra * Merge xdg-settings utility: a script to get various settings from the desktop environment. Thanks to Dan Kegel and Google Inc. 2009-07-29 Fathi Boudra * Fix hardcoded path in make_default_kde() in xdg-mime unde KDE 3. Add initial KDE 4 support to the function. 2009-07-28 Fathi Boudra * Use kbuildsycoca4 under KDE 4 and kbuildsycoca under KDE 3. 2009-07-28 Fathi Boudra * Use kmimetypefinder under KDE 4 and kfile under KDE 3. 2009-07-28 Fathi Boudra * Add KDE 4 support to xdg-mime. kdetradertest was replaced by ktraderclient under KDE 4. (BR22975) 2009-07-27 Fathi Boudra * Remove -u option from su. It doesn't have it. 2009-07-27 Fathi Boudra * Add KDE 4 support to xdg-email (BR17268) 2009-07-26 Fathi Boudra * Sleep for 50s instead of 59s to avoid to froze the seesion (BR19414) 2009-07-26 Fathi Boudra * Fix a race condition in xdg-screensaver (BR19382) 2009-07-26 Fathi Boudra * Fix basename usage when filename contains spaces (BR18567) 2009-07-26 Fathi Boudra * Fix bashisms used in xdg-mime and xdg-screensaver (BR15827) 2008-08-11 Rex Dieter * initial support for KDE 4 * Add dbus commands to xdg-screensaver for KDE 4 (BR17537) 2008-01-24 Kevin Krammer * Fixing security issue in xdg-email and xdg-open at replacing parameter in $BROWSER 2007-06-27 Waldo Bastian * Fix xdg-mime query filetype on XFCE (BR11383) === xdg-utils 1.0.2 ==== === xdg-utils 1.0.1 ==== 2006-11-03 Waldo Bastian * Fixed spurious output on stdout by xdg-desktop-menu * Cleaned up shell syntax for xdg-screensaver and xdg-icon-resource (fixes Ubuntu 6.10) 2006-10-29 Kevin Krammer * Fixed non-ascii mailto URI handling of xdg-emial on non-UTF8 locales under KDE === xdg-utils 1.0 ==== 2006-05-10 Bryce Harrington * Created xdg-screensaver 2006-04-24 Kevin Krammer * Applied patch provided by Benedikt Meurer to improve the compatability of the Makefile * Added --title option to xdg-file-dialog * Applied another path by Benedikt to let xdg-file-dialog use zenity on GNOME and XFCE * Added a documentation extraction AWK script created by Benedikt which replaces the sed code and adds extraction of examples additionally to the usage info. * Added printing of examples to the --help command. 2006-04-14 Kevin Krammer * Added documentation for --version to all xml files * Added script for file selection task, e.g. using the native file dialog to get a file or directory name 2006-04-11 Kevin Krammer * Applied exit functions to the other scripts * Added a function to check for common commands like --help or --version and always perform the same reaction 2006-04-10 Kevin Krammer * Added common exit functions to improve return value consistency. Currently only used in xdg-mime to gather feedback 2006-04-08 Kevin Krammer * In case of $BROWSER being not avialable or empty, try a fixed list of well known browsers instead 2006-04-06 Kevin Krammer * Fixed "detection" of generic case in xdg-mime, xdg-open and xdg-su as discovered by Hagai Kariti * Fixed tailoring of file and gnomevf-info output by using "sed" to remove a leading whitespace instead of "cut" 2006-04-05 Kevin Krammer * Applied patch by Benedikt Meurer which adds detection for XFCE, XFCE paths for xdg-open and xdg-email and which fixes the script for non-bash shells. 2006-03-31 Waldo Bastian * Generate usage instructions from the same XML that is used for manpages * Included licence text in scripts * Added xdg-desktop script * Added documentation (DocBook, HTML, manpages) * Have Makefile generate manpages * Included fix for xdg-su provided by Jeremy White * Added "release" target to Makefile for generating releases * Added support for .directory and .menu files to xdg-menu 2006-03-21 Kevin Krammer * Imported the current state into freedesktop.org CVS for easier shared development xdg-utils-1.1.0-rc1/Makefile.in0000644000175000017500000000153011507575742016023 0ustar fboudrafboudraSUBDIRS = scripts tests all: $(SUBDIRS) install: $(SUBDIRS:%=%/__install__) uninstall: $(SUBDIRS:%=%/__uninstall__) test: dummy cd tests && $(MAKE) test clean: $(SUBDIRS:%=%/__clean__) distclean: clean $(SUBDIRS:%=%/__distclean__) rm -f config.* Makefile rm -rf autom4te.cache release: $(SUBDIRS:%=%/__release__) distclean rm -f *~ help: @echo "Usage: make [install|uninstall|release]" .PHONY: all install uninstall clean distclean dummy dummy: $(SUBDIRS): dummy @cd $@ && $(MAKE) $(SUBDIRS:%=%/__uninstall__): dummy cd `dirname $@` && $(MAKE) uninstall $(SUBDIRS:%=%/__install__): dummy cd `dirname $@` && $(MAKE) install $(SUBDIRS:%=%/__clean__): dummy cd `dirname $@` && $(MAKE) clean $(SUBDIRS:%=%/__release__): dummy cd `dirname $@` && $(MAKE) release $(SUBDIRS:%=%/__distclean__): dummy cd `dirname $@` && $(MAKE) distclean xdg-utils-1.1.0-rc1/install-sh0000644000175000017500000001273611507575742015771 0ustar fboudrafboudra#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 xdg-utils-1.1.0-rc1/RELEASE_NOTES0000644000175000017500000000540311507575742015734 0ustar fboudrafboudraRelease notes for xdg-utils 1.0.2 ================================= This release fixes: * SVG icons are not supported but documentation still mentioned SVG * xdg-email can now be used without any e-mail address * Don't use mktemp without arguments, it breaks on systems with certain older versions of mktemp (xdg-desktop-menu, xdg-screensaver) Release notes for xdg-utils 1.0.1 ================================= This release fixes: * Several shell syntax issues causing failures on Ubuntu 6.10 * Spurious output on stdout when running xdg-desktop-menu * Non-ascii mailto URI handling of xdg-emial on non-UTF8 locales under KDE Release notes for xdg-utils 1.0 =============================== xdg-utils 1.0 has been tested under the Gnome and KDE desktop environments on Debian, Fedora, Kubuntu, Mandriva, Redhat RHEL4, SUSE, Ubuntu and Xandros based Linux systems. These release notes reflect test findings. Despite extensive testing it should be pointed out that xdg-utils is provided AS IS without warranty of any kind. See the LICENSE file for details. * general: - When installing applications or file types for the current user only (user mode) it may be necessary to restart the session in order for the panel and filemanager to show the correct icons. This problem typically occurs when the installation process required new (hidden) directories to be created under the user's home directory. * xdg-mime: - xdg-mime query filetype may fail under Gnome on certain Debian systems that do not have gnomevfs-info installed by default. * xdg-desktop-menu: - On Redhat RHEL 4 systems running Gnome, new submenus will not appear until the session is restarted. For testing purposes the command "killall gnome-panel" can be used instead of restarting the session. It is not recommended to use this as part of installation scripts though. - KDE based desktops may require several seconds to update the application menu after installing new items. The user may need to close the applications menu first before new items will show up. - On SUSE systems, desktop entries that list any of the standard menu Categories are often being placed in a "More Programs" submenu which makes them somewhat hard to find. * xdg-screensaver: - Screensaver locking does not work on KDE under SUSE 10.0 * xdg-email: - Please refer to http://portland.freedesktop.org/wiki/EmailConfig for additional information on setting up the default E-mail client. - With current versions of Mozilla Thunderbird it is not possible to specify attachments. In order to send an attachment, the user will need to attach the file manually. - Older versions of KMail do not support multiple To or CC recipients. xdg-utils-1.1.0-rc1/tests/0000755000175000017500000000000011507576513015116 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/testrun0000755000175000017500000001434711507575742016564 0ustar fboudrafboudra#!/bin/bash # Defaults. ROOT_TEST_GROUPS="xdg-desktop-icon xdg-desktop-menu xdg-icon-resource xdg-mime xdg-utils-usecases" USER_TEST_GROUPS="$ROOT_TEST_GROUPS xdg-email xdg-open xdg-screensaver" usage() { cat << _ENDUSAGE_ Usage: $0 [-iIcChRSd:p:f:a] [test|testgroup] [...] Options: [-h] Show this message and exit. [-I|-i] Turn off/on interactive tests. Default: on (overrides XDG_TEST_NO_INTERACTIVE) [-C|-c] Turn off/on deletion of tempfiles. Default: on (overrides XDG_TEST_DONT_CLEANUP) [-R] Turn off su to root tests. You will not be prompted for the root password at the beginning of the testrun. [-S] Use sudo instead of su. [-a] Run all tests. (i.e xdg-*/) Has no effect if tests are specified explicitly. [-d dir] Set XDG_TEST_DIR to dir [-p path] Reset PATH to path. Recommended for internal use only. [-f pid] RESERVED -- state flag for self reference. DON'T USE. Arguments: After options, all arguments correspond to tests to run. The default is to run all tests, which consist of all files matching 'xdg-*/t.*'. Supplied testgroups can be a list of directories or a list of individual tests. _ENDUSAGE_ exit 1 } MYARGS="$@" if [ `whoami` == root ] ; then XDG_TEST_DONT_SU="set" DEFAULT_TEST_GROUPS="$ROOT_TEST_GROUPS" RUNNING_AS="root" else DEFAULT_TEST_GROUPS="$USER_TEST_GROUPS" RUNNING_AS="normal" fi ## Read options while getopts "iIcChRSf:d:p:a" opt; do case $opt in I ) export XDG_TEST_NO_INTERACTIVE="set" ;; i ) unset XDG_TEST_NO_INTERACTIVE ;; C ) export XDG_TEST_DONT_CLEANUP="set" ;; c ) unset XDG_TEST_DONT_CLEANUP ;; R ) XDG_TEST_DONT_SU="set" ;; S ) XDG_TEST_USE_SUDO="set" ;; f ) XDG_TEST_SELF_LAUNCH="$OPTARG" ;; d ) export XDG_TEST_DIR="$OPTARG" ;; p ) export PATH="$OPTARG" ;; a ) DEFAULT_TEST_GROUPS=`ls -d $XDG_TEST_DIR/xdg-*` ;; h ) usage ;; \? ) usage ;; esac done shift $(($OPTIND - 1)) ## Set up prerequisites if [ -z "$XDG_TEST_DIR" ] ; then export XDG_TEST_DIR="$PWD" echo "WARNING: guessed XDG_TEST_DIR to be $XDG_TEST_DIR" fi if [ -z `which xdg-mime 2>/dev/null` ] && [ -d "$XDG_TEST_DIR/../scripts" ] ; then export PATH="$PATH:$XDG_TEST_DIR/../scripts" echo "WARNING: modified PATH to add '$XDG_TEST_DIR/../scripts'" fi ## Read test groups if [ $# -eq 0 ] ; then TEST_GROUPS="$DEFAULT_TEST_GROUPS" else TEST_GROUPS="$@" fi TEST_FILES=`find $TEST_GROUPS -name 't.*[^~]' | sort` declare -i PASS=0 declare -i FAILCOUNT=0 declare -i TOTAL=0 declare -i ATTEMPT=0 TEST_LOG="$XDG_TEST_DIR/xdg-test.log" export USING_TEST_RUNNER="true" for MY_TEST_FILE in $TEST_FILES; do . "$MY_TEST_FILE" done if [ -z "$XDG_TEST_SELF_LAUNCH" ] ; then # not self launched test -d "$XDG_TEST_DIR/tmp" || mkdir "$XDG_TEST_DIR/tmp" touch "$XDG_TEST_DIR/tmp/shortid" chmod 666 "$XDG_TEST_DIR/tmp/shortid" if [ "$RUNNING_AS" == root -a -z "$*" ] ; then echo "WARNING: Tests are incomplete unless run as a normal (non-root) user." echo "The test runner will SU as needed to run root cases." fi echo "======================================================" >> "$TEST_LOG" echo "[`date`] TEST RUN START: $*" >> "$TEST_LOG" "$XDG_TEST_DIR/include/system_info" >>"$TEST_LOG" if [ -z "$XDG_TEST_DONT_SU" ] ; then if [ -z "$XDG_TEST_USE_SUDO" ] ; then SUCMD= echo "Running su for system tests. (Use testrun -S to use sudo instead)" echo "Please enter the root password when requested." else SUCMD=`which sudo 2>/dev/null` echo "Running ${SUCMD-su} for system tests." echo "Please enter an apropriate password if requested." fi # Note if sudo is not found, $SUCMD will be blank, so run su directly. # We cannot assume su works since systems like Ubuntu require sudo # Yet, systems like Debian do not ship with sudo by default. $SUCMD su - -c "cd $PWD && XDG_UTILS_DEBUG_LEVEL=$XDG_UTILS_DEBUG_LEVEL $0 -f $$ -d '$XDG_TEST_DIR' -p '$PATH' $MYARGS" fi TEST_STATUS_FILE="$XDG_TEST_DIR/tmp/xdgtest_status-$$" USERCLASS="normal user" else TEST_STATUS_FILE="$XDG_TEST_DIR/tmp/xdgtest_status-$XDG_TEST_SELF_LAUNCH" USERCLASS="root" fi echo "[`date`] ---- $USERCLASS run start: $*" >> "$TEST_LOG" #echo "TEST_LIST: $TEST_LIST" for t in $TEST_LIST; do TOTAL=$((TOTAL + 1 )) ATTEMPT=$((ATTEMPT + 1 )) echo -n "$t: " test_setup # Run test - subshell is necessary to keep things contained. ( "$t" ) >> "$TEST_LOG" CODE="$?" test_cleanup # Report result case "$CODE" in 0 ) PASS=$((PASS + 1)) RESULT=PASS ;; 1 ) RESULT=FAIL FAILCOUNT=$((FAILCOUNT +1)) ;; 5 ) RESULT=UNTESTED TOTAL=$((TOTAL - 1 )) ## HACK: we don't want to count tests that don't run. ;; 7 ) RESULT=NORESULT ;; 10 ) RESULT=WARN ;; * ) RESULT="UNKNOWN($CODE)";; esac echo "$RESULT" test "$RESULT" == FAIL && echo "" >> "$TEST_LOG" done echo -n "[`date`] ---- " >> "$TEST_LOG" echo "$USERCLASS run end: $FAILCOUNT tests failed, $PASS of $TOTAL tests passed. ($ATTEMPT attempted)" | tee -a "$TEST_LOG" if [ -z "$XDG_TEST_SELF_LAUNCH" ] ; then # not su'd if [ -f "$TEST_STATUS_FILE" ] ; then RFAIL=`grep 'FAIL' "$TEST_STATUS_FILE" | cut -d ':' -f2` RPASS=`grep 'PASS' "$TEST_STATUS_FILE" | cut -d ':' -f2` RTOTAL=`grep 'TOTAL' "$TEST_STATUS_FILE" | cut -d ':' -f2` RATTEMPT=`grep 'ATTEMPT' "$TEST_STATUS_FILE" | cut -d ':' -f2` rm -f "$TEST_STATUS_FILE" fi GFAIL=$(( $FAILCOUNT + ${RFAIL-0} )) GPASS=$(( $PASS + ${RPASS-0} )) GTOTAL=$(( $TOTAL + ${RTOTAL-0} )) GATTEMPT=$(( $ATTEMPT + ${RATTEMPT-0} )) echo -n "[`date`] TEST RUN END: $* - " >> "$TEST_LOG" echo -n "TOTAL: " echo "$GFAIL tests failed, $GPASS of $GTOTAL tests passed. ($GATTEMPT attempted)" | tee -a "$TEST_LOG" if [ $(( $GTOTAL - $GPASS )) -gt 0 ]; then EC=1 echo "NOT OK! -- See $TEST_LOG for details." else EC=0 echo "ok" fi if [ -z "$*" -a -z "$XDG_TEST_NO_INTERACTIVE" ] ; then echo "Please consider submitting your test report to" echo "http://portland.freedesktop.org/testreport.html" echo "" fi exit "$EC" else ## Running su'd. save results. echo "FAIL:$FAILCOUNT" > $TEST_STATUS_FILE echo "PASS:$PASS" >> $TEST_STATUS_FILE echo "TOTAL:$TOTAL" >> $TEST_STATUS_FILE echo "ATTEMPT:$ATTEMPT" >> $TEST_STATUS_FILE if [ $(( $TOTAL - $PASS)) -gt 0 ] ; then exit -1 else exit 0 fi fi xdg-utils-1.1.0-rc1/tests/generic/0000755000175000017500000000000011507575742016535 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/generic/t.version0000755000175000017500000000067311507575742020420 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" generic_version() { test_start "$FUNCNAME: generic version arg - $XDGUTIL" test_purpose "Ensure that $XDGUTIL prints the version information and exists with code 0." # Dependencies section test_init assert_util_var set_no_display # Test steps section test_procedure assert_exit 0 "$XDGUTIL" "--version" assert_stdout assert_nostderr test_result } GENERIC_TEST="generic_version" xdg-utils-1.1.0-rc1/tests/generic/t.manual0000755000175000017500000000071211507575742020202 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" generic_manual() { test_start "$FUNCNAME: generic manual - $XDGUTIL" test_purpose "Ensure that $XDGUTIL exits with an error and usage message when called without required arguments." # Dependencies section test_init assert_util_var set_no_display # Test steps section test_procedure assert_exit 0 "$XDGUTIL" "--manual" assert_stdout assert_nostderr test_result } GENERIC_TEST="generic_manual" xdg-utils-1.1.0-rc1/tests/generic/t.bogus_arg0000755000175000017500000000071611507575742020701 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" generic_bogus_arg() { test_start "$FUNCNAME: generic bogus argument $XDGUTIL" test_purpose "Ensure that $XDGUTIL exits with an error when called with an unsupported argument." # Dependencies section test_init assert_util_var set_no_display # Test steps section test_procedure assert_exit 1 "$XDGUTIL" "--fobar-bogus-arg" assert_nostdout assert_stderr test_result } GENERIC_TEST="generic_bogus_arg" xdg-utils-1.1.0-rc1/tests/generic/t.no_arg0000755000175000017500000000067611507575742020203 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" generic_no_arg() { test_start "$FUNCNAME: generic noarg - $XDGUTIL" test_purpose "Ensure that $XDGUTIL exits with an error and usage message when called without required arguments." # Dependencies section test_init assert_util_var set_no_display # Test steps section test_procedure assert_exit 1 "$XDGUTIL" assert_stdout assert_nostderr test_result } GENERIC_TEST="generic_no_arg" xdg-utils-1.1.0-rc1/tests/generic/t.help0000755000175000017500000000071311507575742017656 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" generic_help() { test_start "$FUNCNAME: generic help message - $XDGUTIL" test_purpose "Ensure that $XDGUTIL prints it's help message and exits with 0 when called with the --help argument." # Dependencies section test_init assert_util_var set_no_display # Test steps section test_procedure assert_exit 0 "$XDGUTIL" "--help" assert_stdout assert_nostderr test_result } GENERIC_TEST="generic_help" xdg-utils-1.1.0-rc1/tests/debug/0000755000175000017500000000000011507575742016207 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/debug/t.var_bleed0000755000175000017500000000162611507575742020327 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_var_bleed_set() { test_start "$FUNCNAME: set the BLEEDTEST variable" test_procedure export BLEED1=i_am_set BLEED2=set assert_exit 0 export BLEED3="set_within_assert_exit" test_result } test_var_bleed_read() { test_start "$FUNCNAME: read the BLEEDTEST variable" test_procedure assert_exit 0 echo -n "$BLEED1" assert_nostdout assert_nostderr assert_exit 0 echo -n "$BLEED2" assert_nostdout assert_nostderr assert_exit 0 echo -n "$BLEED3" assert_nostdout assert_nostderr assert_exit 0 echo -n "$BLEED4" assert_nostdout assert_nostderr test_result } test_stdout_capture() { test_start "$FUNCNAME: stdout capture test. note: FAIL=PASS" assert_exit 0 echo -n "some output" assert_nostdout assert_nostderr test_result } run_test test_var_bleed_set run_test test_var_bleed_read run_test test_stdout_capture xdg-utils-1.1.0-rc1/tests/debug/t.failoverride0000755000175000017500000000047011507575742021053 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_verify_failoverride() { test_start "$FUNCNAME: verify it works to change a fail to a warn" test_procedure test_fail "Manual failure" test_failoverride WARN test_result } run_test test_verify_failoverride xdg-utils-1.1.0-rc1/tests/debug/t.extraout0000755000175000017500000000043011507575742020247 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_extraout() { test_start "$FUNCNAME: verify functionallity of assert_nostdout" test_procedure assert_exit 0 echo foobar assert_nostdout test_result } run_test test_extraout xdg-utils-1.1.0-rc1/tests/debug/t.interactive0000755000175000017500000000063511507575742020720 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_interactive() { test_start "$FUNCNAME: verify functionallity of assert_interactive" test_procedure assert_interactive "Enter 'y'" y assert_interactive "Enter 'n'" n assert_interactive "neg Enter 'y'" n assert_interactive "neg Enter 'n'" y assert_interactive "Wait" test_result } run_test test_interactive xdg-utils-1.1.0-rc1/tests/debug/t.nodisplay0000755000175000017500000000104111507575742020375 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_nodisplay() { test_start "$FUNCNAME: verify display is not set." test_init echo '#!/bin/bash' > showdisp.sh echo '(echo "DISPLAY:($DISPLAY)")' >> showdisp.sh chmod 755 showdisp.sh echo "Display before: '$DISPLAY'" set_no_display echo "Display after: '$DISPLAY'" test_procedure echo "Display in procedure: '$DISPLAY'" assert_exit 0 ./showdisp.sh assert_stdout assert_nostderr cat out.stdout test_result } run_test test_nodisplay xdg-utils-1.1.0-rc1/tests/debug/README0000644000175000017500000000051011507575742017063 0ustar fboudrafboudraThe "tests" in this directory are here to verify the functionality of the test suite itself. Likely these tests are not useful to a general audience. You should probably not do anything with them unless you have a good idea what they do. Questions should be addressed to the test developer: Tom Whipple xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/0000755000175000017500000000000011507575742020652 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/t.10-file_icon0000755000175000017500000000450311507575742023211 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_file_icon() { test_start "$FUNCNAME: ensure that associations with filetypes is correct." ICON_SIZES="16 22 24 32 48 64 128" test_init # get icon files for i in $ICON_SIZES; do use_file "$XDG_TEST_DIR/icons/red-$i.png" TMP done # get & edit mime file use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/icon_file.xml" MIME_FILE edit_file "$MIME_FILE" 'icontest' MIME_MINOR "x-$XDG_TEST_SHORTID" edit_file "$MIME_FILE" 'xdgtestext' EXT "f$XDG_TEST_SHORTID" MIME_TYPE="xdgtestdata/$MIME_MINOR" TEST_FILE="testfile.$EXT" TEST_DIR="$XDG_TEST_TMPDIR/show" assert_exit 0 mkdir -p "$TEST_DIR" test_procedure # install icons of all sizes for i in $ICON_SIZES; do assert_exit 0 xdg-icon-resource install --context mimetypes --size "$i" "xdgtestdata-$XDG_TEST_ID-red-$i.png" "xdgtestdata-$MIME_MINOR" assert_nostdout assert_nostderr done # associate icons with mime-type assert_exit 0 xdg-mime install "$MIME_FILE" assert_nostdout assert_nostderr cp "$XDG_TEST_DIR/xdg-utils-usecases/data/testfile" "$TEST_DIR/$TEST_FILE" # Wait a little for caches to update sleep 1 # open directory with test file if [ `whoami` != 'root' ] ; then assert_exit 0 xdg-open "$TEST_DIR" assert_nostdout assert_nostderr assert_interactive "Did the file browser open the '$TEST_DIR' directory?" y else assert_interactive "Please open '$TEST_DIR' in the file browser." fi # ask user to cycle through sizes & ensure correct icons are displayed. assert_interactive "Is a file named '$TEST_FILE' present in the directory?" y assert_interactive "Does the icon consist of a red number in the list {$ICON_SIZES}?\n\t(You may need to select something like 'View->As Icons')" y # assert_interactive "Does the number change appropriately when you increase or decrease the view size?" y ## cleanup if [ `whoami` != 'root' ] ; then assert_interactive "Please close any windows opened by this test." C else assert_interactive "You may close the file browser window." C fi # remove icons for i in $ICON_SIZES; do assert_exit 0 xdg-icon-resource uninstall --context mimetypes --size "$i" "xdgtestdata-$MIME_MINOR" assert_nostdout assert_nostderr done # remove mime file assert_exit 0 xdg-mime uninstall "$MIME_FILE" assert_nostdout assert_nostderr test_result } run_test test_file_icon xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/t.14-desktop_menu_icon0000755000175000017500000000347111507575742024776 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_desktop_menu_icon() { test_start "$FUNCNAME: ensure that icons show up correctly in menu." ICON_SIZES="16 22 24 32 48 64 128" test_init # get icon files for i in $ICON_SIZES; do use_file "$XDG_TEST_DIR/icons/red-$i.png" TMP done # get & edit desktop file use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/icon_test.desktop" DESKTOP use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/menu_item_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/menu_install.directory" DIRECTORY edit_file "$DESKTOP" 'Icon Test' ITEM_TEXT "TEST $XDG_TEST_SHORTID" edit_file "$DESKTOP" 'red' ICON_NAME "red-$XDG_TEST_SHORTID" edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" edit_file "$DIRECTORY" 'red' ICON_NAME "red-$XDG_TEST_SHORTID" assert_file "$DESKTOP" assert_file "$DESKTOP2" assert_file "$DIRECTORY" test_procedure # install icons of all sizes for i in $ICON_SIZES; do assert_exit 0 xdg-icon-resource install --size "$i" "xdgtestdata-$XDG_TEST_ID-red-$i.png" "$ICON_NAME" assert_nostdout assert_nostderr done assert_exit 0 xdg-desktop-menu install "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr # Wait a little for caches to update sleep 1 assert_interactive "Is there a menu in
called '$MENU_NAME'?" y assert_interactive "Does the menu '$MENU_NAME' have a red number as its icon?" y assert_interactive "Does the menu entry '$ITEM_TEXT' in '
/$MENU_NAME' have a red number as its icon?" y ## cleanup xdg-desktop-menu uninstall "$DIRECTORY" "$DESKTOP" "$DESKTOP2" > /dev/null 2> /dev/null # remove icons for i in $ICON_SIZES; do xdg-icon-resource uninstall --size "$i" "$ICON_NAME" > /dev/null 2> /dev/null done test_result } run_test test_desktop_menu_iconxdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/data/0000755000175000017500000000000011507575742021563 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/data/mime_launch.xml0000644000175000017500000000044411507575742024570 0ustar fboudrafboudra xdg-utils mime launch test xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/data/mime_launch.desktop0000644000175000017500000000021411507575742025434 0ustar fboudrafboudra[Desktop Entry] Type=Application Name=Mime Launch Test Exec=mime_launch.sh %f Path=/tmp StartupNotify=false MimeType=text/x-xdg-testpattern xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/data/mime_launch.sh0000755000175000017500000000004511507575742024402 0ustar fboudrafboudra#!/bin/sh echo "file: $1" > exec.out xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/data/icon_file.xml0000644000175000017500000000045711507575742024242 0ustar fboudrafboudra xdg-utils icon file association test xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/data/icon_test.desktop0000644000175000017500000000022711507575742025146 0ustar fboudrafboudra[Desktop Entry] Version=1.0 Encoding=UTF-8 Type=Application Exec=touch xdg-test-desktop-icon-install.tmp Name=Icon Test Icon=red StartupNotify=false xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/data/menu_item_dummy.desktop0000644000175000017500000000014611507575742026354 0ustar fboudrafboudra[Desktop Entry] Type=Application Name=EXTRA ITEM Exec=touch xdgtestdata-dummy.tmp StartupNotify=false xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/data/menu_install.directory0000644000175000017500000000007411507575742026204 0ustar fboudrafboudra[Desktop Entry] Type=Directory Name=XDG UTILS TEST Icon=red xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/data/testfile0000644000175000017500000000200011507575742023315 0ustar fboudrafboudraEK>&-uE1 s !~Bܾ#?rdLfp7«@ӉT^g TvQsi+{uKfwݪ\NLLi_Kk#WWĬwM񯢛[L:g{UPwu(8dUXQC pWq},|:^p+ ,'(Ddsن8Ǎ5 .0֘;3ܸ %.퀸('4;k\h׀xӞfdXLJ*˷8 `l6!V*zov5dzTHFd Q|'#( OGDf].Su"R:`} |!\5 [h&[f 6rvh!4{~1y%b[K^V%İTp#L=Ky2c{'&&NK_>ܦo9qi\Kp#_o 4|ӌk/BpfϟCᘠ"D:x@>#MMOѴlWl)<`/ ;-1yQ~]1]Něr{Ѐ-dO wlw{[TO1}Bcq 4LY,XڤnrB#ќL5p#?s^D{ޡ_h~CIrz2|C<0y\$ؾ$H$p8jP]Ḱs}Dxdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/t.01-default_mime_launch0000755000175000017500000000377211507575742025256 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_default_mime_launch() { test_start "$FUNCNAME: verify we can install a mime type & associate it with an application" test_init require_notroot # Set up files use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/mime_launch.xml" MIME_FILE edit_file "$MIME_FILE" "x-xdg-testpattern" MIME2ND "x-$XDG_TEST_ID" edit_file "$MIME_FILE" xdgtest EXTEN "xdgt-$XDG_TEST_SHORTID" use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/mime_launch.sh" SHELL_FILE use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/mime_launch.desktop" DESKTOP_FILE edit_file "$DESKTOP_FILE" "x-xdg-testpattern" TMP "$MIME2ND" edit_file "$DESKTOP_FILE" '/tmp' TMP "$XDG_TEST_TMPDIR" edit_file "$DESKTOP_FILE" 'include' TMP "$XDG_TEST_DIR/include" edit_file "$DESKTOP_FILE" 'mime_launch.sh' TMP "$XDG_TEST_TMPDIR/$SHELL_FILE" TEST_FILE="testfile.$EXTEN" echo "Some text to make the textfile not empty" >"$TEST_FILE" MIME_TYPE="text/$MIME2ND" test_procedure # Install Desktop file assert_exit 0 xdg-desktop-menu install "$DESKTOP_FILE" assert_nostdout assert_nostderr # Install Mime file assert_exit 0 xdg-mime install "$MIME_FILE" assert_nostdout assert_nostderr # Verify mimetype echo "$MIME_TYPE" >out.expected assert_exit 0 xdg-mime query filetype "$TEST_FILE" MIME_INPUT=`cat out.stdout` assert_stdout out.expected assert_nostderr # Verify application is as expected echo "$DESKTOP_FILE" >out.expected assert_exit 0 xdg-mime query default "$MIME_TYPE" assert_stdout out.expected assert_nostderr # Verify correct application opens assert_exit 0 xdg-open "$TEST_FILE" assert_nostdout assert_nostderr echo "file: $XDG_TEST_TMPDIR/$TEST_FILE" >out.expect # exec.out is created by xdg-open assert_file "$XDG_TEST_TMPDIR/exec.out" 'out.expect' #cleanup assert_exit 0 xdg-desktop-menu uninstall "$DESKTOP_FILE" assert_nostdout assert_nostderr assert_exit 0 xdg-mime uninstall "$MIME_FILE" assert_nostdout assert_nostderr test_result } run_test test_default_mime_launch xdg-utils-1.1.0-rc1/tests/xdg-utils-usecases/t.11-desktop_file_icon0000755000175000017500000000362311507575742024745 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_desktop_file_icon() { test_start "$FUNCNAME: ensure that associations with filetypes is correct." ICON_SIZES="16 22 24 32 48 64 128" test_init # get icon files for i in $ICON_SIZES; do use_file "$XDG_TEST_DIR/icons/red-$i.png" TMP done # get & edit desktop file use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/icon_test.desktop" DESKTOP_FILE edit_file "$DESKTOP_FILE" 'red' ICON_NAME TEST_DIR="$XDG_TEST_TMPDIR/show" assert_exit 0 mkdir -p "$TEST_DIR" assert_exit 0 cp "$DESKTOP_FILE" "$TEST_DIR/IconTest.desktop" test_procedure # install icons of all sizes for i in $ICON_SIZES; do assert_exit 0 xdg-icon-resource install --size "$i" "xdgtestdata-$XDG_TEST_ID-red-$i.png" "$ICON_NAME" assert_nostdout assert_nostderr done # Wait a little for caches to update sleep 1 # open directory with test file if [ `whoami` != 'root' ] ; then assert_exit 0 xdg-open "$TEST_DIR" assert_nostdout assert_nostderr assert_interactive "Did the file browser open the '$TEST_DIR' directory?" y else assert_interactive "Please open '$TEST_DIR' in the file browser." fi # ask user to cycle through sizes & ensure correct icons are displayed. assert_interactive "Is a file named either 'Icon Test' or 'IconTest.desktop' present in the directory?" y assert_interactive "Does the icon consist of a red number?\n\t(You may need to select something like 'View->As Icons')" y # assert_interactive "Does the number change appropriately when you increase or decrease the view size?" y ## cleanup if [ `whoami` != 'root' ] ; then assert_interactive "Please close any windows opened by this test." C else assert_interactive "You may close the file browser window." C fi # remove icons for i in $ICON_SIZES; do xdg-icon-resource uninstall --size "$i" "$ICON_NAME" > /dev/null 2> /dev/null done test_result } run_test test_desktop_file_icon xdg-utils-1.1.0-rc1/tests/xdg-desktop-icon/0000755000175000017500000000000011507575742020300 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-desktop-icon/t.01-notexist_file_uninstall0000755000175000017500000000144511507575742025657 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_notexist_file_uninstall() { ## Begin the test. FILE="pain_file_uninstall.txt" test_start "$FUNCNAME: verify uninstalling file does not cause an error if it is not installed." # Dependencies section test_init get_unique_name INSFILE "$FILE" set_no_display echo "Some more boring text" > "$INSFILE" assert_file "$INSFILE" # Verify the test icon is not installed already. assert_file_not_in_path "$INSFILE" "$HOME/Desktop" # Test steps section test_procedure assert_exit 0 xdg-desktop-icon uninstall "$INSFILE" assert_nostdout assert_nostderr assert_file_not_in_path "$INSFILE" "$HOME/Desktop" test_result } run_test test_notexist_file_uninstall xdg-utils-1.1.0-rc1/tests/xdg-desktop-icon/t.05-desktop_icon_uninstall0000755000175000017500000000242211507575742025464 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_desktop_icon_uninstall() { ## Begin the test. DIR="$XDG_TEST_DIR/xdg-desktop-icon/data" FILE="desktop_icon_install.desktop" test_start "$FUNCNAME: verify desktop file is uninstalled correctly from the desktop" DESKTOP="$HOME/Desktop" # Dependencies section test_init use_file "$XDG_TEST_DIR/xdg-desktop-icon/data/desktop_icon_install.desktop" DESK_FILE edit_file "$XDG_TEST_TMPDIR/$DESK_FILE" 'xdg-test-desktop-icon-install.tmp' CREATE_FILE edit_file "$DESK_FILE" 'Desktop_Icon' ICON_TEXT "Uninstall $XDG_TEST_SHORTID" assert_file "$XDG_TEST_TMPDIR/$DESK_FILE" set_no_display # Verify the test icon is not installed already. assert_exit 0 xdg-desktop-icon install "$XDG_TEST_TMPDIR/$DESK_FILE" assert_file_in_path "$DESK_FILE" "$DESKTOP" assert_interactive_notroot "Is an icon named '$ICON_TEXT' present on the desktop?" y # Test steps section test_procedure assert_exit 0 xdg-desktop-icon uninstall "$DESK_FILE" assert_nostdout assert_nostderr assert_file_not_in_path "$DESK_FILE" "$DESKTOP" assert_interactive_notroot "Is an icon named '$ICON_TEXT' still present on the desktop?" n test_result } run_test test_desktop_icon_uninstall xdg-utils-1.1.0-rc1/tests/xdg-desktop-icon/t.00-apply_generic0000755000175000017500000000047511507575742023534 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testcontrol.sh" . "$XDG_TEST_DIR/include/testfuncs.sh" test_note This is a dummy test to run the generic tests for this utility. generic_tests=`ls $XDG_TEST_DIR/generic/t.*` for t in $generic_tests; do . "$t" repeat_test "$GENERIC_TEST" 1 "XDGUTIL" "xdg-desktop-icon" done xdg-utils-1.1.0-rc1/tests/xdg-desktop-icon/t.02-plain_file_install0000755000175000017500000000162511507575742024543 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_plain_file_install() { ## Begin the test. test_start "$FUNCNAME: verify text file is installed correctly on the desktop" # Dependencies section test_init INSFILE="xdgtestdata-$XDG_TEST_SHORTID.txt" set_no_display echo "Some more boring text. $XDG_TEST_ID" > "$INSFILE" assert_file "$INSFILE" DESKTOP="$HOME/Desktop" # Verify the test icon is not installed already. assert_file_not_in_path "$INSFILE" "$DESKTOP" # Test steps section test_procedure assert_exit 0 xdg-desktop-icon install "$INSFILE" assert_nostdout assert_nostderr assert_file_in_path "$INSFILE" "$DESKTOP" assert_interactive_notroot "Is there an icon on the desktop with name '$INSFILE'?" y ## Cleanup xdg-desktop-icon uninstall "$INSFILE" test_result } run_test test_plain_file_install xdg-utils-1.1.0-rc1/tests/xdg-desktop-icon/data/0000755000175000017500000000000011507575742021211 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-desktop-icon/data/desktop_icon_install.desktop0000644000175000017500000000022111507575742027006 0ustar fboudrafboudra[Desktop Entry] Version=1.0 Encoding=UTF-8 Type=Application Exec=touch xdg-test-desktop-icon-install.tmp Name=Desktop_Icon StartupNotify=false xdg-utils-1.1.0-rc1/tests/xdg-desktop-icon/t.04-desktop_icon_install0000755000175000017500000000262511507575742025125 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_desktop_icon_install() { ## Begin the test. test_start "$FUNCNAME: verify a desktop file installed correctly on the desktop" # Dependencies section test_init # Generate .desktop file use_file "$XDG_TEST_DIR/xdg-desktop-icon/data/desktop_icon_install.desktop" DESK_FILE edit_file "$DESK_FILE" 'xdg-test-desktop-icon-install.tmp' CREATE_FILE edit_file "$DESK_FILE" 'Desktop_Icon' ICON_TEXT "Install $XDG_TEST_SHORTID" assert_file "$DESK_FILE" DESKTOP="$HOME/Desktop" set_no_display # Verify the test icon is not installed already. assert_file_not_in_path "$DESK_FILE" "$DESKTOP" assert_nofile "$HOME/$CREATE_FILE" # Test steps section test_procedure assert_exit 0 xdg-desktop-icon install "$DESK_FILE" assert_nostdout assert_nostderr assert_file_in_path "$DESK_FILE" "$DESKTOP" if [ -z "$XDG_TEST_NO_INTERACTIVE" ] && [ `whoami` != root ] ; then assert_interactive "Is there an icon on the desktop with name '$ICON_TEXT'?" y assert_interactive "Please double click the '$ICON_TEXT' icon." ## Double clicking will result in the command 'touch xdg-test-desktop-icon-install.tmp' to be run assert_file "$HOME/$CREATE_FILE" ## Cleanup rm -f "$HOME/$CREATE_FILE" fi xdg-desktop-icon uninstall "$DESK_FILE" >/dev/null 2>&1 test_result } run_test test_desktop_icon_install xdg-utils-1.1.0-rc1/tests/xdg-desktop-icon/t.03-plain_file_uninstall0000755000175000017500000000174311507575742025110 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_plain_file_uninstall() { ## Begin the test. test_start "$FUNCNAME: verify $FILE is uninstalled correctly from the desktop" # Dependencies section test_init INSFILE="xdgtestdata-$XDG_TEST_SHORTID.txt" DESKTOP="$HOME/Desktop" set_no_display echo "Some more boring text" > "$INSFILE" assert_file "$INSFILE" # Verify the test icon is not installed already. assert_exit 0 xdg-desktop-icon install "$INSFILE" assert_file_in_path "$INSFILE" "$DESKTOP" assert_interactive_notroot "Is an icon named '$INSFILE' present on the desktop?" y # Test steps section test_procedure assert_exit 0 xdg-desktop-icon uninstall "$INSFILE" assert_nostdout assert_nostderr assert_file_not_in_path "$INSFILE" "$DESKTOP" assert_interactive_notroot "Is an icon named '$INSFILE' still present on the desktop?" n test_result } run_test test_plain_file_uninstall xdg-utils-1.1.0-rc1/tests/TODO0000644000175000017500000000144511507575742015615 0ustar fboudrafboudraxdg-utils test TODO list: 1. Test the following not-called options: xdg-desktop-icon --novendor xdg-desktop-menu --novendor xdg-email --utf8 xdg-icon-resource --novendor --theme --context 2. Better test the following poorly tested options: xdg-desktop-menu --noupdate xdg-icon-resource --noupdate 3. Make the shinythings/webmirror example into a test case. All parts are currently tested, so this _should_ be an easy pass. 4. Modify testrun and include/testcontrol.sh to print the file name of the test being run, rather than the function name. This is more difficult than it would seem, since the framework is designed to be run by TET for interoperability with the LSB effort. TET mandates that tests be functions named ic1 ... icN. Additionally, the framework allows tests to be repeated. xdg-utils-1.1.0-rc1/tests/xdg-screensaver/0000755000175000017500000000000011507575742020221 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-screensaver/t.01-screensave_status0000755000175000017500000000134311507575742024371 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_screensave_status() { test_start "$FUNCNAME: verify screensaver status returns 'enabled' or 'disabled'" test_purpose "The screensaver may have status 'enabled' or 'disabled'. (Not both as bug 7592.)" test_init require_notroot ## Require a running X server assert_display test_procedure # TODO: check for exactly one of disabled or enabled on output assert_exit 0 xdg-screensaver status assert_stdout assert_nostderr ## See bug 7592 screenstat=`cat out.stdout` assert_exit 0 test "$screenstat" = 'enabled' -o "$screenstat" = 'disabled' test_result } run_test test_screensave_status xdg-utils-1.1.0-rc1/tests/xdg-screensaver/t.00-apply_generic0000755000175000017500000000047411507575742023454 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testcontrol.sh" . "$XDG_TEST_DIR/include/testfuncs.sh" test_note This is a dummy test to run the generic tests for this utility. generic_tests=`ls $XDG_TEST_DIR/generic/t.*` for t in $generic_tests; do . "$t" repeat_test "$GENERIC_TEST" 1 "XDGUTIL" "xdg-screensaver" done xdg-utils-1.1.0-rc1/tests/xdg-screensaver/t.02-screensave_suspend_basic0000755000175000017500000000125011507575742025666 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_screensave_suspend_basic() { test_start "$FUNCNAME: verify screensaver suspend doesn't error" test_init require_notroot ## Require a running X server assert_display assert_exit 0 test ! -z "$WINDOWID" echo "disabled" >out.after sleep 1 test_procedure assert_exit 0 xdg-screensaver suspend "$WINDOWID" assert_nostdout assert_nostderr sleep 1 assert_exit 0 xdg-screensaver status assert_stdout out.after # cleanup xdg-screensaver resume "$WINDOWID" >/dev/null 2>&1 test_result } run_test test_screensave_suspend_basic xdg-utils-1.1.0-rc1/tests/xdg-screensaver/t.11-screensave_reset0000755000175000017500000000153311507575742024172 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_screensave_reset() { test_start "$FUNCNAME: verify screensaver reset" test_init require_notroot require_interactive ## Require a running X server assert_display assert_exit 0 xdg-screensaver status assert_stdout mv out.stdout out.stat assert_interactive "Screensaver will activate 1sec after you press enter, then deactivate in 2 secs. Please be careful not to deactivate it manually." sleep 1 assert_exit 0 xdg-screensaver activate sleep 2 test_procedure assert_exit 0 xdg-screensaver reset assert_nostdout assert_nostderr assert_interactive "Did the screensaver deactivate automatically?" y assert_exit 0 xdg-screensaver status assert_stdout out.stat test_result } run_test test_screensave_reset xdg-utils-1.1.0-rc1/tests/xdg-screensaver/t.10-screensave_activate0000755000175000017500000000142311507575742024645 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_screensave_activate() { test_start "$FUNCNAME: verify screensaver activate" test_init require_notroot require_interactive ## Require a running X server assert_display test_procedure assert_interactive "I will activate the screensaver 1 second after you press enter. Please press shift after it does." assert_exit 0 xdg-screensaver status assert_stdout mv out.stdout out.stat sleep 1 assert_exit 0 xdg-screensaver activate assert_nostdout assert_nostderr sleep 1 assert_interactive "Did the screensaver activate?" y assert_exit 0 xdg-screensaver status assert_stdout out.stat test_result } run_test test_screensave_activate xdg-utils-1.1.0-rc1/tests/xdg-screensaver/t.03-screensave_resume_basic0000755000175000017500000000136411507575742025514 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_screensave_restore_basic() { test_start "$FUNCNAME: verify screensaver restore doesn't error" test_procedure "see also bug 7593" test_init require_notroot ## Require a running X server assert_display assert_exit 0 test ! -z "$WINDOWID" assert_exit 0 xdg-screensaver status assert_stdout mv out.stdout out.prev sleep 1 assert_exit 0 xdg-screensaver suspend "$WINDOWID" test_procedure sleep 1 assert_exit 0 xdg-screensaver resume "$WINDOWID" assert_nostdout assert_nostderr sleep 1 assert_exit 0 xdg-screensaver status assert_stdout out.prev test_result } run_test test_screensave_restore_basic xdg-utils-1.1.0-rc1/tests/xdg-screensaver/t.12-screensave_lock0000755000175000017500000000152211507575742023777 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_screensave_lock() { test_start "$FUNCNAME: verify screensaver lock" test_init require_notroot require_interactive ## Require a running X server assert_display test_procedure assert_interactive "I will lock the screensaver 1 second after you press enter. Please press shift after it does." assert_exit 0 xdg-screensaver status assert_stdout mv out.stdout out.stat sleep 1 assert_exit 0 xdg-screensaver lock assert_nostdout assert_nostderr sleep 1 assert_interactive "Did the screensaver activate?" y assert_interactive "Were you required to enter your password to de-activate it?" y assert_exit 0 xdg-screensaver status assert_stdout out.stat test_result } run_test test_screensave_lock xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/0000755000175000017500000000000011507575742020314 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.10-simple_menu_item_user_install0000755000175000017500000000327111507575742027044 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_simple_menu_item_user_install() { ## Begin the test. test_start "$FUNCNAME: verify a basic desktop file is installed in the user's applications menu" test_purpose "A basic desktop file is installed into the menu." # Dependencies section test_init # Generate .desktop file USERPATH="$HOME/.local" set_no_display use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_category.desktop" DESKTOP edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Categories' ITEM_TEXT "TEST $XDG_TEST_SHORTID" edit_file "$DESKTOP" '/tmp' WORK_DIR "$XDG_TEST_TMPDIR" assert_file "$DESKTOP" # Verify the test icon is not installed already. assert_file_not_in_path "$DESKTOP" "$USERPATH" # Test steps section test_procedure assert_exit 0 xdg-desktop-menu install --mode user "$DESKTOP" assert_nostdout assert_nostderr assert_file_in_path "$DESKTOP" "$USERPATH" if [ -z "$XDG_TEST_NO_INTERACTIVE" -a `whoami` != 'root' ]; then assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree, possibly in a menu dedicated to 'Development'?" y assert_interactive "Please select the menu item '$ITEM_TEXT'" ## Double clicking will result in the command 'touch xdg-test-menu-item-install.tmp' to be run assert_file "$WORK_DIR/$CREATEFILE" fi assert_exit 0 xdg-desktop-menu uninstall --mode user "$DESKTOP" assert_nostdout assert_nostderr assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_interactive_notroot "Is the menu item '$ITEM_TEXT' still present?" n test_result } run_test test_simple_menu_item_user_install xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.00-apply_generic0000755000175000017500000000047511507575742023550 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testcontrol.sh" . "$XDG_TEST_DIR/include/testfuncs.sh" test_note This is a dummy test to run the generic tests for this utility. generic_tests=`ls $XDG_TEST_DIR/generic/t.*` for t in $generic_tests; do . "$t" repeat_test "$GENERIC_TEST" 1 "XDGUTIL" "xdg-desktop-menu" done xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.03-menu_system_forceupdate0000755000175000017500000000070611507575742025660 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## test function test_menu_system_forceupdate() { test_start "$FUNCNAME: verify forceupdate doesn't error for --mode system" test_init set_no_display require_root test_procedure assert_exit 0 xdg-desktop-menu forceupdate --mode system assert_nostdout assert_nostderr test_result } run_test test_menu_system_forceupdate xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.14-menu_install_category0000755000175000017500000000265611507575742025326 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_menu_install_category() { ## Begin the test. test_start "$FUNCNAME: verify that the menu properly supports the '$CATEGORY' category" # Dependencies section test_init # Generate .desktop file #USERPATH="$HOME/.local" set_no_display use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_category.desktop" DESKTOP edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Categories' ITEM_TEXT "TEST $XDG_TEST_SHORTID" edit_file "$DESKTOP" 'Development' TMP "$CATEGORY" edit_file "$DESKTOP" '/tmp' WORK_DIR "$XDG_TEST_TMPDIR" assert_file "$DESKTOP" # Verify the test icon is not installed already. #assert_file_not_in_path "$DESKTOP" "$USERPATH" # Test steps section test_procedure assert_exit 0 xdg-desktop-menu install "$DESKTOP" assert_nostdout assert_nostderr #assert_file_in_path "$DESKTOP" "$USERPATH" #if [ -z "$XDG_TEST_NO_INTERACTIVE" -a `whoami` != 'root' ]; then assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree?\n\tThe item is probably in a menu that is related to '$CATEGORY'?" y #fi ## Cleanup assert_exit 0 xdg-desktop-menu uninstall "$DESKTOP" assert_nostdout assert_nostderr test_result } repeat_test test_menu_install_category 1 CATEGORY AudioVideo Game Office System Education Graphics Network Utility xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.20-simple_menu_item_system_install0000755000175000017500000000335611507575742027417 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_simple_menu_item_system_install() { ## Begin the test. test_start "$FUNCNAME: verify a desktop file is installed in the system applications menu" test_purpose "A basic desktop file is installed into the menu." # Dependencies section test_init # Generate .desktop file USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xdg}" require_root set_no_display use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_category.desktop" DESKTOP edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Categories' ITEM_TEXT "TEST $XDG_TEST_SHORTID" edit_file "$DESKTOP" '/tmp' WORK_DIR "$XDG_TEST_TMPDIR" assert_file "$DESKTOP" # Verify the test icon is not installed already. assert_file_not_in_path "$DESKTOP" "$USERPATH" # Test steps section test_procedure assert_exit 0 xdg-desktop-menu install --mode system "$DESKTOP" assert_nostdout assert_nostderr assert_file_in_path "$DESKTOP" "$USERPATH" if [ -z "$XDG_TEST_NO_INTERACTIVE" ]; then assert_interactive "Is an item called '$ITEM_TEXT' somewhere in the menu tree, possibly in a menu dedicated to 'Development'?" y assert_interactive "Please select the menu item '$ITEM_TEXT'" ## Double clicking will result in the command 'touch xdg-test-menu-item-install.tmp' to be run assert_file "$WORK_DIR/$CREATEFILE" fi assert_exit 0 xdg-desktop-menu uninstall --mode system "$DESKTOP" assert_nostdout assert_nostderr assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_interactive_notroot "Is the menu item '$ITEM_TEXT' still present?" n test_result } run_test test_simple_menu_item_system_install xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.13-menu_user_uninstall0000755000175000017500000000362211507575742025023 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_menu_user_uninstall() { ## Begin the test. test_start "$FUNCNAME: verify a user menu is removed correctly" # Dependencies section test_init USERPATH="$HOME/.local:$HOME/.config:$HOME/.gnome:$HOME/.kde" set_no_display # Generate .desktop file use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.directory" DIRECTORY edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Item Install' ITEM_TEXT "TEST $XDG_TEST_SHORTID" assert_file "$DESKTOP" assert_file "$DIRECTORY" assert_exit 0 xdg-desktop-menu install --mode user "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP" "$USERPATH2" assert_file_in_path "$DIRECTORY" "$USERPATH" assert_interactive_notroot "Is the menu '
/$MENU_NAME present with items 'EXTRA_ITEM' and '$ITEM_TEXT'\n\t(NOTE: If you are using KDE, it may take a few seconds to appear.)" y # Test steps section test_procedure assert_exit 0 xdg-desktop-menu uninstall --mode user "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DESKTOP2" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" assert_interactive_notroot "Is the menu '
/$MENU_NAME' still present?" n assert_interactive_notroot "Is '$ITEM_TEXT' present anywhere in the menu tree?" n test_result # Cleanup xdg-desktop-menu uninstall --mode user "$DIRECTORY" "$DESKTOP" "$DESKTOP2" > /dev/null 2> /dev/null } run_test test_menu_user_uninstall xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot0000755000175000017500000000165611507575742025544 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_menu_system_as_nonroot() { USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:$HOME/.local:$HOME/.config:$XDG_DATA_HOME" ## Begin the test. test_start "$FUNCNAME: verify error for --mode system when run as a normal user" # Dependencies section test_init require_notroot set_no_display use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE assert_file "$DESKTOP" # Test steps section test_procedure assert_exit 3 xdg-desktop-menu install --mode system "$DESKTOP" assert_nostdout assert_stderr assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_exit 3 xdg-desktop-menu uninstall --mode system "$DESKTOP" assert_nostdout assert_stderr test_result } run_test test_menu_system_as_nonroot xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.15-menu_advanced_install0000755000175000017500000000531111507575742025246 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_menu_advanced_install() { ## Begin the test. test_start "$FUNCNAME: verify submenus are handled correctly" # Dependencies section test_init USERPATH="$HOME/.local:$HOME/.config" set_no_display # Generate .desktop file use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_dummy2.desktop" DESKTOP3 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.directory" DIRECTORY edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Item Install' ITEM_TEXT "TEST $XDG_TEST_SHORTID" edit_file "$DESKTOP" '/tmp' WORK_DIR "$XDG_TEST_TMPDIR" assert_file "$DESKTOP" assert_file "$DIRECTORY" # Verify the test icon is not installed already. assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" # Test steps section test_procedure assert_exit 0 xdg-desktop-menu install "$DIRECTORY" "$DESKTOP" "$DESKTOP2" "$DESKTOP3" assert_nostdout assert_nostderr if [ `whoami` != 'root' ]; then assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP2" "$USERPATH" assert_file_in_path "$DESKTOP3" "$USERPATH" assert_file_in_path "$DIRECTORY" "$USERPATH" fi if [ -z "$XDG_TEST_NO_INTERACTIVE" -a `whoami` != 'root' ]; then assert_interactive "Is there a menu in
called '$MENU_NAME'?" y assert_interactive "Are there exactly 3 items in '
/$MENU_NAME' called 'EXTRA ITEM', 'EXTRA ITEM 2' and '$ITEM_TEXT'?" y fi assert_exit 0 xdg-desktop-menu uninstall "$DIRECTORY" "$DESKTOP3" assert_nostdout assert_nostderr if [ `whoami` != 'root' ]; then assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP2" "$USERPATH" assert_file_not_in_path "$DESKTOP3" "$USERPATH" assert_file_in_path "$DIRECTORY" "$USERPATH" fi if [ -z "$XDG_TEST_NO_INTERACTIVE" -a `whoami` != 'root' ]; then assert_interactive "Is there still a menu in
called '$MENU_NAME'?" y assert_interactive "Are there exactly 2 items in '
/$MENU_NAME' called 'EXTRA ITEM' and '$ITEM_TEXT'?" y fi assert_exit 0 xdg-desktop-menu uninstall "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr if [ `whoami` != 'root' ]; then assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DESKTOP2" "$USERPATH" assert_file_not_in_path "$DESKTOP3" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" fi test_result } run_test test_menu_advanced_install xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.22-menu_system_install0000755000175000017500000000410611507575742025024 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_menu_system_install() { ## Begin the test. test_start "$FUNCNAME: verify a system menu is created correctly" # Dependencies section test_init USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xdg}" require_root set_no_display # Generate .desktop file use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.directory" DIRECTORY edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Item Install' ITEM_TEXT "TEST $XDG_TEST_SHORTID" edit_file "$DESKTOP" '/tmp' WORK_DIR "$XDG_TEST_TMPDIR" assert_file "$DESKTOP" assert_file "$DIRECTORY" # Verify the test icon is not installed already. assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" # Test steps section test_procedure assert_exit 0 xdg-desktop-menu install --mode system "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP2" "$USERPATH" assert_file_in_path "$DIRECTORY" "$USERPATH" if [ -z "$XDG_TEST_NO_INTERACTIVE" ]; then assert_interactive "Is there a menu in
called '$MENU_NAME'?\n\t(NOTE: If you are using KDE, it may take a few seconds for the menu to appear.)" y assert_interactive "Are there exactly 2 items in '
/$MENU_NAME' called 'EXTRA ITEM' and '$ITEM_TEXT'?" y assert_interactive "Please select the menu item '
/$MENU_NAME/$ITEM_TEXT'" ## Double clicking will result in the command 'touch xdg-test-menu-item-install.tmp' to be run assert_file "$WORK_DIR/$CREATEFILE" fi ## Cleanup xdg-desktop-menu uninstall --mode system "$DIRECTORY" "$DESKTOP" "$DESKTOP2">/dev/null 2>&1 test_result } run_test test_menu_system_install xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.12-menu_user_install0000755000175000017500000000432011507575742024453 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_menu_user_install() { ## Begin the test. test_start "$FUNCNAME: verify a user menu is created correctly" # Dependencies section test_init USERPATH="$HOME/.local:$HOME/.config" set_no_display # Generate .desktop file use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.directory" DIRECTORY edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Item Install' ITEM_TEXT "TEST $XDG_TEST_SHORTID" edit_file "$DESKTOP" '/tmp' WORK_DIR "$XDG_TEST_TMPDIR" assert_file "$DESKTOP" assert_file "$DIRECTORY" # Verify the test icon is not installed already. assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" # Test steps section test_procedure assert_exit 0 xdg-desktop-menu install --mode user "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP2" "$USERPATH" assert_file_in_path "$DIRECTORY" "$USERPATH" if [ "$GDMSESSION" = "kde" ] ; then # TODO: HACK: this shouldn't be necessary. assert_interactive_notroot "You are running KDE. Please note that KDE takes time to update it's menus. Please refresh the menu several times prior to answering the following questions." fi if [ -z "$XDG_TEST_NO_INTERACTIVE" -a `whoami` != 'root' ]; then assert_interactive "Is there a menu in
called '$MENU_NAME'?" y assert_interactive "Are there exactly 2 items in '
/$MENU_NAME' called 'EXTRA ITEM' and '$ITEM_TEXT'?" y assert_interactive "Please select the menu item '
/$MENU_NAME/$ITEM_TEXT'" ## Double clicking will result in the command 'touch xdg-test-menu-item-install.tmp' to be run assert_file "$WORK_DIR/$CREATEFILE" fi ## Cleanup xdg-desktop-menu uninstall --mode user "$DIRECTORY" "$DESKTOP" "$DESKTOP2">/dev/null 2>&1 test_result } run_test test_menu_user_install xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.01-menu_user_forceupdate0000755000175000017500000000066111507575742025310 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## test function test_menu_user_forceupdate() { test_start "$FUNCNAME: verify forceupdate doesn't error for --mode user" test_init set_no_display test_procedure assert_exit 0 xdg-desktop-menu forceupdate --mode user assert_nostdout assert_nostderr test_result } run_test test_menu_user_forceupdate xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/0000755000175000017500000000000011507575742021225 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/menu_item_dummy2.desktop0000644000175000017500000000015011507575742026073 0ustar fboudrafboudra[Desktop Entry] Type=Application Name=EXTRA ITEM 2 Exec=touch xdgtestdata-dummy.tmp StartupNotify=false xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/menu_item_test.desktop0000644000175000017500000000020011507575742025631 0ustar fboudrafboudra[Desktop Entry] Type=Application Name=Test Menu Item Install Exec=touch /tmp/xdg-test-menu-item-install.tmp StartupNotify=false xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/menu_item_dummy.desktop0000644000175000017500000000014611507575742026016 0ustar fboudrafboudra[Desktop Entry] Type=Application Name=EXTRA ITEM Exec=touch xdgtestdata-dummy.tmp StartupNotify=false xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/shinythings_example/0000755000175000017500000000000011507575742025307 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/shinythings_example/webmirror-admin.desktop0000755000175000017500000000025611507575742032006 0ustar fboudrafboudra[Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror-admintool Icon=webmirror-admintool Name=WebMirror Admin Tool Name[nl]=WebSpiegel Administratie Tool xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/shinythings_example/webmirror.directory0000755000175000017500000000014411507575742031247 0ustar fboudrafboudra[Desktop Entry] Encoding=UTF-8 Icon=webmirror-menu Name=WebMirror Menu Name[nl]=WebSpiegel xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/shinythings_example/install-webmirror.sh0000755000175000017500000000246611507575742031332 0ustar fboudrafboudra#!/bin/bash ## usage: install-webmirror.sh install user ## or ## install-webmirror.sh uninstall system ## etc. c="$1" p="$2" if [ -z "$c" ] ; then c='install' fi if [ -z "$p" ] ; then p="user" fi xdg-icon-resource "$c" --mode "$p" --size 22 ../../../icons/red-22.png webmirror.png xdg-icon-resource "$c" --mode "$p" --size 22 ../../../icons/red-22.png webmirror-menu.png xdg-icon-resource "$c" --mode "$p" --size 22 ../../../icons/red-22.png webmirror-admintool.png xdg-icon-resource "$c" --mode "$p" --size 64 ../../../icons/red-64.png webmirror.png xdg-icon-resource "$c" --mode "$p" --size 64 ../../../icons/red-64.png webmirror-menu.png xdg-icon-resource "$c" --mode "$p" --size 64 ../../../icons/red-64.png webmirror-admintool.png #xdg-desktop-menu "$c" "$p" --vendor shinythings ./webmirror.desktop #xdg-desktop-menu "$c" "$p" --vendor shinythings ./webmirror-admin.desktop #xdg-desktop-menu "$c" "$p" --vendor shinythings ./webmirror.directory #xdg-desktop-menu "$c" "$p" --vendor shinythings ./webmirror.menu xdg-desktop-menu "$c" --mode "$p" --noupdate ./webmirror.desktop xdg-desktop-menu "$c" --mode "$p" --noupdate ./webmirror-admin.desktop xdg-desktop-menu "$c" --mode "$p" --noupdate ./webmirror.directory xdg-desktop-menu "$c" --mode "$p" --noupdate ./webmirror.menu xdg-desktop-menu forceupdate "$p" xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/shinythings_example/webmirror.menu0000755000175000017500000000063211507575742030211 0ustar fboudrafboudra Applications WebMirror Menu webmirror.directory webmirror.desktop webmirror-admin.desktop xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/shinythings_example/webmirror.desktop0000755000175000017500000000017611507575742030721 0ustar fboudrafboudra[Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror Icon=webmirror Name=WebMirror Name[nl]=WebSpiegel xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/menu_install.directory0000644000175000017500000000006311507575742025644 0ustar fboudrafboudra[Desktop Entry] Type=Directory Name=XDG UTILS TEST xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/data/menu_item_category.desktop0000755000175000017500000000022611507575742026502 0ustar fboudrafboudra[Desktop Entry] Type=Application Name=Test Menu Categories Exec=touch /tmp/xdg-test-menu-item-install.tmp Categories=Development; StartupNotify=false xdg-utils-1.1.0-rc1/tests/xdg-desktop-menu/t.23-menu_system_uninstall0000755000175000017500000000420611507575742025371 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_menu_system_uninstall() { ## Begin the test. test_start "$FUNCNAME: verify a system menu is removed correctly" # Dependencies section test_init require_root set_no_display USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:${XDG_CONFIG_DIRS-/etc/xdg}" # Generate .desktop file use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_dummy.desktop" DESKTOP2 use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_install.directory" DIRECTORY edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID" edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE edit_file "$DESKTOP" 'Test Menu Item Install' ITEM_TEXT "TEST $XDG_TEST_SHORTID" assert_file "$DESKTOP" assert_file "$DIRECTORY" # Verify the test icon is not installed already. assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" assert_exit 0 xdg-desktop-menu install --mode system "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_file_in_path "$DESKTOP" "$USERPATH" assert_file_in_path "$DESKTOP" "$USERPATH2" assert_file_in_path "$DIRECTORY" "$USERPATH" assert_interactive "Is the menu '
/$MENU_NAME present with items 'EXTRA_ITEM' and '$ITEM_TEXT'.\n\t(NOTE: If you are using KDE, it may take a few seconds to appear.)" y # Test steps section test_procedure assert_exit 0 xdg-desktop-menu uninstall --mode system "$DIRECTORY" "$DESKTOP" "$DESKTOP2" assert_nostdout assert_nostderr assert_file_not_in_path "$DESKTOP" "$USERPATH" assert_file_not_in_path "$DESKTOP2" "$USERPATH" assert_file_not_in_path "$DIRECTORY" "$USERPATH" assert_interactive "Is the menu '
/$MENU_NAME' still present?\n\t(NOTE: If you are using KDE, it may take a few seconds to disappear.)" n assert_interactive "Is '$ITEM_TEXT' present anywhere in the menu tree?" n test_result # Cleanup xdg-desktop-menu uninstall --mode system "$DIRECTORY" "$DESKTOP" "$DESKTOP2" > /dev/null 2> /dev/null } run_test test_menu_system_uninstall xdg-utils-1.1.0-rc1/tests/spec/0000755000175000017500000000000011507575742016053 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/spec/test_specification.odt0000755000175000017500000006422611507575742022457 0ustar fboudrafboudraPK4^2 ''mimetypeapplication/vnd.oasis.opendocument.textPK4Configurations2/PK4 Pictures/PK4 layout-cache51D@f DC@W;(H$ tq-;|ݫxK?R `;8< 5hVp  `=(tPKcPK4 content.xml}r8NkÒ|{ʵ]nmtϯ ,nQ -{&&ߡr$'3t$PltDm5e"7w݊Hzaz}Dܼ޻o{sz#NI"[Nׁr6&;GNZv b^Xإ \OL732mP՗-~;qƚ|9-DmaT97NqG Kwfտ~p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Y 1 .styles.xmlPK48meta.xmlPK4kF!!m=Thumbnails/thumbnail.pngPK4v ^settings.xmlPK4[vEdMETA-INF/manifest.xmlPK O1fxdg-utils-1.1.0-rc1/tests/spec/test_specification.pdf0000755000175000017500000044144411507575742022443 0ustar fboudrafboudra%PDF-1.4 %äüöß 2 0 obj << /Length 3 0 R /Filter /FlateDecode >> stream x\[~8۱$[a ۧɁB&}ٿ"T. MfԖ-"W߾R] O7.N~ۗK]>|\L}/fU5}e6\^/3>`.H}q]Fܵ#[5.ߗ!B{ƴ4-FbM_-1iF-ca~(gbfϺ,F\AJF:`D.kyg6F9Ӎv|+TR ^`ɷ2Ƭoj! <;LӚܚ8Du#/}Lْ0<&,{=]}I$gaAi9)ه>kL5YītUwȬ5{WbjYducZsm0ydv6Y4BL!:{J`c$X/ci 믶T$cdELӦ 3ReO:LF륽l؈Fוnϋ#DLٲ|d-bcj+}=akv @) 3z<0[iZ6o{OwxCJ}CgMOÅ..}!ڇfմRWI/5zyz &b E&6b)s0Bݢvz޽47-xAY)92,[w1oͻQD*_#r܊C#-6 <ٴ"}? 㯊B7Tm@Zc5Zz Qm~3>R ; 3w>xo-2%] ](p0[E_T` *Nն W:9MM01}3^B- zM''+BPX&j*' fr'ݘ WcI(=r>paC#ΞZpJ6d|QLw.5@+[M$doGެop&s k|ZA4*+\4َ|<ɲӪAzueMJ'HLܳ|\XEژSlzj[3͜z9 W mͽ0!Y*E@C_nry&^2i`'eM{їW33֘\yat&U")+L XN 7{*llZa5%6/'@Hp,!!K #xJ H:DX̢ $%`hBuTqD*RP_dVD`3 `wX6~.'9 /@~{p"!*LiP%yauD1tz[nENqj4QMяK) Մc_'cM.c􃉵&|ũ0)" ʓ'SYum*^B{Z!^s1&L!aSp,݁(IHk Z *= [`p@ !堦wUrEŜ\ l^\z43 Bzxwn:\}M "')2*M!e}/@ep)!U51y oFw)F>073qNǎ^K'WZɅiU)h%?5Mu.BXr e,_Yb#Ꮻ ]z{eFw}=ͬKۗ*??L@?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4JB u[!ٷLf֧HvlJ[e|CY]e9.$I W)dRszR:0Ê-v%k4Oсdсt]2XKt3sp:#48ͼ4gҬ4e!LF: NNT&kФ]f6} _CRaj ni niPMNUzKk['+Qr VjW\i{z|\_tzf .oMYOpfy/˘bc-|2OlXOzף[aAspyFiс[ ,ܛ˝@(ws0ڵ ĚrrX232vs3y\n#Zڮ;88vAV&f&vΠ*o,6oǴhap9c!`,b> !g28 `n'd78D쯚f`#&d oPd endstream endobj 111 0 obj 11618 endobj 112 0 obj << /Type /FontDescriptor /FontName /DAAAAA+CourierNewPSMT /Flags 5 /FontBBox [ -21 -679 636 1020 ] /ItalicAngle 0 /Ascent 832 /Descent -300 /CapHeight 1020 /StemV 80 /FontFile2 110 0 R >> endobj 113 0 obj << /Length 298 /Filter /FlateDecode >> stream x]n@ EH"R !Ģ`Ƥ#a4 `7Q kTK:h~Ҿ pwj{aW궇,=c6 N:Ⱦ'*YV>OјoP;}/Ab|k!_rv(7u21"~%hk}C0(rC-Q©_]>_ &H`K9$qA Aʙ` ۞Y  lNBpfÅ[Ix4t:hI:%mpٝ8 ~??%~ endstream endobj 114 0 obj << /Type /Font /Subtype /TrueType /BaseFont /DAAAAA+CourierNewPSMT /FirstChar 0 /LastChar 15 /Widths [ 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 ] /FontDescriptor 112 0 R /ToUnicode 113 0 R >> endobj 115 0 obj << /Length 116 0 R /Filter /FlateDecode /Length1 56264 >> stream xԼy|T?~ιw>w}rgɬIfLB[  ,DEP)qEJj ؊Za5hmVhR)H&Ϲ >y^ssYv9|u}_t1HZuw BMy'n7C Bܫkz^ooBR\v5oq!r#57"`2!Bc,]Pl@Ucg \!=:++hAO݇f!d@[Ea4=D@@@{{rԇΠ8jAfxN3AvT-讱p5CFe!?p޼gl9P|cBQ';fAdB1}U'c=o F"& PHb$KMd&i#l0BO$y0"fV0^ߘW_1MY]̮eocbξ~((=ʼr*CC8%έn~ōDV?>UUX-} 'ӣ؁A)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vMŇssN;3~v~ ٝg' ~vV07L2nS!@?C'@Ij-A"_cj/{dlTR(yMS}TjKMQԔJKlSS\_[jlA*Uc&q v9ڪD޳v˸D=6?V%&if Q5xlUqkTJPdnvz8[öX*!WɫJki&4hNjdg'g2 VF|\_~H/߯`6j5֨5 i< |:\ej~Px6@mlT\N$l `k[:qiԠ*uɄ!PapՃ-

Z@m%PGr#;s; ?:YURPAQp?J}#~SԾE_Ppn=tP, bj#8v=e2Q([ ,da6)FF mATKKtO-]D÷R+hjuZjuy:͆HX.':~˩^ d{u٫Wͫ%rlkP} Cƣ{ѣ[Uxt:|7QTwQCAL3du-E`LV շxІߟ ᩵೸#?& g aT`~c=N:)V n_5Y ~e` RTG2܉+M<6QLsmV{ 4? m*f[ bo| xC ަxC>fo۷wON.[w\>քGPO0!H`\t4p]u e* }@= [6{ImQBtlTr̎Mrh6,?6F@z1#?:ՈW@ YBRmd1C6#J@Dv #lkFPpkk3Cn`4KA T-i+0# endstream endobj 116 0 obj 36595 endobj 117 0 obj << /Type /FontDescriptor /FontName /CAAAAA+TimesNewRomanPSMT /Flags 4 /FontBBox [ -568 -306 2027 1006 ] /ItalicAngle 0 /Ascent 891 /Descent -216 /CapHeight 1006 /StemV 80 /FontFile2 115 0 R >> endobj 118 0 obj << /Length 598 /Filter /FlateDecode >> stream x]n0E\ )9aO>P K+Y^+E71{86m3ߪc̹i>o .M&VLTÇOu-4}C{"MC4/v _{_i/OG &K8 9eZ?ؘ˭zװXϦMִsvu_H9 endstream endobj 119 0 obj << /Type /Font /Subtype /TrueType /BaseFont /CAAAAA+TimesNewRomanPSMT /FirstChar 0 /LastChar 85 /Widths [ 777 722 722 610 610 277 250 500 277 389 500 333 443 333 277 722 277 500 443 500 443 500 777 500 500 250 500 333 250 500 500 500 500 500 556 722 722 722 500 500 500 722 556 666 666 722 943 500 180 333 333 610 666 277 500 889 333 443 443 500 500 277 500 500 722 722 500 443 722 479 479 563 563 443 500 500 500 722 556 563 920 833 777 500 722 277 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>mYHoYq&p7qPB|rEg|yFַ496&$6u "!c> endobj 123 0 obj << /Length 437 /Filter /FlateDecode >> stream x]j0غO & d1?L:7C#Y>-l>k}*{ߍ&栣9u zoQssȊifD5zdQ/{jG$aG}j<t Ç^ԏ&2{}Q on?MJٚP7j8ZieV]GwSNi?W3P2l93axa-laa ٱ ;6%>#0qk}Jf)^,}rO q<(}g0dO'c>%.^QUn܎'gk8(}L>w qY|xS9m@ }{s at<5L<۝ׯ8r_ݳ endstream endobj 124 0 obj << /Type /Font /Subtype /TrueType /BaseFont /BAAAAA+TimesNewRomanPS-BoldMT /FirstChar 0 /LastChar 47 /Widths [ 777 722 556 500 333 556 333 277 277 389 250 666 443 556 556 443 333 500 500 556 777 443 833 333 722 610 556 722 722 666 500 250 610 722 556 722 500 500 500 500 277 777 500 500 500 500 500 500 ] /FontDescriptor 122 0 R /ToUnicode 123 0 R >> endobj 125 0 obj << /F1 124 0 R /F2 119 0 R /F3 114 0 R >> endobj 126 0 obj << /Font 125 0 R /ProcSet [ /PDF /Text ] >> endobj 1 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Annots [ 82 0 R 108 0 R ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 2 0 R >> endobj 4 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 5 0 R >> endobj 7 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 8 0 R >> endobj 10 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 11 0 R >> endobj 13 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 14 0 R >> endobj 16 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 17 0 R >> endobj 19 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Annots [ 105 0 R 106 0 R 107 0 R ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 20 0 R >> endobj 22 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 23 0 R >> endobj 25 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Annots [ 95 0 R 96 0 R 97 0 R 98 0 R 99 0 R 100 0 R 101 0 R 102 0 R 103 0 R 104 0 R ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 26 0 R >> endobj 28 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Annots [ 92 0 R 93 0 R 94 0 R ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 29 0 R >> endobj 31 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Annots [ 86 0 R 87 0 R 88 0 R 89 0 R 90 0 R 91 0 R ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 32 0 R >> endobj 34 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Annots [ 84 0 R 85 0 R ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 35 0 R >> endobj 37 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Annots [ 83 0 R ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 38 0 R >> endobj 40 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 41 0 R >> endobj 43 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 44 0 R >> endobj 46 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 47 0 R >> endobj 49 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 50 0 R >> endobj 52 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 53 0 R >> endobj 55 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 56 0 R >> endobj 58 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 59 0 R >> endobj 61 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 62 0 R >> endobj 64 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 65 0 R >> endobj 67 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 68 0 R >> endobj 70 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 71 0 R >> endobj 73 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 74 0 R >> endobj 76 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 77 0 R >> endobj 79 0 obj << /Type /Page /Parent 109 0 R /Resources 126 0 R /MediaBox [ 0 0 612 792 ] /Group << /S /Transparency /CS /DeviceRGB /I true >> /Contents 80 0 R >> endobj 109 0 obj << /Type /Pages /Resources 126 0 R /MediaBox [ 0 0 595 842 ] /Kids [ 1 0 R 4 0 R 7 0 R 10 0 R 13 0 R 16 0 R 19 0 R 22 0 R 25 0 R 28 0 R 31 0 R 34 0 R 37 0 R 40 0 R 43 0 R 46 0 R 49 0 R 52 0 R 55 0 R 58 0 R 61 0 R 64 0 R 67 0 R 70 0 R 73 0 R 76 0 R 79 0 R ] /Count 27 >> endobj 82 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [60.7 480 234.8 493.7] /A << /Type /Action /S /URI /URI (http://tetworks.opengroup.org/) >> >> endobj 83 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [74.7 402.8 446.3 416.1] /A << /Type /Action /S /URI /URI (http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html) >> >> endobj 84 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [191.3 376.2 358.1 389.5] /A << /Type /Action /S /URI /URI (mailto:test@user.org?attach=FILE) >> >> endobj 85 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [92.7 615.6 304.9 628.9] /A << /Type /Action /S /URI /URI (mailto:user@test.org?body=some text%25) >> >> endobj 86 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [191.3 150.1 292.1 163.4] /A << /Type /Action /S /URI /URI (mailto:user@test.org) >> >> endobj 87 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [135.5 243.2 216.6 256.5] /A << /Type /Action /S /URI /URI (mailto:user@org) >> >> endobj 88 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [387.5 336.3 454.3 349.6] /A << /Type /Action /S /URI /URI (mailto:test@user.org) >> >> endobj 89 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [195.4 562.4 546.3 575.7] /A << /Type /Action /S /URI /URI (mailto:testTO@user.org?subject=Test Subject&cc=testCC@user.org) >> >> endobj 90 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [92.7 562.4 192.5 575.7] /A << /Type /Action /S /URI /URI (mailto:testBCC@user.org) >> >> endobj 91 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [211 575.7 299.8 589] /A << /Type /Action /S /URI /URI (mailto:testCC2@user.org) >> >> endobj 92 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [195.4 136.8 546.3 150.1] /A << /Type /Action /S /URI /URI (mailto:testTO@user.org?subject=Test Subject&cc=testCC@user.org) >> >> endobj 93 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [92.7 136.8 192.5 150.1] /A << /Type /Action /S /URI /URI (mailto:testBCC@user.org) >> >> endobj 94 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [211 150.1 299.8 163.4] /A << /Type /Action /S /URI /URI (mailto:testCC2@user.org) >> >> endobj 95 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [92.7 136.8 183.6 150.1] /A << /Type /Action /S /URI /URI (mailto:'testTO@user.org) >> >> endobj 96 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [421.4 150.1 512.3 163.4] /A << /Type /Action /S /URI /URI (mailto:'testTO@user.org) >> >> endobj 97 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [118.4 150.1 217.3 163.4] /A << /Type /Action /S /URI /URI (mailto:'testBCC@user.org) >> >> endobj 98 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [446.1 163.4 545 176.7] /A << /Type /Action /S /URI /URI (mailto:'testBCC@user.org) >> >> endobj 99 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [326.6 163.4 417.5 176.7] /A << /Type /Action /S /URI /URI (mailto:'testCC1@user.org) >> >> endobj 100 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [211 163.4 301.9 176.7] /A << /Type /Action /S /URI /URI (mailto:'testCC@user.org) >> >> endobj 101 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [271.5 362.9 356.4 376.2] /A << /Type /Action /S /URI /URI (mailto:'testTO@user.org) >> >> endobj 102 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [326.6 376.2 419.5 389.5] /A << /Type /Action /S /URI /URI (mailto:'testBCC@user.org) >> >> endobj 103 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [211 376.2 295.9 389.5] /A << /Type /Action /S /URI /URI (mailto:'testCC@user.org) >> >> endobj 104 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [193.5 575.7 294.3 589] /A << /Type /Action /S /URI /URI (mailto:user@test.org) >> >> endobj 105 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [198.6 163.4 224.7 176.7] /A << /Type /Action /S /URI /URI (file://./) >> >> endobj 106 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [188 269.8 332.3 283.1] /A << /Type /Action /S /URI /URI (http://someserver/UNIQUE_ID with spaces.txt) >> >> endobj 107 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [282.6 589 308.7 602.3] /A << /Type /Action /S /URI /URI (file://./) >> >> endobj 108 0 obj << /Type /Annot /Subtype /Link /Border [0 0 0] /Rect [92.7 227.3 122.1 240.6] /A << /Type /Action /S /URI /URI (file://./) >> >> endobj 127 0 obj << /Type /Catalog /Pages 109 0 R >> endobj 128 0 obj << /Author /Creator /Producer /CreationDate (D:20060621162115-07'00') >> endobj xref 0 129 0000000000 65535 f 0000133305 00000 n 0000000021 00000 n 0000003473 00000 n 0000133525 00000 n 0000003500 00000 n 0000005624 00000 n 0000133714 00000 n 0000005651 00000 n 0000008004 00000 n 0000133903 00000 n 0000008031 00000 n 0000010073 00000 n 0000134094 00000 n 0000010101 00000 n 0000012375 00000 n 0000134285 00000 n 0000012403 00000 n 0000013140 00000 n 0000134476 00000 n 0000013167 00000 n 0000016471 00000 n 0000134707 00000 n 0000016499 00000 n 0000017307 00000 n 0000134898 00000 n 0000017334 00000 n 0000020226 00000 n 0000135188 00000 n 0000020254 00000 n 0000022815 00000 n 0000135416 00000 n 0000022843 00000 n 0000025991 00000 n 0000135669 00000 n 0000026019 00000 n 0000027924 00000 n 0000135890 00000 n 0000027952 00000 n 0000030765 00000 n 0000136104 00000 n 0000030793 00000 n 0000033112 00000 n 0000136295 00000 n 0000033140 00000 n 0000033581 00000 n 0000136486 00000 n 0000033608 00000 n 0000036017 00000 n 0000136677 00000 n 0000036045 00000 n 0000037931 00000 n 0000136868 00000 n 0000037959 00000 n 0000040392 00000 n 0000137059 00000 n 0000040420 00000 n 0000042692 00000 n 0000137250 00000 n 0000042720 00000 n 0000044861 00000 n 0000137441 00000 n 0000044889 00000 n 0000046340 00000 n 0000137632 00000 n 0000046368 00000 n 0000048521 00000 n 0000137823 00000 n 0000048549 00000 n 0000050725 00000 n 0000138014 00000 n 0000050753 00000 n 0000052461 00000 n 0000138205 00000 n 0000052489 00000 n 0000053375 00000 n 0000138396 00000 n 0000053402 00000 n 0000055863 00000 n 0000138587 00000 n 0000055891 00000 n 0000056976 00000 n 0000139411 00000 n 0000139624 00000 n 0000139885 00000 n 0000140103 00000 n 0000140326 00000 n 0000140532 00000 n 0000140733 00000 n 0000140939 00000 n 0000141187 00000 n 0000141395 00000 n 0000141600 00000 n 0000141848 00000 n 0000142056 00000 n 0000142263 00000 n 0000142471 00000 n 0000142680 00000 n 0000142890 00000 n 0000143098 00000 n 0000143308 00000 n 0000143516 00000 n 0000143726 00000 n 0000143937 00000 n 0000144145 00000 n 0000144350 00000 n 0000144546 00000 n 0000144774 00000 n 0000144968 00000 n 0000138778 00000 n 0000057003 00000 n 0000068731 00000 n 0000068759 00000 n 0000069006 00000 n 0000069390 00000 n 0000069668 00000 n 0000106373 00000 n 0000106401 00000 n 0000106653 00000 n 0000107337 00000 n 0000107946 00000 n 0000131907 00000 n 0000131935 00000 n 0000132192 00000 n 0000132715 00000 n 0000133153 00000 n 0000133230 00000 n 0000145163 00000 n 0000145226 00000 n trailer << /Size 129 /Root 127 0 R /Info 128 0 R /ID [ <2DF3F6F472E5B7A5EB6800BAF416FC6D> <2DF3F6F472E5B7A5EB6800BAF416FC6D> ] >> startxref 145486 %%EOF xdg-utils-1.1.0-rc1/tests/xdg-su/0000755000175000017500000000000011507575742016330 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-su/t.00-apply_generic0000755000175000017500000000046311507575742021561 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testcontrol.sh" . "$XDG_TEST_DIR/include/testfuncs.sh" test_note This is a dummy test to run the generic tests for this utility. generic_tests=`ls $XDG_TEST_DIR/generic/t.*` for t in $generic_tests; do . "$t" repeat_test "$GENERIC_TEST" 1 "XDGUTIL" "xdg-su" done xdg-utils-1.1.0-rc1/tests/xdg-su/t.03-su_badpass0000755000175000017500000000110711507575742021063 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_su_badpass() { test_start "$FUNCNAME: basic su password failure" test_init ## Require a running X server require_notroot require_interactive assert_display test_procedure assert_interactive "Please make sure there no open password prompt windows.\n\tDO NOT enter the correct password when prompted. (Repeat as necessary)" assert_exit 4 xdg-su -c whoami assert_nostdout assert_nostderr test_result } run_test test_su_badpass xdg-utils-1.1.0-rc1/tests/xdg-su/t.04-su_no_carg0000755000175000017500000000073011507575742021060 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_su_no_carg() { test_start "$FUNCNAME: expected error when -c has no option" test_procedure assert_interactive "Please close any open password prompt windows." assert_exit 1 xdg-su -c '' assert_nostdout assert_stderr assert_interactive "Did a password prompt window appear?" n test_result } run_test test_su_no_carg xdg-utils-1.1.0-rc1/tests/xdg-su/t.05-su_no_cflag0000755000175000017500000000102111507575742021213 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_su_no_cflag() { test_start "$FUNCNAME: expected error when no -c arg is present" test_purpose "Verify bug 7136 has been corrected" test_procedure assert_interactive "Please close any open password prompt windows." assert_exit 1 xdg-su whoami assert_nostdout assert_stderr assert_interactive "Did a password prompt window appear?" n test_result } run_test test_su_no_cflag xdg-utils-1.1.0-rc1/tests/xdg-su/t.02-su_basic0000755000175000017500000000121411507575742020525 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_su_basic() { test_start "$FUNCNAME: basic su - up-privilege" test_init ## Require a running X server require_notroot require_interactive assert_display echo "root" >out.expected test_procedure assert_interactive "Please make sure there no open password prompt windows.\n\tEnter the admin password when prompted." assert_exit 0 xdg-su -c 'whoami' assert_stdout out.expected assert_nostderr assert_interactive "Were you prompted for the admin password?" y test_result } run_test test_su_basic xdg-utils-1.1.0-rc1/tests/xdg-su/t.01-su_basic_asroot0000755000175000017500000000074711507575742022125 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_su_basic_asroot() { test_start "$FUNCNAME: basic su already root" test_init require_root assert_display echo "root" >out.expected test_procedure assert_exit 0 xdg-su -c whoami assert_stdout out.expected assert_nostderr assert_interactive "Were you prompted for the admin password?" n test_result } run_test test_su_basic_asroot xdg-utils-1.1.0-rc1/tests/icons/0000755000175000017500000000000011507575742016234 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/icons/red-128.png0000644000175000017500000000517711507575742020036 0ustar fboudrafboudraPNG  IHDRL\ pHYs  tIME #0hYtEXtCommentCreated with The GIMPd%n IDATxLUeǿf\䗈$%SDg2%ckaCpÕG4Vhifs%Dą6f"?T@ő"\ { {;q<}?syh w`,X `1b 0`,X `1b 0`,eGGz=^?}}ppZxzA47CGO //hy_lj8~ee/aj~!ӡO7nl !!XNñc(*¯?= BQcMիC 9t %%Ѵi=+<-l%JCZi- ;G^fz5=[<K?OfߟRid[2kthj￧)0Pi<dfÎD0;;)>^f_(p G6̙*-\H7oӤ.ZB͖| ocYJ]]&7)1Qfh4TZ*B+І i$LGGEΞEUBz:|R]pR~l*YG-hk^{ZGiiTUE!J^"W#co/vI1o ZtP\zRĠLX>\,iFSb~=K."''JMzs./-UMKF=RgCc#؈?슡3lY$$DZ+VȟEErWϣ%K(QQaԠH.hvk ޴OQV,lK \]EgQX(r@WFܿ%[JRZDׇ7fQƜ97!ٳ; 1q.)z:Ϟ-1psOKlF| @yr6HI0anW>-XT'pII\ҬYr11t2ja,844mǏ+uӑF9T]}sωR---[3 V SQ2jޅ41(o/)ؼY//:wNF3f[rij1 ˗U B^-ow3̫ JO7_|ەFqtwuUgƴ};>@nmmm((0v,[BozsۧśdΣNVjݴ[!-mG8:23- g DG`۶ $TI^0YY"')v7UZ[WXFLQ `$jl?t:QڽDە+*JIE (((Ȅ#@e;*jHRlHWvZJ鞙A7΄ϜAx8nߖ^˗N56I<$%c ؿߺgϓ$Vz{'OOQ,?? EQQVjh 3s^~ohġ>Z[!!ܲj=urΝ{kqq"#CJ i\,^,NҚ iΖNskrEVWwرCb{*H\N (2qq&. 9Ybv-yfTKKە=T,޻@?֭ #u_*źxќфў;ZsVf̐{Kx0&}N!&FW8s$ f|vvX:(o2kאbE2] Ed$bcPK jkԄ[ "8: . `1b 0`,X `1b 0J tIENDB`xdg-utils-1.1.0-rc1/tests/icons/red-16.png0000644000175000017500000000073411507575742017744 0ustar fboudrafboudraPNG  IHDRh6 pHYs  tIME /:$~KtEXtCommentCreated with The GIMPd%nRIDAT(ϥJBzlPaWtU0H G-h)[4p+4Df 8ΟC`r >gc6IUJ[}yV,&ȶ@ltlSZѠT 0 rY0˲8,m|lɄ~DLӴ@2I$ ~[W+G\ t l q R)۞FMW\`>uy{X^wZ-ar9$):wT*t3B:>ɉMI$k`gp#͆sq8?vIENDB`xdg-utils-1.1.0-rc1/tests/icons/red-128.xcf0000644000175000017500000000770211507575742020026 0ustar fboudrafboudragimp xcf fileBB/ gimp-commentCreated with The GIMPS gimp-commentCreated with The GIMPgimp-image-grid(style intersections) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches) b128     $gimp-text-layer(text "128") (font "Luxi Sans Bold") (font-size 80.000000) (font-size-unit pixels) (hinting no) (antialias yes) (language "en-us") (base-direction ltr) (color (color-rgba 1.000000 0.000000 0.000000 1.000000)) (justify center) (box-mode dynamic) (box-unit pixels) bb  N } ]] %7BUP#_VP OXP U Y Pp [Pp Pp Pp PpvN5+2Pp2  PpDܝ]H Pp ښ[H P+JH P1H P1H P1H P1H P1H P1H P1H P1H P1H P1H P1H P1H P1H P1H P1H P1H P1H P1H PSH POH PLH PIH PFH PAH P;H P4H P.H P(H PH P@G@6 $3?F?2 ۫j#Hą9^ g Me;  k nA Q M C G D hP  VPd > uA  N . q_ S ! Af ~ ]n m ig J mZK  `9  F-l'   a  \ *d    ? ; &  s C&; N )    Pa>j ~[ .# KL f s m73 p`C ~M;m{ V2E #! $ 2    ~. ^y -sH PH PH P] DH P&H P -H Pw H P% rH P W  H PH P ϸ@_TVpglk<   zH@ 5H: GEH >< KH" ʶ HUH hH QoH !&H >;*ic09TdlmdU8@s aB1! Background     Rj@@xdg-utils-1.1.0-rc1/tests/icons/red-24.png0000644000175000017500000000113211507575742017734 0ustar fboudrafboudraPNG  IHDRo pHYs  tIME +RktEXtCommentCreated with The GIMPd%nIDAT8ݔKaƟ; S.i0­A[]Υ%-&)\,h(tiTht9;<||D[{w~/B!|.]]\0g"AU%@Ma̝rݝ-Ǚp}Bj5# @k5wt$q++|{ *9 3Fwl2c,\+hʭ-.B|FFf(]Dht]*mDB-?+2IENDB`xdg-utils-1.1.0-rc1/tests/icons/red-48.xcf0000644000175000017500000000525611507575742017751 0ustar fboudrafboudragimp xcf file00BB/ gimp-commentCreated with The GIMPS gimp-commentCreated with The GIMPgimp-image-grid(style intersections) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches)  /448     $gimp-text-layer(text "48") (font "Luxi Sans Bold") (font-size 112.000000) (font-size-unit pixels) (hinting no) (antialias yes) (language "en-us") (base-direction ltr) (color (color-rgba 1.000000 0.000000 0.000000 1.000000)) (justify center) (box-mode dynamic) (box-unit pixels) /4/4%                 ! (T  % >ML<I-p'QT4 QY , Q즀 HQ},) Qz%aQOuw=Q\j=xQ@ QW3"QRol\Qzd3QDQI>Q_^[QW' Qt (Qs:TԿEmq\!  FA\!Hq-\!7OI  T  Q@ Qy'Z Q3=  Qz+R` Q" Q- xM2 EzW~00 Background     ` ~00 00    xdg-utils-1.1.0-rc1/tests/icons/red-48.png0000644000175000017500000000252111507575742017745 0ustar fboudrafboudraPNG  IHDR00`n pHYs  tIME '1{-tEXtCommentCreated with The GIMPd%nIDATXKh]LMBҤQZETP1օ"T|T qF\(q" ]X"U#_-X`TbN3I2ѯ.r99>=w8/hN ixQ8Z-kz46RUU*ݸA RW@1ÁreB,зop%͆~n ΟgflqB@J|< ctظ uu<κ|Y:w/\`*i;wfUT*he,S"]+FdyEE <{M}}g^g<)OZ[%fv+ȪUy̭njUyE_}S^N׋@@^T-[%O4:s +r|>U$ߺU8RQb:«;KF#wZ,rǏlBk4j(Ʉ1>) Ʉ]A IlKixhnyc=EIENDB`xdg-utils-1.1.0-rc1/tests/icons/red-24.xcf0000644000175000017500000000326311507575742017737 0ustar fboudrafboudragimp xcf fileBB/ gimp-commentCreated with The GIMPS gimp-commentCreated with The GIMPgimp-image-grid(style intersections) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches) 24     $gimp-text-layer(text "24") (font "Luxi Sans Bold") (font-size 112.000000) (font-size-unit pixels) (hinting no) (antialias yes) (language "en-us") (base-direction ltr) (color (color-rgba 1.000000 0.000000 0.000000 1.000000)) (justify center) (box-mode dynamic) (box-unit pixels) u      ]VVu&[RƽdYm1/8 n)OvYja.IT0S3hhh"Y 5/63zzQzt\ Background     0@@@xdg-utils-1.1.0-rc1/tests/icons/red-64.xcf0000644000175000017500000000600711507575742017742 0ustar fboudrafboudragimp xcf file@@BB/ gimp-commentCreated with The GIMPS gimp-commentCreated with The GIMPgimp-image-grid(style intersections) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches)  0>E64     $gimp-text-layer(text "64") (font "Luxi Sans Bold") (font-size 112.000000) (font-size-unit pixels) (hinting no) (antialias yes) (language "en-us") (base-direction ltr) (color (color-rgba 1.000000 0.000000 0.000000 1.000000)) (justify center) (box-mode dynamic) (box-unit pixels) >E $>E  0                                   6c2Yq|zkR1 /T֟e {||; Y z  ]z # %z  z \` zuJz7  z&z=yvz9vzAvzWyvzEdvz**vzՔ8 mvz7r# vzY BPvzt 4Pvz  vz 4lz vz5?7vzI~vz8vz&(o(.Vl(.2Uv(. Pr(.Yy(.t2222 HzhzH,zzTHzR 1z'z 75z & +z o|z LϝW 6666"@@ Background      @@ @@ xdg-utils-1.1.0-rc1/tests/icons/red-template.xcf0000644000175000017500000000702711507575742021327 0ustar fboudrafboudragimp xcf fileBB/ gimp-commentCreated with The GIMPS gimp-commentCreated with The GIMPgimp-image-grid(style intersections) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches)  |xx     $gimp-text-layer(text "xx") (font "Luxi Sans Bold") (font-size 112.000000) (font-size-unit pixels) (hinting no) (antialias yes) (language "en-us") (base-direction ltr) (color (color-rgba 1.000000 0.000000 0.000000 1.000000)) (justify center) (box-mode dynamic) (box-unit pixels) | | f  C 60I  Ply  S $  K B s  M r 6.  "   m 60I  Ply S $ K B s  M  r 6.  "  i; R Kj H r  |5 5, Ib u RzF!q"#5w%%D'Q()*>( (M&4 $$}3"+ q q" Td  3 @9X  Fx ]#K  [$Z {@  q <>   6 /   X'  , A!a vs $ V8Di; R Kj H r  |5 5, Ib u RzFq5w!!D#Q$%&>$ $M"4  }3+qq" Td  3 @9X  Fx ]#K  [$Z { @  q <>  6 /  X' , A!a vs $ V8DIXXXX>E" Background        @@xdg-utils-1.1.0-rc1/tests/icons/red-64.png0000644000175000017500000000304211507575742017742 0ustar fboudrafboudraPNG  IHDR@@% pHYs  tIME %6׬tEXtCommentCreated with The GIMPd%nIDAThZHS_lGjXi&4-/(!*E` D "FJM,I6tj涊Ͻ~=s{e/////7 >@R "G@J`ta`dP(5k@&s~P&.]uRaZJEef"YYtYcmFUGm0N?~D^+|Ta:@&^Vtt`aX+YRmѬ7֭yq-(yyt{ "e3WW3Z# 07IO77I\P@XYwnqqde\ҩP/_<(yJJP_dfb.\BA8z] Os4Ѹzթ`h$= e?b^r&m:ECCDvg TΆOҐuܿ$'D4d2fl RǙѿc8ܽ ??g:qz91oÇ:̡!dfbp%$83<;cl| [ƍLݼs0%%/ff3۱î4 $׋C~+av2ow;QYij y#Ɓ|kqR/TWs4AAT08ݻ=t owEUž(<#MM0`&`]](+#EEhhh.ŋ3ݎ'M)'GľO$ kO /^0aZ8R" ń>5ǏQWgߏ16:4mB"!ϟO/14|ʹz5 ]Z a*QQXmm|}K%Ou:NjyRZ7&WUM0E@.kIHN&tuYkg0HeᚐX􄏎%K!"}axB+G>tH:̞Db61/ݙ-h4SO`6:ooyاOr KIFt+FFZw%ld:z+rmn ΦM3ۉHe ϧ_N|pP_?A "޾šC΄ SVG xdg-utils-1.1.0-rc1/tests/icons/red-32.xcf0000644000175000017500000000366611507575742017745 0ustar fboudrafboudragimp xcf file BB/ gimp-commentCreated with The GIMPS gimp-commentCreated with The GIMPgimp-image-grid(style intersections) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches) #32     $gimp-text-layer(text "32") (font "Luxi Sans Bold") (font-size 112.000000) (font-size-unit pixels) (hinting no) (antialias yes) (language "en-us") (base-direction ltr) (color (color-rgba 1.000000 0.000000 0.000000 1.000000)) (justify center) (box-mode dynamic) (box-unit pixels) ##                         ==!!" Rׄ#qK(vp﵊sN K+dO*3FK?b E&7\?, r?!W=W`}UPA C0J/ @ L3=!V LzSS o7$@%p ? Op ?*f :%HbkbD Background     @  xdg-utils-1.1.0-rc1/tests/icons/red-22.xcf0000644000175000017500000000316711507575742017740 0ustar fboudrafboudragimp xcf fileBB/ gimp-commentCreated with The GIMPS gimp-commentCreated with The GIMPgimp-image-grid(style intersections) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches) 22     $gimp-text-layer(text "22") (font "Luxi Sans Bold") (font-size 112.000000) (font-size-unit pixels) (hinting no) (antialias yes) (language "en-us") (base-direction ltr) (color (color-rgba 1.000000 0.000000 0.000000 1.000000)) (justify center) (box-mode dynamic) (box-unit pixels) i Ti D|d"c;>^R8| ks=InC5V374L(z3m#`zMr:".feeeeRHP;BS Background     ,G[kxdg-utils-1.1.0-rc1/tests/icons/red-32.png0000644000175000017500000000157111507575742017742 0ustar fboudrafboudraPNG  IHDR  pHYs  tIME )tEXtCommentCreated with The GIMPd%nIDATHVK(|aeu  %ecD%[vK KI{#lX<(_|s*q;|wk" ,L"χ@f3(|QVV25LI$QQVz vwɴZi2lΊ NO1 3trgG$OO&YY˅DEasnB,/dR./"䀄ǃ5Lg'ZZML^&-a*-e_}> Y[+HWNqf|\&UFej&:ՕQT][((0&l_K+~PfgToo?|\Y)I֗\C\\ Znn;ե)oLJbc# ݌P2:K%DGsdcc4UX.,sseuZF5Zs&0:Zc#)phLQMyy `$dY诮ąE]b>CP_/ iiFp:ïAu &'bNbofcI {{}z<( T瞞OM賸H2d&N.add`[,p8)@import url(\"layout.css\");\n"; my $root_header = qq{| Tests | Assertions | Overview |


\n}; my $group_header = qq{| Tests | Assertions | Overview |
\n}; my $footer = "
xdg-utils test documentation generated $now\n"; my %fcns; my %group; my %shortdesc; ## Read assertion file open IN, 'include/testassertions.sh' or die "Failed to open assertion file: $!\n"; my $state = 'NULL'; my %assertions; while ( ) { if ( m/(\w+)\s*\(\)/ ) { $state = $1; $assertions{$state} = (); } elsif ( $state ne 'NULL' and m/^#(.*)/ ) { my $txt = $1; chomp $txt; push @{ $assertions{$state} }, $txt; } else { $state = 'NULL'; } } close IN; if ( ! -d 'doc' ) { mkdir 'doc'; } open OUT, ">doc/$assert_doc" or die "Failed to open $assert_doc: $!\n"; print OUT "xdg-utils test assertions$style\n$root_header"; my @s_assert = sort keys %assertions ; print OUT qq{

Defined Assertions in include/testassertions.sh

\n}; for $a ( @s_assert ) { print OUT qq{$a
\n}; } for $a ( @s_assert ) { print OUT qq{

$a

\n}; print OUT "
", join("\n",@{ $assertions{$a} } ), "
\n"; } print OUT "$footer"; ## Read test files for $f ( @test_files ) { open IN, $f or die "Failed to open $f: $!\n"; $f =~ m{(.+)/t\.(.+)}; my $dir = $1; my $test = $2; `mkdir -p doc/$dir`; my $o = "doc/$dir/$test.html"; push @{ $group{$dir} }, $test; open HTM, ">$o" or die "Failed to open '$o': $!\n"; print HTM "xdg-utils test: $f\n"; print HTM $style; print HTM "$group_header

Test: $f


\n"; my $fcn = ''; my $state = 'BEGIN'; while ( ) { #find the test function if ( m/(\w+)\s*\(\)/ ) { $fcn = $1; if (defined $fcns{$fcn} ){ print "WARNING in $f: $fcn already exists in $fcns{$fcn}!\n" } $fcns{$fcn} = $f; $state = 'FUNCTION'; } #find test_start elsif ( m/test_start (.*)/ ) { print HTM "

Purpose of $fcn

"; my $txt = $1; $txt =~ s/\$FUNCNAME:*\s*//; $txt =~ s/\"//g; $shortdesc{ $test } = $txt; print HTM "

$txt

\n"; $state = 'START'; } #find test_purpose elsif ( m/test_purpose (.*)/ ) { print HTM "

Description

"; my $txt = $1; $txt =~ s/\"//g; print HTM "

$txt

\n"; } #find initilization elsif ( m/test_init/ ) { print HTM "

Depencencies

\n"; $state = 'INIT'; next; } elsif ( m/test_procedure/ ) { print HTM "

Test Procedure

\n"; $state = 'TEST'; next; } elsif ( m/test_note (.*)/ ) { print HTM "

Note

$1

\n"; next; } elsif ( m/test_result/ ) { $state = 'DONE'; } if ( m/^#/ ) { next; } if ( $state eq 'INIT' or $state eq 'TEST' ) { $line = $_; $line =~ s/^\s*(\w+)/$1<\/a>/; if ( $assertions{$1} ) { print HTM "

$line

\n"; #print "$f:\t'$1' found\n"; } else { #print "$f:\t'$1' not found\n"; print HTM "

$_

\n"; } #print HTM "

$_

\n"; } } print HTM "$footer\n"; close HTM; close IN; } open INDEX, ">doc/index.html" or die "Could not open index: $!"; print INDEX "xdg-utils test suite\n"; print INDEX $style; print INDEX "$root_header

xdg-utils test documentation

"; my @s_groups = sort keys %group; for $g ( @s_groups ) { print INDEX qq{
$g \n}; } print INDEX "\n"; for $k ( @s_groups ) { print INDEX qq{\n}; for $i ( @{ $group{$k} } ) { print INDEX "\n"; } } print INDEX "

$k

$i$shortdesc{$i}
$footer\n"; close INDEX; #print Dumper keys %assertions; xdg-utils-1.1.0-rc1/tests/xdg-icon-resource/0000755000175000017500000000000011507575742020456 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-icon-resource/t.icon_nonexist_uninstall0000755000175000017500000000175211507575742025623 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_icon_nonexist_uninstall() { test_start "$FUNCNAME: verify $ICON is uninstalled correctly even if it is not installed" ## Begin the test. userpath="$HOME/.icons:$HOME/.local:$XDG_DATA_HOME" # Dependencies section test_init set_no_display use_file "$XDG_TEST_DIR/icons/$ICON" ICON_FILE assert_file "$ICON_FILE" # Verify the test icon is not installed already. assert_file_not_in_path "$ICON_FILE" "$userpath" # Test steps section test_procedure assert_exit 0 xdg-icon-resource uninstall --mode user --size "$SIZE" "$ICON_FILE" assert_nostdout assert_nostderr assert_file_not_in_path "$ICON_FILE" "$userpath" test_result } repeat_test test_icon_nonexist_uninstall 2 ICON SIZE 'red-16.png' 'red-22.png' 'red-24.png' 'red-32.png' 16 22 24 32 repeat_test test_icon_nonexist_uninstall 2 ICON SIZE 'red-48.png' 'red-64.png' 'red-128.png' 48 64 128 xdg-utils-1.1.0-rc1/tests/xdg-icon-resource/t.icon_user_uninstall0000755000175000017500000000201011507575742024716 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_icon_user_uninstall() { test_start "$FUNCNAME: verify $ICON is uninstalled correctly" ## Begin the test. userpath="$HOME/.icons:$HOME/.local:$XDG_DATA_HOME" # Dependencies section test_init set_no_display use_file "$XDG_TEST_DIR/icons/$ICON" ICONFILE assert_file "$ICONFILE" # Verify the test icon is not installed already. assert_exit 0 xdg-icon-resource install --mode user --size "$SIZE" "$ICONFILE" assert_file_in_path "$ICONFILE" "$userpath" # Test steps section test_procedure assert_exit 0 xdg-icon-resource uninstall --mode user --size "$SIZE" "$ICONFILE" assert_nostdout assert_nostderr assert_file_not_in_path "$ICONFILE" "$userpath" test_result } repeat_test test_icon_user_uninstall 2 ICON SIZE 'red-16.png' 'red-22.png' 'red-24.png' 'red-32.png' 16 22 24 32 repeat_test test_icon_user_uninstall 2 ICON SIZE 'red-48.png' 'red-64.png' 'red-128.png' 48 64 128 xdg-utils-1.1.0-rc1/tests/xdg-icon-resource/t.icon_system_uninstall0000755000175000017500000000211711507575742025274 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_icon_system_uninstall() { test_start "$FUNCNAME: verify $ICON is uninstalled correctly with --mode system" ## Begin the test. systempath="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps" # Dependencies section test_init require_root set_no_display use_file "$XDG_TEST_DIR/icons/$ICON" ICONFILE assert_file "$ICONFILE" # Verify the test icon is not installed already. assert_exit 0 xdg-icon-resource install --mode system --size "$SIZE" "$ICONFILE" assert_file_in_path "$ICONFILE" "$systempath" # Test steps section test_procedure assert_exit 0 xdg-icon-resource uninstall --mode system --size "$SIZE" "$ICONFILE" assert_nostdout assert_nostderr assert_file_not_in_path "$ICONFILE" "$systempath" test_result } repeat_test test_icon_system_uninstall 2 ICON SIZE 'red-16.png' 'red-22.png' 'red-24.png' 'red-32.png' 16 22 24 32 repeat_test test_icon_system_uninstall 2 ICON SIZE 'red-48.png' 'red-64.png' 'red-128.png' 48 64 128 xdg-utils-1.1.0-rc1/tests/xdg-icon-resource/t.icon_user_install0000755000175000017500000000176311507575742024371 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_icon_user_install() { test_start "$FUNCNAME: verify $ICON is installed correctly" ## Begin the test. userpath="$HOME/.icons:$HOME/.local:$XDG_DATA_HOME" # Dependencies section test_init set_no_display use_file "$XDG_TEST_DIR/icons/$ICON" ICONFILE assert_file "$ICONFILE" # Verify the test icon is not installed already. assert_file_not_in_path "$ICONFILE" "$userpath" # Test steps section test_procedure assert_exit 0 xdg-icon-resource install --mode user --size "$SIZE" "$ICONFILE" assert_nostdout assert_nostderr assert_file_in_path "$ICONFILE" "$userpath" xdg-icon-resource uninstall --mode user --size "$SIZE" "$ICONFILE" test_result } repeat_test test_icon_user_install 2 ICON SIZE 'red-16.png' 'red-22.png' 'red-24.png' 'red-32.png' 16 22 24 32 repeat_test test_icon_user_install 2 ICON SIZE 'red-48.png' 'red-64.png' 'red-128.png' 48 64 128 xdg-utils-1.1.0-rc1/tests/xdg-icon-resource/t.icon_duplicate_install0000755000175000017500000000217411507575742025362 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_icon_duplicate_install() { test_start "$FUNCNAME: verify $ICON is installed correctly after already being installed" ## Begin the test. userpath="$HOME/.icons:$HOME/.local:$XDG_DATA_HOME" # Dependencies section test_init set_no_display use_file "$XDG_TEST_DIR/icons/$ICON" ICON_FILE assert_file "$ICON_FILE" # Verify the test icon is not installed already. assert_exit 0 xdg-icon-resource install --mode user --size "$SIZE" "$ICON_FILE" assert_file_in_path "$ICON_FILE" "$userpath" # Test steps section test_procedure assert_exit 0 xdg-icon-resource install --mode user --size "$SIZE" "$ICON_FILE" assert_nostdout assert_nostderr assert_file_in_path "$ICON_FILE" "$userpath" # Cleanup xdg-icon-resource uninstall --mode user --size "$SIZE" "$ICON_FILE" test_result } repeat_test test_icon_duplicate_install 2 ICON SIZE 'red-16.png' 'red-22.png' 'red-24.png' 'red-32.png' 16 22 24 32 repeat_test test_icon_duplicate_install 2 ICON SIZE 'red-48.png' 'red-64.png' 'red-128.png' 48 64 128 xdg-utils-1.1.0-rc1/tests/xdg-icon-resource/t.icon_system_install0000755000175000017500000000214411507575742024731 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_icon_system_install() { test_start "$FUNCNAME: verify $ICON is installed correctly with --mode system" ## Begin the test. icondir="$XDG_TEST_DIR/icons" systempath="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps" # Dependencies section test_init require_root set_no_display use_file "$XDG_TEST_DIR/icons/$ICON" ICONFILE assert_file "$ICONFILE" # Verify the test icon is not installed already. assert_file_not_in_path "$ICONFILE" "$systempath" # Test steps section test_procedure assert_exit 0 xdg-icon-resource install --mode system --size "$SIZE" "$ICONFILE" assert_nostdout assert_nostderr assert_file_in_path "$ICONFILE" "$systempath" ## Cleanup xdg-icon-resource uninstall --mode system --size "$SIZE" "$ICONFILE" test_result } repeat_test test_icon_system_install 2 ICON SIZE 'red-16.png' 'red-22.png' 'red-24.png' 'red-32.png' 16 22 24 32 repeat_test test_icon_system_install 2 ICON SIZE 'red-48.png' 'red-64.png' 'red-128.png' 48 64 128 xdg-utils-1.1.0-rc1/tests/xdg-icon-resource/t.apply_generic0000755000175000017500000000047611507575742023476 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testcontrol.sh" . "$XDG_TEST_DIR/include/testfuncs.sh" test_note This is a dummy test to run the generic tests for this utility. generic_tests=`ls $XDG_TEST_DIR/generic/t.*` for t in $generic_tests; do . "$t" repeat_test "$GENERIC_TEST" 1 "XDGUTIL" "xdg-icon-resource" done xdg-utils-1.1.0-rc1/tests/xdg-icon-resource/t.icon_system_as_nonroot0000755000175000017500000000175011507575742025446 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_icon_system_as_nonroot() { ICON_PATH="$HOME/.icons:${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps:$HOME/.local/icons:$XDG_DATA_HOME" ## Begin the test. test_start "$FUNCNAME: verify error for --mode system when run as a normal user" # Dependencies section test_init require_notroot set_no_display use_file "$XDG_TEST_DIR/icons/red-32.png" ICONFILE assert_file "$ICONFILE" # Verify the test icon is not installed already. assert_file_not_in_path "$ICONFILE" "$ICON_PATH" # Test steps section test_procedure assert_exit 3 xdg-icon-resource install --mode system --size 32 "$ICONFILE" assert_nostdout assert_stderr assert_file_not_in_path "$ICONFILE" "$ICON_PATH" assert_exit 3 xdg-icon-resource uninstall --mode system --size 32 "$ICONFILE" assert_nostdout assert_stderr test_result } run_test test_icon_system_as_nonroot xdg-utils-1.1.0-rc1/tests/xdg-open/0000755000175000017500000000000011507575742016642 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-open/t.05-open_abs_path_html0000755000175000017500000000136411507575742023106 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function FILE=testfile.html test_open_abs_path_html() { test_start "$FUNCNAME: open absolute path of the form '$PRE/path/file.html'" test_init require_notroot ## Require a running X server assert_display echo 'I am an HTML file!' >"$FILE" assert_file "$FILE" test_procedure assert_exit 0 xdg-open "$PRE$XDG_TEST_TMPDIR/$FILE" assert_nostdout assert_nostderr assert_interactive "Did an HTML file open containing the text 'I am an HTML file!'?" y assert_interactive "Please close any windows opened by this test." C test_result } repeat_test test_open_abs_path_html 1 PRE '' 'file://' xdg-utils-1.1.0-rc1/tests/xdg-open/t.00-apply_generic0000755000175000017500000000046611507575742022076 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testcontrol.sh" . "$XDG_TEST_DIR/include/testfuncs.sh" test_note This is a dummy test to run the generic tests for this utility. generic_tests=`ls $XDG_TEST_DIR/generic/t.*` for t in $generic_tests; do . "$t" repeat_test "$GENERIC_TEST" 1 "XDGUTIL" "xdg-open" done xdg-utils-1.1.0-rc1/tests/xdg-open/t.03-open_url0000755000175000017500000000106511507575742021077 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_open_url() { test_start "$FUNCNAME: HTTP open test." URL="http://portland.freedesktop.org/wiki/" test_init require_notroot ## Require a running X server assert_display test_procedure assert_exit 0 xdg-open "$URL" assert_nostdout assert_nostderr assert_interactive "Did a web browser open to '$URL'" y assert_interactive "Please close any windows opened by this test." C test_result } run_test test_open_url xdg-utils-1.1.0-rc1/tests/xdg-open/t.04-open_html0000755000175000017500000000125111507575742021237 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function FILE=testfile.html test_open_html() { test_start "$FUNCNAME: open '$PRE$FILE'" test_init require_notroot ## Require a running X server assert_display echo 'I am an HTML file!' >"$FILE" assert_file "$FILE" test_procedure assert_exit 0 xdg-open "$PRE$FILE" assert_nostdout assert_nostderr assert_interactive "Did an HTML file open containing the text 'I am an HTML file!'?" y assert_interactive "Please close any windows opened by this test." C test_result } repeat_test test_open_html 1 PRE '' './' xdg-utils-1.1.0-rc1/tests/xdg-open/t.01-open_basic0000755000175000017500000000121311507575742021347 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_open_basic() { test_start "$FUNCNAME: verify basic file open test." test_init require_notroot ## Require a running X server assert_display get_unique_name TARG 'open.txt' echo "I am open." > $TARG assert_file "$TARG" test_procedure assert_exit 0 xdg-open $TARG assert_nostdout assert_nostderr assert_interactive "Did a text editor open a file containing the string 'I am open.'?" y assert_interactive "Please close any windows opened by this test." C test_result } run_test test_open_basic xdg-utils-1.1.0-rc1/tests/xdg-open/t.02-open_dir0000755000175000017500000000105611507575742021052 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_open_dir() { test_start "$FUNCNAME: verify basic directory open test." test_init require_notroot ## Require a running X server assert_display test_procedure assert_exit 0 xdg-open "$XDG_TEST_DIR" assert_nostdout assert_nostderr assert_interactive "Did a file browser open to $XDG_TEST_DIR?" y assert_interactive "Please close any windows opened by this test." C test_result } run_test test_open_dir xdg-utils-1.1.0-rc1/tests/.gitignore0000644000175000017500000000001111507575742017101 0ustar fboudrafboudraMakefile xdg-utils-1.1.0-rc1/tests/NOTES0000644000175000017500000000075311507575742015741 0ustar fboudrafboudraTest notes for xdg-desktop-icon ------------------------------- 1. Double install behavior is not well defined. Should installing two files with the same name onto the desktop generate errors, or should the older be overwritten? Test notes for xdg-email ------------------------ 1. When running --attach tests, there is a bug in evolution (SUSE 10.0/Gnome) so that the attachment window is not displayed, yet there is still an attachment present. To see it, you must attach a second file. xdg-utils-1.1.0-rc1/tests/include/0000755000175000017500000000000011507575742016544 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/include/linux_distro0000755000175000017500000001453611507575742021226 0ustar fboudrafboudra#!/usr/bin/perl ######################################################################## package Linux::Distribution; use 5.006000; use strict; use warnings; require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw( distribution_name distribution_version ); our $VERSION = '0.14.1'; our $standard_release_file = 'lsb-release'; our %primary_release_files = ( 'debian_version' => 'debian', 'debian_release' => 'debian', 'redhat-release' => 'redhat', 'redhat_version' => 'redhat', ); our %secondary_release_files = ( 'gentoo-release' => 'gentoo', 'fedora-release' => 'fedora', 'turbolinux-release' => 'turbolinux', 'mandrake-release' => 'mandrake', 'mandrakelinux-release' => 'mandrakelinux', 'mandriva-release' => 'mandriva', 'SuSE-release' => 'suse', 'knoppix-version' => 'knoppix', 'yellowdog-release' => 'yellowdog', 'slackware-version' => 'slackware', 'slackware-release' => 'slackware', 'redflag-release' => 'redflag', 'conectiva-release' => 'conectiva', 'immunix-release' => 'immunix', 'tinysofa-release' => 'tinysofa', 'trustix-release' => 'trustix', 'adamantix_version' => 'adamantix', 'yoper-release' => 'yoper', 'arch-release' => 'arch', 'libranet_version' => 'libranet', 'va-release' => 'va-linux', 'xandros-desktop-version' => 'xandros', ); our %version_match = ( 'gentoo' => 'Gentoo Base System version (.*)', 'debian' => '(.+)', 'suse' => 'VERSION = (.*)', 'fedora' => 'Fedora Core release (\d+) \(', 'redflag' => 'Red Flag (?:Desktop|Linux) (?:release |\()(.*?)(?: \(.+)?\)', 'redhat' => 'Red Hat (?:Desktop|Linux) release (.*) \(', 'slackware' => '^Slackware (.+)$', 'mandriva' => 'Mandriva Linux release (\d+.\d+) \(', 'arch' => 'Arch Linux (.*) \(', 'xandros' => 'Version: Xandros Desktop OS (.+)' ); if ($^O ne 'linux') { require Carp; Carp::croak 'you are trying to use a linux specific module on a different OS'; } sub new { my %self = ( 'DISTRIB_ID' => '', 'DISTRIB_RELEASE' => '', 'DISTRIB_CODENAME' => '', 'DISTRIB_DESCRIPTION' => '', 'release_file' => '', 'pattern' => '' ); return bless \%self; } sub distribution_name { my $self = shift || new(); my $distro; if ($distro = $self->_get_lsb_info()){ return $distro if ($distro); } foreach (keys %secondary_release_files) { if (-f "/etc/$_" && !-l "/etc/$_"){ if (-f "/etc/$_" && !-l "/etc/$_"){ $self->{'DISTRIB_ID'} = $secondary_release_files{$_}; $self->{'release_file'} = $_; return $self->{'DISTRIB_ID'}; } } } foreach (keys %primary_release_files) { if (-f "/etc/$_" && !-l "/etc/$_"){ if (-f "/etc/$_" && !-l "/etc/$_"){ $self->{'DISTRIB_ID'} = $primary_release_files{$_}; $self->{'release_file'} = $_; return $self->{'DISTRIB_ID'}; } } } undef } sub distribution_version { my $self = shift || new(); my $release; return $release if ($release = $self->_get_lsb_info('DISTRIB_RELEASE')); if (! $self->{'DISTRIB_ID'}){ $self->distribution_name() or die 'No version because no distro.'; } $self->{'pattern'} = $version_match{$self->{'DISTRIB_ID'}}; return "unknown" if (! $self->{'pattern'}); return "unknown" if (! ($release = $self->_get_file_info())); $self->{'DISTRIB_RELEASE'} = $release; return $release; } sub _get_lsb_info { my $self = shift; my $field = shift || 'DISTRIB_ID'; my $tmp = $self->{'release_file'}; if ( -r '/etc/' . $standard_release_file ) { $self->{'release_file'} = $standard_release_file; $self->{'pattern'} = $field . '=(.+)'; my $info = $self->_get_file_info(); if ($info){ $self->{$field} = $info; return $info } } $self->{'release_file'} = $tmp; $self->{'pattern'} = ''; undef; } sub _get_file_info { my $self = shift; open FH, '/etc/' . $self->{'release_file'} or die 'Cannot open file: /etc/' . $self->{'release_file'}; my $info = ''; while (){ chomp $_; ($info) = $_ =~ m/$self->{'pattern'}/; return "\L$info" if $info; } undef; } 1; # Simple script to use the above perl module to print the distro name if (my $distro = distribution_name) { my $version = distribution_version(); print "$distro $version\n"; } else { print "distribution unknown\n"; } __END__ =head1 NAME linux_distro - tool for printing the current linux distribution =head1 SYNOPSIS linux_distro =head1 DESCRIPTION This is a simple tool that tries to guess on what linux distribution we are running by looking for release's files in /etc. It now looks for 'lsb-release' first as that should be the most correct and adds ubuntu support. Secondly, it will look for the distro specific files. It currently recognizes slackware, debian, suse, fedora, redhat, turbolinux, yellowdog, knoppix, mandrake, conectiva, immunix, tinysofa, va-linux, trustix, adamantix, yoper, arch-linux, libranet, gentoo, ubuntu, redflag and xandros. It has function to get the version for debian, suse, redhat, gentoo, slackware, redflag and ubuntu(lsb). People running unsupported distro's are greatly encouraged to submit patches :-) =head2 EXPORT None by default. =head1 TODO Add the capability of recognize the version of the distribution for all recognized distributions. =head1 AUTHORS Alberto Re, Ealberto@accidia.netE Judith Lebzelter, Ejudith@osdl.orgE =head1 COPYRIGHT AND LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available. =cut xdg-utils-1.1.0-rc1/tests/include/testfuncs.sh0000644000175000017500000000501411507575742021116 0ustar fboudrafboudraverify_test_context() { if [ -z "$TEST_NAME" -a ! "$USING_TET" ]; then echo "A test context must be established with 'test_start '!" exit 255 fi } ## record the test a name. test_start () { TEST_NAME="$*" verify_test_context TEST_STATUS=PASS if [ $USING_TET ]; then tet_infoline $TEST_NAME FAIL=N else echo -n "[`date`] $TEST_NAME: " fi } test_infoline() { verify_test_context FAIL_MESSAGE="$FAIL_MESSAGE\n$*" if [ "$USING_TET" ] ; then tet_infoline $* fi } test_fail() { FAIL=Y TEST_STATUS=FAIL test_infoline $* } ## provide a nice way to document the test purpose test_purpose() { verify_test_context # TODO: generate a manpage or something. } test_note() { #verify_test_context # TODO: generate even more docs. tmp=1 } ## Used for setup/dependency verification. test_init() { verify_test_context } test_status() { TEST_STATUS="$1" test_infoline "$2" } ## Called after test_init() test_procedure() { verify_test_context ## Make sure nothing screwed up in initilization if [ "$TEST_STATUS" != "PASS" ]; then # Something failed before we could get to the test. FAIL=N test_result NORESULT "Initilization failed!" fi } ## Must be within test_procedure test_failoverride() { STAT=${1-WARN} if [ "$TEST_STATUS" == FAIL ] ; then FAIL=N test_status "$STAT" fi } ## Report the test's result. test_result() { verify_test_context # Set status appropriately if [ ! -z "$1" ]; then TEST_STATUS=$1 # account for TET if [ "$TEST_STATUS" = "FAIL" ] ; then FAIL=Y fi fi # if we have a message, save it if [ ! -z "$2" ]; then test_infoline $2 fi if [ "$USING_TET" ]; then tet_result $TEST_STATUS fi # not using tet, so print nice explanation [ -z "$USING_TET" ] && echo -n "$TEST_STATUS" ## Result codes MUST agree with tet_codes ## for LSB/tet integration. case "$TEST_STATUS" in PASS ) RESULT=0 ;; FAIL ) RESULT=1 [ -z "$USING_TET" ] && echo -ne " $FAIL_MESSAGE" ;; UNTESTED ) RESULT=5 [ -z "$USING_TET" ] && echo -ne " $FAIL_MESSAGE" ;; NORESULT ) RESULT=7 [ -z "$USING_TET" ] && echo -ne " $FAIL_MESSAGE" ;; WARN ) RESULT=10 [ -z "$USING_TET" ] && echo -ne " $FAIL_MESSAGE" ;; *) RESULT=1 [ -z "$USING_TET" ] && echo -ne " - UNKNOWN STATUS\n$FAIL_MESSAGE" ;; esac #fi [ -z "$USING_TET" ] && echo "" exit "$RESULT" } infofile() # write file to journal using tet_infoline { # $1 is file name, $2 is prefix for tet_infoline prefix="$2" while read line do test_infoline "$prefix$line" done < "$1" } xdg-utils-1.1.0-rc1/tests/include/tempfile.sh0000644000175000017500000000150511507575742020706 0ustar fboudrafboudra## Created 7/14/2006 by Tom Whipple ## create a globally unique identifier (GUID) ## note that this is LIKELY to be unique, but not 100% guaranteed. get_guid() { prefix=$1 now=`date '+%F-%H%M%S.%N'` GUID="$prefix$now-$RANDOM" } get_tmpsubdir() { if [ ! -z "$1" ] ; then tmp="$1" else tmp=${TMPDIR-/tmp} fi if [ -z "$GUID" ] ; then get_guid fi TMPSUBDIR="$tmp/$GUID-$$" (umask 000 && mkdir -p $TMPSUBDIR) || { echo "Could not create temporary directory!" >&2 exit 255 } } get_shortid() { seqfile=$1 today=`date '+%m-%d'` if [ -f "$seqfile" ] ; then seqdate=`cat $seqfile | cut -d '+' -f 1 -` if [ "$today" = "$seqdate" ] ; then seq=$(( `cat $seqfile | cut -d '+' -f 2 -` + 1 )) else seq=1 fi else seq=1 fi SHORTID="$today+$seq" echo "$SHORTID" > "$seqfile" } xdg-utils-1.1.0-rc1/tests/include/desktop_environment0000755000175000017500000000250011507575742022564 0ustar fboudrafboudra#!/bin/bash ## This script modified from one supplied by Bryce Harrington at OSDL which kde-config >/dev/null 2>&1 if [ "$?" -eq 0 ]; then # From Sutoka on FreeNode/#kde kde_version=`kde-config --version | grep KDE | cut -d' ' -f2 2> /dev/null` kde_running=$KDE_FULL_SESSION if [ ! -z "$KDE_FULL_SESSION" ]; then running="kde $running" fi echo "kde: $kde_version" else echo "kde: not present (didn't find kde-config)" fi # From kees on #osdl which gnome-session >/dev/null 2>&1 if [ "$?" -eq 0 ] ; then gnome_version=`gnome-session --version | cut -d ' ' -f3 2>/dev/null` echo "gnome: $gnome_version" if [ ! -z "$GNOME_DESKTOP_SESSION_ID" ]; then running="gnome $running" fi else echo "gnome: not present (didn't find gnome-session)" fi which xfce4-session >/dev/null 2>&1 if [ "$?" -eq 0 ] ; then xfce_version=`xfce4-session --version | grep '(Xfce ' | cut -d '(' -f 2 | cut -d ' ' -f2 | cut -d ')' -f1` # From massonnet on FreeNode/#xfce #if [ `pidof xfce4-session` ]; then if [ "$GDMSESSION" = 'xfce4' ] ; then running="xfce $running" fi echo "xfce: $xfce_version" else echo "xfce: not present (didn't find xfce4-session)" fi if [ -z "$running" ] ; then running='none' fi echo "running: $running " if [ `whoami` = 'root' ] ; then echo "user: root" else echo "user: normal" fi xdg-utils-1.1.0-rc1/tests/include/testassertions.sh0000644000175000017500000002230711507575742022176 0ustar fboudrafboudra# Adapted from # shfuncs : test suite common shell functions # which was shipped with the TET example code. . "$XDG_TEST_DIR/include/testfuncs.sh" ## NOTE: Documentation is generated AUTOMATICALLY from this file ## Function usage must immediately follow function delcaration assert_exit() { # execute command (saving output) and check exit code # Usage: assert_exit N command ... # where N is a number or a literal 'N' (for non-zero) # command can be an unquoted string, but be careful. EXPECT="$1" shift 1 # make sure nothing is hanging around from a prev. test. rm -f out.stdout out.stderr # $1 is command, $2 is expected exit code (0 or "N" for non-zero) ( "$@" > out.stdout 2> out.stderr ) CODE="$?" LASTCOMMAND="$*" if [ -z "$EXPECT" ]; then EXPECT=0; fi if [ "$EXPECT" = N -a "$CODE" -eq 0 ]; then test_fail "Command ($*) gave exit code $CODE, expected nonzero" elif [ "$EXPECT" != N ] && [ "$EXPECT" -ne "$CODE" ]; then test_fail "Command ($*) gave exit code $CODE, expected $EXPECT" fi } assert_interactive_notroot() { if [ `whoami` != 'root' ] ; then assert_interactive "$@" fi } assert_interactive() { # Useage: # assert_interactive {msg} [y|n|C|s varname] # # msg is the text to print. # y -> expect y for [y/n] # n -> expect n for [y/n] # s -> save y or n into varname. Then, (presumably) $varname can be # given in place of y or n in subsequent calls to assert_interactive # C -> cleanup msg. Always print "msg [enter to continue]" despite test failure. # if no argument is given after msg, print "msg [enter to continue]" query=$1 expect=$2 # It seems valuable to see what happens even if the test has failed. # (eg fail on stdout.) if [ "$TEST_STATUS" = 'FAIL' -a "$expect" != C ] ; then ## Don't waste user's time if test has already failed. test_infoline "Test has already failed. Not bothering to ask '$query'" return fi if [ ! -z "$XDG_TEST_NO_INTERACTIVE" ] ; then test_infoline "Assumed '$query' is '$expect'" return fi if [ ! -z "$expect" -a "$expect" != C ] ; then if [ "$expect" != y -a "$expect" != n -a "$expect" != s -a "$expect" != C ] ; then echo "TEST SYNTAX ERROR: interactive assertions require one of (y,n,s,C) as choices. (found '$expect')" >&2 exit 255 fi unset result while [ "$result" != y -a "$result" != n ] ; do echo -ne "\n\t$query [y/n]: " >&2 read result done if [ "$expect" = s ] ; then if [ -z "$3" ] ; then echo "TEST SYNTAX ERROR: 's' requires a variable name" exit 255 fi eval "$3=$result" elif [ "$result" != "$expect" ] ; then test_fail "User indicated '$result' instead of '$expect' in response to '$query'" fi else echo -ne "\n\t$query [enter to continue] " >&2 read result fi } assert_file_in_path() { # Assert that some file is present in a path. # # Usage: # assert_file_in_path FILENAME PATH # where FILE is the exact name of the file and # PATH is a ':' separated list of directories search_dirs=`echo "$2" | tr ':' ' '` found_files=`find $search_dirs -name "$1" 2>/dev/null` if [ -z "$found_files" ] ; then test_fail "Did not find '$1' in '$2'" fi } assert_file_not_in_path() { # Assert the some file is NOT present in a path. # Opposite of 'assert_file_in_path' search_dirs=`echo "$2" | tr ':' ' '` found_files=`find $search_dirs -name "$1" 2>/dev/null` if [ ! -z "$found_files" ] ; then test_fail "Found '$found_files' in $2" fi } assert_file() { # Assert the existance of an exact filename # Usage: assert_file FILE if [ ! -e "$1" ] ; then test_fail "'$1' does not exist" return elif [ ! -f "$1" ] ; then test_fail "'$1' is not a regular file" return fi if [ -f "$2" ] ; then compare=`diff -wB "$1" "$2"` if [ ! -z "$compare" ] ; then test_fail "'$1' is different from '$2'. Diff is:\n$compare" fi fi } assert_nofile() { # Assert the non existance of an exact filename. # Opposite of 'assert_file' if [ -e "$1" ] ; then test_fail "'$1' exists." fi } assert_nostdout() { # assert nothing was written to a stdout. # NOTE: Failing this assertion will WARN rather than FAIL if [ -s out.stdout ] then test_infoline "Unexpected output from '$LASTCOMMAND' written to stdout, as shown below:" infofile out.stdout stdout: if [ "$TEST_STATUS" = "PASS" ]; then test_status WARN fi fi } assert_nostderr() { # assert nothing was written to stderr. # NOTE: Failing this assertion will WARN rather than FAIL if [ -n "$XDG_UTILS_DEBUG_LEVEL" ] ; then if [ -s out.stderr ] ; then infofile out.stderr debug: fi elif [ -s out.stderr ] ; then test_infoline "Unexpected output from '$LASTCOMMAND' written to stderr, as shown below:" infofile out.stderr stderr: if [ "$TEST_STATUS" = "PASS" ]; then test_status WARN fi fi } assert_stderr() { # check that stderr matches expected error # $1 is file containing regexp for expected error # if no argument supplied, just check out.stderr is not empty if [ ! -s out.stderr ] then test_infoline "Expected output from '$LASTCOMMAND' to stderr, but none written" test_fail return fi if [ ! -z "$1" ] ; then expfile="$1" OK=Y exec 4<&0 0< "$expfile" 3< out.stderr while read expline do if read line <&3 then if expr "$line" : "$expline" > /dev/null then : else OK=N break fi else OK=N fi done exec 0<&4 3<&- 4<&- if [ "$OK" = N ] then test_infoline "Incorrect output from '$LASTCOMMAND' written to stderr, as shown below" infofile "$expfile" "expected stderr:" infofile out.stderr "received stderr:" test_fail fi fi } assert_stdout() { # check that stderr matches expected error # $1 is file containing regexp for expected error # if no argument supplied, just check out.stderr is not empty if [ ! -s out.stdout ] then test_infoline "Expected output from '$LASTCOMMAND' to stdout, but none written" test_fail return fi if [ ! -z "$1" ] ; then expfile="$1" if [ ! -e "$expfile" ] ; then test_status NORESULT "Could not find file '$expfile' to look up expected pattern!" return fi OK=Y exec 4<&0 0< "$expfile" 3< out.stdout while read expline do if read line <&3 then if expr "$line" : "$expline" > /dev/null then : else OK=N break fi else OK=N fi done exec 0<&4 3<&- 4<&- if [ "$OK" = N ] then test_infoline "Incorrect output from '$LASTCOMMAND' written to stdout, as shown below" infofile "$expfile" "expected stdout:" infofile out.stdout "received stdout:" test_fail fi fi } require_interactive() { # if $XDG_TEST_NO_INTERACTIVE is set, test result becomes UNTESTED if [ ! -z "$XDG_TEST_NO_INTERACTIVE" ] ; then test_result UNTESTED "XDG_TEST_NO_INTERACTIVE is set, but this test needs interactive" fi } require_root() { # if the test is not being run as root, test result is UNTESTED if [ `whoami` != 'root' ] ; then test_result UNTESTED "not running as root, but test requires root privileges" fi } require_notroot() { # if the test is being run as root, the test result is UNTESTED # opposite of 'require_root' if [ `whoami` = 'root' ] ; then test_result UNTESTED "running as root, but test must be run as a normal user" fi } set_no_display() { # Clear $DISPLAY unset DISPLAY } assert_display() { # Assert that the $DISPLAY variable is set. if [ -z "$DISPLAY" ] ; then test_fail "DISPLAY not set!" fi } assert_util_var() { # Assert that the $XDGUTIL varilable is set. # DEPRICATED. Only used by generic tests. if [ "x$XDGUTIL" = x ]; then test_fail "XDGUTIL variable not set" fi } use_file() { # Copy a datafile from it's defult location into the test directory # Usage: # use_file ORIG_FILE VAR # Where ORIG_FILE is the name of the file, and VAR is the name of the # variable to create that will contain the new (unique) filename. # DO NOT put a '$' in front of VAR. VAR will be created via eval. # # $VAR will be set to 'xdgtestdata-$XDG_TEST_ID-$file' after the # directory is stripped from $file. src="$1" file=${src##/*/} varname="$2" if [ $# -lt 2 ] ; then echo "TEST SYNTAX ERROR: use_file must have two arguments" >&2 exit 255 fi assert_file "$src" outfile="xdgtestdata-$XDG_TEST_ID-$file" eval "$varname=$outfile" cp "$src" "$XDG_TEST_TMPDIR/$outfile" } get_unique_name() { # Get a unique name for a file, similar to 'use_file' # except that no file is copied. You are left to create file $VAR. varname="$1" file="$2" if [ -z "$varname" ] ; then echo "TEST SYNAX ERROR: get_unique_name requries a variable name" exit 255 fi outfile="xdgtestdata-$XDG_TEST_ID-$file" eval "$varname=$outfile" } edit_file() { # Edit file via sed. # Usage: # edit_file $FILE origstr VARNAME [newstr] # Where: # $FILE is a file, probably copied from 'use_file' # VARNAME is created via 'eval' to contain the newstr # newstr is the optional substitution. If newstr is not present, # it will become 'xdgtestdata-$XDG_TEST_ID-$origstr' file="$1" origstr="$2" varname="$3" newstr="$4" if [ $# -lt 3 ] ; then echo "TEST SYNTAX ERROR: edit_file must have at least 3 arguments." exit 255 fi assert_file "$file" if [ -z "$newstr" ] ; then newstr="xdgtestdata-$XDG_TEST_ID-$origstr" fi eval "$varname=\"$newstr\"" sed -i -e "s|$origstr|$newstr|g" "$file" } xdg-utils-1.1.0-rc1/tests/include/listargs0000755000175000017500000000020111507575742020313 0ustar fboudrafboudra#!/bin/bash echo "argc:$#" declare -i argn=1 while [ "$#" -gt 0 ] ; do echo "arg$argn:$1" shift 1 argn=$(( argn + 1 )) done xdg-utils-1.1.0-rc1/tests/include/testcontrol.sh0000644000175000017500000000506611507575742021467 0ustar fboudrafboudra if [ -z "$IC_NUM" ] ; then declare -i IC_NUM=1 fi run_test() { ## USAGE: # run_test test_func # if tests are being run with TET or the test runner if [ ! -z "$USING_TET" -o ! -z "$USING_TEST_RUNNER" ]; then ## The TET framework REQUIRES variables of the form $ic1 ... $icN ## where each variable is a list of test functions. Here, there is only ## one test function per $icN variable. Each $icN variable MUST be present ## in the $iclist export ic$IC_NUM="$1" export iclist="$iclist ic$IC_NUM" ## The standalone test runner executes each function in $TEST_LIST export TEST_LIST="$TEST_LIST $1" else # test is being run directly. test_setup ## Subshell is necessary for containment ( "$1" ) test_cleanup fi IC_NUM=$(($IC_NUM+1)) } repeat_test() { ## USAGE: # repeat_test test_func N var1 ... varN var1_value1 ... var1_valueM ... varN_valueM # where N is the number of values to substiute and M is the number of # values each varable takes # # EXAMPLE # repeat_test copy_file 2 INPUT OUTPUT infile1 infile2 outfile1 outfile2 # # NOTE - all variables MUST have the same number of arguments if [ "$#" -lt 4 ] ; then echo "TEST SYNTAX ERROR: repeat_test() requires at least 4 arguments!" exit 255 fi FUNC="$1" VARS="$2" shift 2 ## get list of variables declare -i I=1 while [ "$I" -le "$VARS" ]; do eval "v$I=$1" shift 1 eval "out=\$v$I" I=$(($I+1)) done #echo "----" ## $LENGTH is the number of values each variable takes declare -i LENGTH=$(( $# / $VARS )) #echo "list size: $LENGTH" ## Main loop: create a test function for each set of values. declare -i J=1 while [ "$J" -le "$LENGTH" ] ; do declare -i I=1 ## Begin test function string # it is only safe to use $IC_NUM since run_test is used later in this function. str="$FUNC-$J-$IC_NUM() {" while [ "$I" -le "$VARS" ] ; do ## Assign each value to appropriate variable eval "var=\$v$I" eval "value=\$$(( ($I-1)*$LENGTH+$J ))" #echo "$var: $value" str="$str $var=\"$value\"" I=$(($I+1)) done ## Close the test function and load it str="$str $FUNC }" #echo "$str" eval "$str" run_test "$FUNC-$J-$IC_NUM" J=$(($J+1)) done } . "$XDG_TEST_DIR/include/tempfile.sh" test_setup() { get_guid "xdgt" export XDG_TEST_ID="$GUID" get_tmpsubdir "$XDG_TEST_DIR/tmp" export XDG_TEST_TMPDIR="$TMPSUBDIR" cd "$XDG_TEST_TMPDIR" get_shortid "$XDG_TEST_DIR/tmp/shortid" export XDG_TEST_SHORTID="$SHORTID" } test_cleanup() { if [ -z "$XDG_TEST_DONT_CLEANUP" ] ; then cd "$XDG_TEST_DIR" # ALWAYS check what you pass to 'rm -rf' [ -d "$XDG_TEST_TMPDIR" ] && rm -rf "$XDG_TEST_TMPDIR" fi } xdg-utils-1.1.0-rc1/tests/include/system_info0000755000175000017500000000070711507575742021035 0ustar fboudrafboudra#!/bin/bash parentdir=${0%/*} which perl >/dev/null 2>&1 if [ "$?" ] ; then distro=`perl $parentdir/linux_distro 2>&1` else distro="not available (couldn't find perl)" fi echo "distribution: $distro" echo "xdg-utils:" `xdg-mime --version | cut -d ' ' -f 2` . "$parentdir/desktop_environment" detail=`uname -a` echo "uname: $detail" echo "xset data:" echo "-------------------------------------" xset q echo "-------------------------------------" xdg-utils-1.1.0-rc1/tests/README0000644000175000017500000000745011507575742016007 0ustar fboudrafboudraREADME: xdg-utils tests Created 6/27/2006 by Tom Whipple RUNNING XDG-UTILS TESTS ----------------------- At a minimum, you must have your current directory be the same as the directory containing this README. Then, simply execute: $ ./testrun WARNING: guessed XDG_TEST_DIR to be /home/tw/portland/xdg-utils/tests TEST_LIST: generic_bogus_arg-1-1 ... generic_version-1-50 ... FAIL: test_user_mime_install NORESULT: test_system_mime_install 71 of 92 tests passed. (114 attempted) See xdg-test.log for details. NOT OK! FAIL indicates (not suprisingly) a test failure. NORESULT indicates that the test prerequisites failed for some reason. (e.g. the install phase of an uninstall test failed) UNTESTED means that something needed was not found. This is fine and should be ignored. These tests are not counted in the total, only attempted. (e.g. test requires root, but we are not running as root) NOTE: The test runner makes guesses about appropriate values of XDG_TEST_DIR and PATH. These values can be overriden explicitly. To run tests individually, or as smaller groups do something like $ ./testrun xdg-mime OR $ ./testrun xdg-mime/t.10-user_mime_install OR (if you have defined XDG_TEST_DIR and PATH correctly) $ xdg-mime/t.10-user_mime_install BACKUPS ------- THESE TESTS CHANGE YOUR USER ENVIRONMENT. Effort is made to keep pollution to a minimum, but we make no guarantees!! Back up your environment/system early and often. This is especially critical if you run tests as root. You have been warned. INTERACTIVE TESTS ----------------- Because it is difficult to verify the way things appear to the user, some tests are interactive and require the user to verify or perform actions. This is sometimes annoying, so interactive tests can be disabled with the -I flag. Note that if you run tests non-interactively, some tests (xdg-email) may generate strange errors on the screen, since the test cleans up support files before the email client tries to read them. Use the -C option to work around this. PRIVILEGED TESTS --------------- BACK UP YOUR SYSTEM. See above. Some tests require root (e.g. those commands with a --system option). So, tests in this group return UNTESTED if they are not run as root. The test runner will ask for the root password in order to run these tests as the root user. CLEANUP ------- Tests should clean up after themselves. However, this sometimes fails, so use 'sudo make tests-clean' or 'make tests-userclean'. (Note that you must have generated a makefile via 'cd .. && ./configure' at some point.) DIRECTORY STRUCTURE ------------------- xdg-* tests for each util include "library" code used by most tests generic generic tests to be run on most utilities. See xdg-mime/t.apply_generic WRITING XDG-UTILS TESTS ----------------------- See xdg-mime/t.10-user_mime_install as an example. Each test is as follows test_function() { -- Tests are functions for TET integration. test_start "test description" -- required to begin a test test_purpose "verbose text" -- optionally provide a verbose description. not used. test_init -- optionally begin a prerequisite section. assertions that fail here cause NORESULT rather than FAIL test_procedure -- required to begin the actuall test assertions test_result -- required to generate result codes. Must be last. } run_test test_function - OR - repeat_test test_function NVARS V1 ... VN V1val1 ... V1valM ... VNval1 ... VNvalM -- one of the above is required. see include/testcontrol.sh for detail For questions or feedback, please use the Portland mailinglist at http://lists.freedesktop.org/mailman/listinfo/portland Test results can be submitted on http://portland.freedesktop.org/testreport.html xdg-utils-1.1.0-rc1/tests/xdg-email/0000755000175000017500000000000011507575742016770 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-email/t.31-email_attach_full_path0000755000175000017500000000142711507575742024056 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_email_attach_full_path() { test_start "$FUNCNAME: verify attach argument works" ADDR="$XDG_TEST_SHORTID@portland.freedesktop.org" test_init require_notroot ## Require a running X server assert_display get_unique_name TARG 'attach.txt' echo "I am an attachment." > $TARG assert_file "$TARG" test_procedure assert_exit 0 xdg-email --attach "$XDG_TEST_TMPDIR/$TARG" "$ADDR" assert_nostdout assert_nostderr assert_interactive "Did an email open to '$ADDR'?" y assert_interactive "Is there an attachment?" y assert_interactive "Please close any email windows opened by the test." C test_result } run_test test_email_attach_full_path xdg-utils-1.1.0-rc1/tests/xdg-email/t.00-apply_generic0000755000175000017500000000046511507575742022223 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testcontrol.sh" . "$XDG_TEST_DIR/include/testfuncs.sh" test_note This is a dummy test to run the generic tests for this utility. generic_tests=`ls $XDG_TEST_DIR/generic/t.*` for t in $generic_tests; do . "$t" repeat_test "$GENERIC_TEST" 1 "XDGUTIL" "xdg-email" done xdg-utils-1.1.0-rc1/tests/xdg-email/t.12-email_cc_args0000755000175000017500000000204411507575742022150 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_cc_args() { test_start "$FUNCNAME: verify cc/bcc/subject/body/attach arguments work" addr="$XDG_TEST_SHORTID@portland.freedesktop.org" ADDR_TO="to_$addr" ADDR_CC="cc_$addr" ADDR_BCC="bcc_$addr" SUBJ="I am a subject about $XDG_TEST_SHORTID" BODY="I am the body. $XDG_TEST_SHORTID is short for $XDG_TEST_ID" test_init require_notroot ## Require a running X server assert_display test_procedure assert_exit 0 xdg-email --cc "$ADDR_CC" --bcc "$ADDR_BCC" \ --subject "$SUBJ" --body "$BODY" "$ADDR_TO" assert_nostdout assert_nostderr assert_interactive "Did a new email open to '$ADDR_TO'?" y assert_interactive "Is the cc: line '$ADDR_CC'?" y assert_interactive "Is the bcc: line '$ADDR_BCC'?" y assert_interactive "Is the subject: line '$SUBJ'?" y assert_interactive "Is the body '$BODY'?" y assert_interactive "Please close any email windows opened by the test." C test_result } run_test test_cc_args xdg-utils-1.1.0-rc1/tests/xdg-email/t.22-email_mix_args_uri0000755000175000017500000000166411507575742023247 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_email_mix_args_uri() { test_start "$FUNCNAME: verify an email is generated correctly when called with both a uri and not." ADDR="$XDG_TEST_SHORTID@portland.freedesktop.org" test_init require_notroot ## Require a running X server assert_display test_procedure assert_exit 0 xdg-email --cc "ccarg-$ADDR" --subject "Subject arg" "mailto:$ADDR?cc=ccuri-$ADDR&body=Body%20URI" "t2-$ADDR" assert_nostdout assert_nostderr assert_interactive "Did an email open to both '$ADDR' and 't2-$ADDR'?" y assert_interactive "Are both 'ccarg-$ADDR' and 'ccuri-$ADDR' in the CC'd?" y assert_interactive "Is the subject 'Subject arg'?" y assert_interactive "Is the body 'Body URI'?" y assert_interactive "Please close any email windows opened by the test." C test_result } run_test test_email_mix_args_uri xdg-utils-1.1.0-rc1/tests/xdg-email/t.30-email_attach0000755000175000017500000000136111507575742022014 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_email_attach() { test_start "$FUNCNAME: verify attach argument works" ADDR="$XDG_TEST_SHORTID@portland.freedesktop.org" test_init require_notroot ## Require a running X server assert_display get_unique_name TARG 'attach.txt' echo "I am an attachment." > $TARG assert_file "$TARG" test_procedure assert_exit 0 xdg-email --attach "$TARG" "$ADDR" assert_nostdout assert_nostderr assert_interactive "Did an email open to '$ADDR'?" y assert_interactive "Is there an attachment?" y assert_interactive "Please close any email windows opened by the test." C test_result } run_test test_email_attach xdg-utils-1.1.0-rc1/tests/xdg-email/t.10-email_basic0000755000175000017500000000121711507575742021627 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_email_basic() { test_start "$FUNCNAME: verify basic email compose" ADDR="$XDG_TEST_SHORTID@portland.freedesktop.org" test_init require_notroot ## Require a running X server assert_display test_procedure assert_exit 0 xdg-email "$PRE$ADDR" assert_nostdout assert_nostderr assert_interactive "Did a new email open to '$ADDR' with only the to: field complete?" y assert_interactive "Please close any email windows opened by the test." C test_result } repeat_test test_email_basic 1 PRE "" "mailto:" xdg-utils-1.1.0-rc1/tests/xdg-email/t.21-email_uri_multi_address0000755000175000017500000000157111507575742024271 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_email_uri_multi_address() { test_start "$FUNCNAME: verify uri email compose" ADDR="$XDG_TEST_SHORTID@portland.freedesktop.org" test_init require_notroot ## Require a running X server assert_display test_procedure assert_exit 0 xdg-email "mailto:$ADDR?to=t2-$ADDR&subject=Test%20Subject&cc=cc-$ADDR&cc=cc2-$ADDR&body=Test%20Body" assert_nostdout assert_nostderr assert_interactive "Did an email open to both '$ADDR' and 't2-$ADDR'?" y assert_interactive "Are both 'cc-$ADDR' and 'cc2-$ADDR' CC'd?" y assert_interactive "Is the subject 'Test Subject'?" y assert_interactive "Is the body 'Test Body'?" y assert_interactive "Please close any email windows opened by the test." C test_result } run_test test_email_uri_multi_address xdg-utils-1.1.0-rc1/tests/xdg-email/t.32-email_missing_attach0000755000175000017500000000131111507575742023542 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_email_missing_attach() { test_start "$FUNCNAME: verify an error when --attach does not have a valid file" ADDR="$XDG_TEST_SHORTID@portland.freedesktop.org" test_init require_notroot ## Require a running X server assert_display get_unique_name TARG 'attach.txt' assert_nofile "$TARG" test_procedure assert_exit 2 xdg-email --attach "$TARG" "$ADDR" assert_nostdout assert_stderr assert_interactive "Did an email open to '$ADDR'?" n assert_interactive "Please close any email windows opened by the test." C test_result } run_test test_email_missing_attach xdg-utils-1.1.0-rc1/tests/xdg-email/t.13-email_multi_address0000755000175000017500000000172211507575742023411 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_multi_address() { test_start "$FUNCNAME: verify multiple to/cc/bcc arguments work" addr="$XDG_TEST_SHORTID@portland.freedesktop.org" TO1="to-1-$addr" TO2="to-2-$addr" CC1="cc-1-$addr" CC2="cc-2-$addr" BCC1="bcc-1-$addr" BCC2="bcc-2-$addr" test_init require_notroot ## Require a running X server assert_display test_procedure assert_exit 0 xdg-email --cc "$CC1" --bcc "$BCC1" \ --cc "$CC2" --bcc "$BCC2" --subject 'I am the subject' \ --body 'I am the body' "$TO1" "$TO2" assert_nostdout assert_nostderr assert_interactive "Did an email open to both '$TO1' and '$TO2'?" y assert_interactive "Are both '$CC1' and '$CC2' CC'd?" y assert_interactive "Are both '$BCC1' and '$BCC2' BCC'd?" y assert_interactive "Please close any email windows opened by the test." C test_result } repeat_test test_multi_address 1 PRE "t" xdg-utils-1.1.0-rc1/tests/xdg-mime/0000755000175000017500000000000011507575742016630 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-mime/t.02-query_missing_file0000755000175000017500000000116711507575742023141 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_query_missing_file() { INPUT_FILE='non-existant-file.xml' test_start "$FUNCNAME: verify correct error for missing file: $INPUT_FILE" test_purpose "Verify that the correct error is generated when the mime file is missing. This is bug 7123 case 1" ## Check dependencies test_init # query requires a desktop environment require_notroot assert_nofile "$INPUT_FILE" ## Main test test_procedure assert_exit 2 xdg-mime query filetype "$INPUT_FILE" assert_stderr assert_nostdout test_result } run_test test_query_missing_file xdg-utils-1.1.0-rc1/tests/xdg-mime/t.23-double_mime_install0000755000175000017500000000224611507575742023255 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_double_mime_install() { # TODO: should follow the filename tests. ## Begin the test. test_start "$FUNCNAME: verify installing an existing mime type is OK" # Dependencies section test_init require_notroot use_file "$XDG_TEST_DIR/xdg-mime/data/testmime.xml" INPUT_FILE edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST_MIME "x-$XDG_TEST_ID" assert_file "$INPUT_FILE" echo "text/$TEST_MIME" >testmime.expected echo "Some text." >testfile.xdgtest assert_file testfile.xdgtest # Verify the test type is not installed already. assert_exit 0 xdg-mime install --mode user "$INPUT_FILE" assert_exit 0 xdg-mime query filetype testfile.xdgtest assert_stdout testmime.expected # Test steps section test_procedure assert_exit 0 xdg-mime install --mode user "$INPUT_FILE" assert_nostdout assert_nostderr assert_exit 0 xdg-mime query filetype testfile.xdgtest assert_stdout testmime.expected assert_nostderr # this is a cleanup step xdg-mime uninstall --mode user "$INPUT_FILE" >/dev/null 2>&1 test_result } run_test test_double_mime_install xdg-utils-1.1.0-rc1/tests/xdg-mime/t.03-system_as_nonroot0000755000175000017500000000221211507575742023022 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_system_as_nonroot() { # TODO: should follow the filename tests. ## Begin the test. test_start "$FUNCNAME: verify error for --mode system when run as a normal user" # Dependencies section test_init require_notroot use_file "$XDG_TEST_DIR/xdg-mime/data/testmime.xml" INPUT_FILE edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST_MIME "x-$XDG_TEST_ID" assert_file "$INPUT_FILE" echo "text/x-$XDG_TEST_ID" >xdgmime.expected QUERY_FILE="testfile.xdgtest" echo "Some text." > $QUERY_FILE assert_file "$QUERY_FILE" # Verify the test type is not installed already. assert_exit 0 xdg-mime query filetype $QUERY_FILE assert_stdout mv out.stdout out.saved1 # Test steps section test_procedure assert_exit 3 xdg-mime install --mode system "$INPUT_FILE" assert_nostdout assert_stderr assert_exit 0 xdg-mime query filetype "$QUERY_FILE" assert_stdout out.saved1 assert_nostderr assert_exit 3 xdg-mime uninstall --mode system "$INPUT_FILE" assert_nostdout assert_stderr test_result } run_test test_system_as_nonroot xdg-utils-1.1.0-rc1/tests/xdg-mime/t.00-apply_generic0000755000175000017500000000046511507575742022063 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testcontrol.sh" . "$XDG_TEST_DIR/include/testfuncs.sh" test_note This is a dummy test to run the generic tests for this utility. generic_tests=`ls $XDG_TEST_DIR/generic/t.*` for t in $generic_tests; do . "$t" repeat_test "$GENERIC_TEST" 1 "XDGUTIL" "xdg-mime" done xdg-utils-1.1.0-rc1/tests/xdg-mime/t.22-system_install_missing_file0000755000175000017500000000114511507575742025044 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_system_install_missing_file() { INPUT_FILE='non-existant-file.xml' test_start "$FUNCNAME: install mime type as system with missing file $INPUT_FILE" test_purpose "Verify that the correct error is generated when the mime file is missing." ## Check dependencies test_init require_root set_no_display assert_nofile "$INPUT_FILE" ## Main test test_procedure assert_exit 2 xdg-mime install --mode system "$INPUT_FILE" assert_stderr assert_nostdout test_result } run_test test_system_install_missing_file xdg-utils-1.1.0-rc1/tests/xdg-mime/t.10-user_mime_install0000755000175000017500000000226411507575742022755 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_user_mime_install() { ## Begin the test. test_start "$FUNCNAME: install user mime type" test_purpose "Verify that new mime types get installed into the user space correctly" # Dependencies section test_init require_notroot use_file "$XDG_TEST_DIR/xdg-mime/data/testmime.xml" INPUT_FILE edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST_MIME "x-$XDG_TEST_ID" assert_file "$INPUT_FILE" echo "text/$TEST_MIME" >testmime.expected echo "Some text." >testfile.xdgtest assert_file testfile.xdgtest # Verify the test type is not installed already. assert_exit 0 xdg-mime query filetype testfile.xdgtest assert_stdout mv out.stdout out.save1 assert_exit 1 diff out.save1 testmime.expected # Test steps section test_procedure assert_exit 0 xdg-mime install --mode user "$INPUT_FILE" assert_nostdout assert_nostderr sleep 1 assert_exit 0 xdg-mime query filetype testfile.xdgtest assert_stdout testmime.expected assert_nostderr # TODO: this is a cleanup step xdg-mime uninstall --mode user "$INPUT_FILE" test_result } run_test test_user_mime_install xdg-utils-1.1.0-rc1/tests/xdg-mime/t.12-user_install_missing_file0000755000175000017500000000111711507575742024474 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_user_install_missing_file() { INPUT_FILE='non-existant-file.xml' test_start "$FUNCNAME: install mime type as user with missing file $INPUT_FILE" test_purpose "Verify that the correct error is generated when the mime file is missing." ## Check dependencies test_init require_notroot assert_nofile "$INPUT_FILE" ## Main test test_procedure assert_exit 2 xdg-mime install --mode user "$INPUT_FILE" assert_stderr assert_nostdout test_result } run_test test_user_install_missing_file xdg-utils-1.1.0-rc1/tests/xdg-mime/t.20-system_mime_install0000755000175000017500000000204311507575742023317 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_system_mime_install() { ## Begin the test. test_start "$FUNCNAME: install system mime type" test_purpose "Verify that new mime types get installed into the system space correctly" # Dependencies section test_init require_root set_no_display use_file "$XDG_TEST_DIR/xdg-mime/data/testmime.xml" INPUT_FILE edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST_MIME "x-$XDG_TEST_ID" assert_file "$INPUT_FILE" echo "text/$TEST_MIME" >testmime.expected echo "Some text." >testfile.xdgtest assert_file testfile.xdgtest # Test steps section test_procedure assert_exit 0 xdg-mime install --mode system "$INPUT_FILE" assert_nostdout assert_nostderr # TODO: query requires a running desktop #assert_exit 0 xdg-mime query filetype testfile.xdgtest #assert_stdout testmime.expected #assert_nostderr xdg-mime uninstall --mode system "$INPUT_FILE" >/dev/null 2>&1 test_result } run_test test_system_mime_install xdg-utils-1.1.0-rc1/tests/xdg-mime/t.15-user_mime_uninstall2in10000755000175000017500000000317711507575742024023 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_user_mime_uninstall2in1() { ## Begin the test. test_start "$FUNCNAME: uninstall user mime type" test_purpose "Verify that mime types get removed from the user space correctly." # Dependencies section test_init require_notroot use_file "$XDG_TEST_DIR/xdg-mime/data/test2mime.xml" INPUT_FILE edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST1_MIME "x-xdg-01-$XDG_TEST_ID" edit_file "$INPUT_FILE" "x-xdg-test2pattern" TEST2_MIME "x-xdg-02-$XDG_TEST_ID" assert_file "$INPUT_FILE" echo "text/$TEST1_MIME" >out.expect1 echo "text/$TEST2_MIME" >out.expect2 echo "Some text." >testfile.xdg1test echo "Some text." >testfile.xdg2test assert_file testfile.xdg1test assert_file testfile.xdg2test assert_exit 0 xdg-mime query filetype testfile.xdg1test assert_stdout mv out.stdout out.save1 assert_exit 0 xdg-mime query filetype testfile.xdg2test assert_stdout mv out.stdout out.save2 # Install & verify mime type is installed assert_exit 0 xdg-mime install --mode user "$INPUT_FILE" assert_exit 0 xdg-mime query filetype testfile.xdg1test assert_stdout out.expect1 assert_exit 0 xdg-mime query filetype testfile.xdg2test assert_stdout out.expect2 # Test steps section test_procedure assert_exit 0 xdg-mime uninstall --mode user "$INPUT_FILE" assert_nostdout assert_nostderr ## Verify uninstall assert_exit 0 xdg-mime query filetype testfile.xdg1test assert_stdout out.save1 assert_exit 0 xdg-mime query filetype testfile.xdg2test assert_stdout out.save2 test_result } run_test test_user_mime_uninstall2in1 xdg-utils-1.1.0-rc1/tests/xdg-mime/data/0000755000175000017500000000000011507575742017541 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/tests/xdg-mime/data/testmime.xml0000644000175000017500000000044511507575742022115 0ustar fboudrafboudra xdg-utils install mime test xdg-utils-1.1.0-rc1/tests/xdg-mime/data/test2mime.xml0000644000175000017500000000060211507575742022172 0ustar fboudrafboudra xdg-utils mime 01 test xdg-utils mime 02 test xdg-utils-1.1.0-rc1/tests/xdg-mime/t.21-system_mime_uninstall0000755000175000017500000000245711507575742023674 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_system_mime_uninstall() { ## Begin the test. test_start "$FUNCNAME: uninstall system mime type" test_purpose "Verify that new mime types get removed from the system space correctly" # Dependencies section test_init require_root set_no_display use_file "$XDG_TEST_DIR/xdg-mime/data/testmime.xml" INPUT_FILE edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST_MIME "x-$XDG_TEST_ID" assert_file "$INPUT_FILE" echo "text/$TEST_MIME" >testmime.expected echo "Some text." >testfile.xdgtest assert_file testfile.xdgtest # TODO: query requires a desktop environment #assert_exit 0 xdg-mime query filetipe testfile.xdgtest #assert_stdout #mv out.stout out.save # Install & verify mime type is installed assert_exit 0 xdg-mime install --mode system "$INPUT_FILE" # TODO: query requires a running desktop environment #assert_exit 0 xdg-mime query filetype $QUERY_FILE #assert_stdout testmime.expected # Test steps section test_procedure assert_exit 0 xdg-mime uninstall --mode system "$INPUT_FILE" assert_nostdout assert_nostderr ## Verify uninstall #assert_exit 0 xdg-mime query filetype $QUERY_FILE #assert_stdout out.save test_result } run_test test_system_mime_uninstall xdg-utils-1.1.0-rc1/tests/xdg-mime/t.13-notexist_mime_uninstall0000755000175000017500000000176111507575742024223 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_notexist_mime_uninstall() { # TODO: should follow the filename tests. QUERY_FILE="testfile.xdgtest" ## Begin the test. test_start "$FUNCNAME: uninstall mime type that is not present" # Dependencies section test_init require_notroot use_file "$XDG_TEST_DIR/xdg-mime/data/testmime.xml" INPUT_FILE edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST_MIME "x-$XDG_TEST_ID" assert_file $INPUT_FILE echo "Some text." > $QUERY_FILE assert_file "$QUERY_FILE" # Install & verify mime type is installed assert_exit 0 xdg-mime query filetype "$QUERY_FILE" >mimesave.expected # Test steps section test_procedure assert_exit 0 xdg-mime uninstall --mode user "$INPUT_FILE" assert_nostdout assert_nostderr ## Verify no change assert_exit 0 xdg-mime query filetype "$QUERY_FILE" assert_stdout mimesave.expected test_result } run_test test_notexist_mime_uninstall xdg-utils-1.1.0-rc1/tests/xdg-mime/t.14-user_mime_install2in10000755000175000017500000000277311507575742023460 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_user_mime_install2in1() { ## Begin the test. test_start "$FUNCNAME: install user mime type 2 in 1 file" test_purpose "Verify that new mime types get installed into the user space correctly when they are in the same file" # Dependencies section test_init require_notroot use_file "$XDG_TEST_DIR/xdg-mime/data/test2mime.xml" INPUT_FILE edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST1_MIME "x-xdg-01-$XDG_TEST_ID" edit_file "$INPUT_FILE" "x-xdg-test2pattern" TEST2_MIME "x-xdg-02-$XDG_TEST_ID" assert_file "$INPUT_FILE" echo "text/$TEST1_MIME" >out.expect1 echo "text/$TEST2_MIME" >out.expect2 echo "Some text." >testfile.xdg1test echo "Some text." >testfile.xdg2test assert_file testfile.xdg1test assert_file testfile.xdg2test # Verify the test type is not installed already. assert_exit 0 xdg-mime query filetype testfile.xdg1test assert_stdout mv out.stdout out.save1 assert_exit 1 diff out.save1 out.expect1 # Test steps section test_procedure assert_exit 0 xdg-mime install --mode user "$INPUT_FILE" assert_nostdout assert_nostderr sleep 1 assert_exit 0 xdg-mime query filetype testfile.xdg1test assert_stdout out.expect1 assert_nostderr assert_exit 0 xdg-mime query filetype testfile.xdg2test assert_stdout out.expect2 assert_nostderr # Cleanup xdg-mime uninstall --mode user "$INPUT_FILE" >/dev/null 2>&1 test_result } run_test test_user_mime_install2in1 xdg-utils-1.1.0-rc1/tests/xdg-mime/t.11-user_mime_uninstall0000755000175000017500000000240111507575742023312 0ustar fboudrafboudra#!/bin/bash ## Include utility functions. . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" ## Test function test_user_mime_uninstall() { # TODO: should follow the filename tests. QUERY_FILE="testfile.xdgtest" ## Begin the test. test_start "$FUNCNAME: uninstall user mime type" test_purpose "Verify that mime types get removed from the user space correctly." # Dependencies section test_init require_notroot use_file "$XDG_TEST_DIR/xdg-mime/data/testmime.xml" INPUT_FILE edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST_MIME "x-$XDG_TEST_ID" assert_file "$INPUT_FILE" echo "text/$TEST_MIME" >testmime.expected echo "Some text." >testfile.xdgtest assert_file testfile.xdgtest assert_exit 0 xdg-mime query filetype testfile.xdgtest assert_stdout mv out.stdout origmime.save # Install & verify mime type is installed assert_exit 0 xdg-mime install --mode user "$INPUT_FILE" assert_exit 0 xdg-mime query filetype testfile.xdgtest assert_stdout testmime.expected # Test steps section test_procedure assert_exit 0 xdg-mime uninstall --mode user "$INPUT_FILE" assert_nostdout assert_nostderr ## Verify uninstall assert_exit 0 xdg-mime query filetype $QUERY_FILE assert_stdout origmime.save test_result } run_test test_user_mime_uninstall xdg-utils-1.1.0-rc1/tests/xdg-mime/t.01-query_text_plain0000755000175000017500000000122311507575742022630 0ustar fboudrafboudra#!/bin/bash . "$XDG_TEST_DIR/include/testassertions.sh" . "$XDG_TEST_DIR/include/testcontrol.sh" test_query_text_plain() { # TODO: expand to cover file weirdness. INPUT_FILE='testfile.txt' test_start "$FUNCNAME: verify a query against $INPUT_FILE returns 'text/plain'" test_purpose "Verify that the basic query (text/plain) is working." ## Check dependencies test_init require_notroot echo 'This is some text.' > $INPUT_FILE assert_file "$INPUT_FILE" echo 'text/plain' > out.plain ## Main test test_procedure assert_exit 0 xdg-mime query filetype "$INPUT_FILE" assert_stdout out.plain assert_nostderr test_result } run_test test_query_text_plain xdg-utils-1.1.0-rc1/Makefile0000644000175000017500000000153011507576513015413 0ustar fboudrafboudraSUBDIRS = scripts tests all: $(SUBDIRS) install: $(SUBDIRS:%=%/__install__) uninstall: $(SUBDIRS:%=%/__uninstall__) test: dummy cd tests && $(MAKE) test clean: $(SUBDIRS:%=%/__clean__) distclean: clean $(SUBDIRS:%=%/__distclean__) rm -f config.* Makefile rm -rf autom4te.cache release: $(SUBDIRS:%=%/__release__) distclean rm -f *~ help: @echo "Usage: make [install|uninstall|release]" .PHONY: all install uninstall clean distclean dummy dummy: $(SUBDIRS): dummy @cd $@ && $(MAKE) $(SUBDIRS:%=%/__uninstall__): dummy cd `dirname $@` && $(MAKE) uninstall $(SUBDIRS:%=%/__install__): dummy cd `dirname $@` && $(MAKE) install $(SUBDIRS:%=%/__clean__): dummy cd `dirname $@` && $(MAKE) clean $(SUBDIRS:%=%/__release__): dummy cd `dirname $@` && $(MAKE) release $(SUBDIRS:%=%/__distclean__): dummy cd `dirname $@` && $(MAKE) distclean xdg-utils-1.1.0-rc1/scripts/0000755000175000017500000000000011507576623015445 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/scripts/xdg-desktop-icon0000755000175000017500000003631011507575742020556 0ustar fboudrafboudra#!/bin/sh #--------------------------------------------- # xdg-desktop-icon # # Utility script to install desktop items on a Linux desktop. # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # 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. # #--------------------------------------------- usage() { cat << _USAGE xdg-desktop-icon - command line tool for (un)installing icons to the desktop Synopsis xdg-desktop-icon install [--novendor] FILE xdg-desktop-icon uninstall FILE xdg-desktop-icon { --help | --manual | --version } _USAGE } manualpage() { cat << _MANUALPAGE Name xdg-desktop-icon - command line tool for (un)installing icons to the desktop Synopsis xdg-desktop-icon install [--novendor] FILE xdg-desktop-icon uninstall FILE xdg-desktop-icon { --help | --manual | --version } Description The xdg-desktop-icon program can be used to install an application launcher or other file on the desktop of the current user. An application launcher is represented by a *.desktop file. Desktop files are defined by the freedesktop.org Desktop Entry Specification. The most important aspects of *.desktop files are summarized below. Commands install Installs FILE to the desktop of the current user. FILE can be a *.desktop file or any other type of file. uninstall Removes FILE from the desktop of the current user. Options --novendor Normally, xdg-desktop-icon checks to ensure that a *.desktop file to be installed has a vendor prefix. This option can be used to disable that check. A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. --help Show command synopsis. --manual Show this manualpage. --version Show the xdg-utils version information. Desktop Files An application launcher can be added to the desktop by installing a *.desktop file. A *.desktop file consists of a [Desktop Entry] header followed by several Key=Value lines. A *.desktop file can provide a name and description for an application in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the Key. This way one can specify different values for the same Key depending on the currently selected language. The following keys are often used: Value=1.0 This is a mandatory field to indicate that the *.desktop file follows the 1.0 version of the specification. Type=Application This is a mandatory field that indicates that the *.desktop file describes an application launcher. Name=Application Name The name of the application. For example Mozilla GenericName=Generic Name A generic description of the application. For example Web Browser Comment=Comment Optional field to specify a tooltip for the application. For example Visit websites on the Internet Icon=Icon File The icon to use for the application. This can either be an absolute path to an image file or an icon-name. If an icon-name is provided an image lookup by name is done in the user's current icon theme. The xdg-icon-resource command can be used to install image files into icon themes. The advantage of using an icon-name instead of an absolute path is that with an icon-name the application icon can be provided in several different sizes as well as in several differently themed styles. Exec=Command Line The command line to start the application. If the application can open files the %f placeholder should be specified. When a file is dropped on the application launcher the %f is replaced with the file path of the dropped file. If multiple files can be specified on the command line the %F placeholder should be used instead of %f. If the application is able to open URLs in addition to local files then %u or %U can be used instead of %f or %F. For a complete oveview of the *.desktop file format please visit http:// www.freedesktop.org/wiki/Standards/desktop-entry-spec Environment Variables xdg-desktop-icon honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-desktop-icon do more verbose reporting on stderr. Setting a higher value increases the verbosity. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. 5 No permission to read one of the files passed on the command line. See Also xdg-icon-resource(1) Examples The company ShinyThings Inc. has developed an application named "WebMirror" and would like to add a launcher for for on the desktop. The company will use "shinythings" as its vendor id. In order to add the application to the desktop there needs to be a .desktop file for the application: shinythings-webmirror.desktop: [Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror Icon=shinythings-webmirror Name=WebMirror Name[nl]=WebSpiegel Now the xdg-desktop-icon tool can be used to add the webmirror.desktop file to the desktop: xdg-desktop-icon install ./shinythings-webmirror.desktop To add a README file to the desktop as well, the following command can be used: xdg-desktop-icon install ./shinythings-README _MANUALPAGE } #@xdg-utils-common@ #---------------------------------------------------------------------------- # Common utility functions included in all XDG wrapper scripts #---------------------------------------------------------------------------- DEBUG() { [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; shift echo "$@" >&2 } #------------------------------------------------------------- # Exit script on successfully completing the desired operation exit_success() { if [ $# -gt 0 ]; then echo "$@" echo fi exit 0 } #----------------------------------------- # Exit script on malformed arguments, not enough arguments # or missing required option. # prints usage information exit_failure_syntax() { if [ $# -gt 0 ]; then echo "xdg-desktop-icon: $@" >&2 echo "Try 'xdg-desktop-icon --help' for more information." >&2 else usage echo "Use 'man xdg-desktop-icon' or 'xdg-desktop-icon --manual' for additional info." fi exit 1 } #------------------------------------------------------------- # Exit script on missing file specified on command line exit_failure_file_missing() { if [ $# -gt 0 ]; then echo "xdg-desktop-icon: $@" >&2 fi exit 2 } #------------------------------------------------------------- # Exit script on failure to locate necessary tool applications exit_failure_operation_impossible() { if [ $# -gt 0 ]; then echo "xdg-desktop-icon: $@" >&2 fi exit 3 } #------------------------------------------------------------- # Exit script on failure returned by a tool application exit_failure_operation_failed() { if [ $# -gt 0 ]; then echo "xdg-desktop-icon: $@" >&2 fi exit 4 } #------------------------------------------------------------ # Exit script on insufficient permission to read a specified file exit_failure_file_permission_read() { if [ $# -gt 0 ]; then echo "xdg-desktop-icon: $@" >&2 fi exit 5 } #------------------------------------------------------------ # Exit script on insufficient permission to write a specified file exit_failure_file_permission_write() { if [ $# -gt 0 ]; then echo "xdg-desktop-icon: $@" >&2 fi exit 6 } check_input_file() { if [ ! -e "$1" ]; then exit_failure_file_missing "file '$1' does not exist" fi if [ ! -r "$1" ]; then exit_failure_file_permission_read "no permission to read file '$1'" fi } check_vendor_prefix() { file_label="$2" [ -n "$file_label" ] || file_label="filename" file=`basename "$1"` case "$file" in [a-zA-Z]*-*) return ;; esac echo "xdg-desktop-icon: $file_label '$file' does not have a proper vendor prefix" >&2 echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 echo "Use --novendor to override or 'xdg-desktop-icon --manual' for additional info." >&2 exit 1 } check_output_file() { # if the file exists, check if it is writeable # if it does not exists, check if we are allowed to write on the directory if [ -e "$1" ]; then if [ ! -w "$1" ]; then exit_failure_file_permission_write "no permission to write to file '$1'" fi else DIR=`dirname "$1"` if [ ! -w "$DIR" -o ! -x "$DIR" ]; then exit_failure_file_permission_write "no permission to create file '$1'" fi fi } #---------------------------------------- # Checks for shared commands, e.g. --help check_common_commands() { while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --help) usage echo "Use 'man xdg-desktop-icon' or 'xdg-desktop-icon --manual' for additional info." exit_success ;; --manual) manualpage exit_success ;; --version) echo "xdg-desktop-icon 1.0.2" exit_success ;; esac done } check_common_commands "$@" [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then # Be silent xdg_redirect_output=" > /dev/null 2> /dev/null" else # All output to stderr xdg_redirect_output=" >&2" fi #-------------------------------------- # Checks for known desktop environments # set variable DE to the desktop environments name, lowercase detectDE() { if [ 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; elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; else DE="" fi } #---------------------------------------------------------------------------- # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 # It also always returns 1 in KDE 3.4 and earlier # Simply return 0 in such case kfmclient_fix_exit_code() { version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE'` major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` test "$major" -gt 3 && return $1 test "$minor" -gt 5 && return $1 test "$release" -gt 4 && return $1 return 0 } [ x"$1" != x"" ] || exit_failure_syntax action= desktop_file= case $1 in install) action=install ;; uninstall) action=uninstall ;; *) exit_failure_syntax "unknown command '$1'" ;; esac shift vendor=true while [ $# -gt 0 ] ; do parm=$1 shift case $parm in --novendor) vendor=false ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ -n "$desktop_file" ] ; then exit_failure_syntax "unexpected argument '$parm'" fi if [ "$action" = "install" ] ; then check_input_file "$parm" fi desktop_file=$parm ;; esac done # Shouldn't happen if [ -z "$action" ] ; then exit_failure_syntax "command argument missing" fi if [ -z "$desktop_file" ] ; then exit_failure_syntax "FILE argument missing" fi filetype= case "$desktop_file" in *.desktop) filetype=desktop if [ "$vendor" = "true" -a "$action" = "install" ] ; then check_vendor_prefix "$desktop_file" fi ;; *) filetype=other ;; esac my_umask=077 desktop_dir="$HOME/Desktop" if xdg-user-dir 2>/dev/null 1>&2; then desktop_dir=`xdg-user-dir DESKTOP` fi desktop_dir_kde=`kde${KDE_SESSION_VERSION}-config --userpath desktop 2> /dev/null` if gconftool-2 -g /apps/nautilus/preferences/desktop_is_home_dir 2> /dev/null | grep true > /dev/null; then desktop_dir_gnome="$HOME" # Don't create $HOME/Desktop if it doesn't exist [ -w "$desktop_dir" ] || desktop_dir= fi if [ -n "$desktop_dir_kde" ]; then if [ ! -d "$desktop_dir_kde" ]; then save_umask=`umask` umask $my_umask mkdir -p "$desktop_dir_kde" umask $save_umask fi # Is the KDE desktop dir != $HOME/Desktop ? if [ x`readlink -f "$desktop_dir"` != x`readlink -f "$desktop_dir_kde"` ]; then # If so, don't create $HOME/Desktop if it doesn't exist [ -w "$desktop_dir" ] || desktop_dir= else desktop_dir_kde= fi fi basefile=`basename "$desktop_file"` DEBUG 1 "$action $desktop_file in $desktop_dir $desktop_dir_kde $desktop_dir_gnome" case $action in install) save_umask=`umask` umask $my_umask for x in "$desktop_dir" "$desktop_dir_kde" "$desktop_dir_gnome" ; do if [ -n "$x" ]; then mkdir -p "$x" eval 'cp "$desktop_file" "$x/$basefile"'$xdg_redirect_output chmod u+x "$x/$basefile" fi done umask $save_umask ;; uninstall) for x in "$desktop_dir" "$desktop_dir_kde" "$desktop_dir_gnome" ; do if [ -n "$x" ]; then rm -f "$x/$basefile" fi done ;; esac exit_success xdg-utils-1.1.0-rc1/scripts/xdg-screensaver0000755000175000017500000005624211507575742020505 0ustar fboudrafboudra#!/bin/sh #--------------------------------------------- # xdg-screensaver # # Utility script to control screensaver. # # Refer to the usage() function below for usage. # # Copyright 2006, Bryce Harrington # # 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. # #--------------------------------------------- manualpage() { cat << _MANUALPAGE Name xdg-screensaver - command line tool for controlling the screensaver Synopsis xdg-screensaver suspend WindowID xdg-screensaver resume WindowID xdg-screensaver { activate | lock | reset | status } xdg-screensaver { --help | --manual | --version } Description xdg-screensaver provides commands to control the screensaver. xdg-screensaver is for use inside a desktop session only. It is not recommended to use xdg-screensaver as root. Commands suspend WindowID Suspends the screensaver and monitor power management. WindowID must be the X Window ID of an existing window of the calling application. The window must remain in existance for the duration of the suspension. WindowID can be represented as either a decimal number or as a hexadecimal number consisting of the prefix 0x followed by one or more hexadecimal digits. The screensaver can be suspended in relation to multiple windows at the same time. In that case screensaver operation is only restored once the screensaver has been resumed in relation to each of the windows resume WindowID Resume the screensaver and monitor power management after being suspended. WindowID must be the same X Window ID that was passed to a previous call of xdg-screensaver suspend activate Turns the screensaver on immediately. This may result in the screen getting locked, depending on existing system policies. lock Lock the screen immediately. reset Turns the screensaver off immediately. If the screen was locked the user may be asked to authenticate first. status Prints enabled to stdout if the screensaver is enabled to turn on after a period of inactivity and prints disabled if the screensaver is not enabled. Options --help Show command synopsis. --manual Show this manualpage. --version Show the xdg-utils version information. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 3 A required tool could not be found. 4 The action failed. Examples xdg-screensaver suspend 0x1c00007 Causes the screensaver to be disabled till xdg-screensaver resume 0x1c00007 is called. 0x1c00007 must be the X Window ID of an existing window. _MANUALPAGE } usage() { cat << _USAGE xdg-screensaver - command line tool for controlling the screensaver Synopsis xdg-screensaver suspend WindowID xdg-screensaver resume WindowID xdg-screensaver { activate | lock | reset | status } xdg-screensaver { --help | --manual | --version } _USAGE } #@xdg-utils-common@ #---------------------------------------------------------------------------- # Common utility functions included in all XDG wrapper scripts #---------------------------------------------------------------------------- DEBUG() { [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; shift echo "$@" >&2 } #------------------------------------------------------------- # Exit script on successfully completing the desired operation exit_success() { if [ $# -gt 0 ]; then echo "$@" echo fi exit 0 } #----------------------------------------- # Exit script on malformed arguments, not enough arguments # or missing required option. # prints usage information exit_failure_syntax() { if [ $# -gt 0 ]; then echo "xdg-screensaver: $@" >&2 echo "Try 'xdg-screensaver --help' for more information." >&2 else usage echo "Use 'man xdg-screensaver' or 'xdg-screensaver --manual' for additional info." fi exit 1 } #------------------------------------------------------------- # Exit script on missing file specified on command line exit_failure_file_missing() { if [ $# -gt 0 ]; then echo "xdg-screensaver: $@" >&2 fi exit 2 } #------------------------------------------------------------- # Exit script on failure to locate necessary tool applications exit_failure_operation_impossible() { if [ $# -gt 0 ]; then echo "xdg-screensaver: $@" >&2 fi exit 3 } #------------------------------------------------------------- # Exit script on failure returned by a tool application exit_failure_operation_failed() { if [ $# -gt 0 ]; then echo "xdg-screensaver: $@" >&2 fi exit 4 } #------------------------------------------------------------ # Exit script on insufficient permission to read a specified file exit_failure_file_permission_read() { if [ $# -gt 0 ]; then echo "xdg-screensaver: $@" >&2 fi exit 5 } #------------------------------------------------------------ # Exit script on insufficient permission to write a specified file exit_failure_file_permission_write() { if [ $# -gt 0 ]; then echo "xdg-screensaver: $@" >&2 fi exit 6 } check_input_file() { if [ ! -e "$1" ]; then exit_failure_file_missing "file '$1' does not exist" fi if [ ! -r "$1" ]; then exit_failure_file_permission_read "no permission to read file '$1'" fi } check_vendor_prefix() { file_label="$2" [ -n "$file_label" ] || file_label="filename" file=`basename "$1"` case "$file" in [a-zA-Z]*-*) return ;; esac echo "xdg-screensaver: $file_label '$file' does not have a proper vendor prefix" >&2 echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 echo "Use --novendor to override or 'xdg-screensaver --manual' for additional info." >&2 exit 1 } check_output_file() { # if the file exists, check if it is writeable # if it does not exists, check if we are allowed to write on the directory if [ -e "$1" ]; then if [ ! -w "$1" ]; then exit_failure_file_permission_write "no permission to write to file '$1'" fi else DIR=`dirname "$1"` if [ ! -w "$DIR" -o ! -x "$DIR" ]; then exit_failure_file_permission_write "no permission to create file '$1'" fi fi } #---------------------------------------- # Checks for shared commands, e.g. --help check_common_commands() { while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --help) usage echo "Use 'man xdg-screensaver' or 'xdg-screensaver --manual' for additional info." exit_success ;; --manual) manualpage exit_success ;; --version) echo "xdg-screensaver 1.0.2" exit_success ;; esac done } check_common_commands "$@" [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then # Be silent xdg_redirect_output=" > /dev/null 2> /dev/null" else # All output to stderr xdg_redirect_output=" >&2" fi #-------------------------------------- # Checks for known desktop environments # set variable DE to the desktop environments name, lowercase detectDE() { if [ 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; elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; else DE="" fi } #---------------------------------------------------------------------------- # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 # It also always returns 1 in KDE 3.4 and earlier # Simply return 0 in such case kfmclient_fix_exit_code() { version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE'` major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` test "$major" -gt 3 && return $1 test "$minor" -gt 5 && return $1 test "$release" -gt 4 && return $1 return 0 } # Check if we can use "mv -T" if mv -T ... ... 2>&1 | grep '\.\.\.' > /dev/null ; then # We can securely move files in /tmp with mv -T DEBUG 1 "mv -T available" MV="mv -T" screensaver_file="/tmp/xdg-screensaver-$USER-"`echo $DISPLAY | sed 's/:/-/g'` else # No secure moves available, use home dir DEBUG 1 "mv -T not available" MV="mv" screensaver_file="$HOME/.xdg-screensaver-"`echo $(hostname)-$DISPLAY | sed 's/:/-/g'` fi lockfile_command=`which lockfile 2> /dev/null` lockfile() { if [ -n "$lockfile_command" ] ; then $lockfile_command -1 -l 10 -s 3 "$screensaver_file".lock else # Poor man's attempt at doing a lockfile # Be careful not to facilitate a symlink attack local try try=0 while ! ln -s "$screensaver_file".lock "$screensaver_file".lock 2> /dev/null; do sleep 1 try=$(($try+1)) if [ $try -eq 3 ] ; then rm -f "$screensaver_file".lock || return # Can't remove lockfile try=0 fi done fi } unlockfile() { rm -f "$screensaver_file".lock } perform_action() { result=1 if [ "$1" = "resume" ] ; then # Restore DPMS state if [ -f "$screensaver_file.dpms" ]; then rm "$screensaver_file.dpms" # Re-enable DPMS xset +dpms fi fi if [ "$1" = "reset" ] ; then if xset -q | grep 'DPMS is Enabled' > /dev/null 2> /dev/null; then xset dpms force on fi fi case "$DE" in kde) if [ x"$KDE_SESSION_VERSION" = x"4" ]; then screensaver_freedesktop "$1" else screensaver_kde "$1" fi ;; gnome_screensaver) screensaver_gnome_screensaver "$1" ;; xscreensaver) screensaver_xscreensaver "$1" ;; '') screensaver_xserver "$1" ;; esac if [ "$1" = "suspend" ] ; then # Save DPMS state if xset -q | grep 'DPMS is Enabled' > /dev/null 2> /dev/null; then test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` $MV "$tmpfile" "$screensaver_file.dpms" # Disable DPMS xset -dpms fi fi } cleanup_suspend() { lockfile test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` grep -v "$window_id:$xprop_pid\$" "$screensaver_file" > "$tmpfile" 2> /dev/null $MV "$tmpfile" "$screensaver_file" if [ ! -s "$screensaver_file" ] ; then rm "$screensaver_file" unlockfile # $screensaver_file is empty, do resume perform_action resume else unlockfile fi } do_resume() { lockfile # Obtain lockfile # Find the PID of the trackingprocess xprop_pid=`grep "$window_id:" "$screensaver_file" 2> /dev/null | cut -d ':' -f 2` unlockfile # Free lockfile if [ -n "$xprop_pid" ] && ps -p "$xprop_pid" 2> /dev/null | grep xprop > /dev/null; then # Kill the tracking process kill -s TERM $xprop_pid fi cleanup_suspend } XPROP=`which xprop 2> /dev/null` check_window_id() { if [ -z "$XPROP" ]; then DEBUG 3 "xprop not found" return fi DEBUG 2 "Running $XPROP -id $window_id" if $XPROP -id $window_id > /dev/null 2> /dev/null; then DEBUG 3 Window $window_id exists else DEBUG 3 Window $window_id does not exist exit_failure_operation_failed "Window $window_id does not exist" fi } track_window() { if [ -z "$XPROP" ]; then # Don't track window if we don't have xprop return fi lockfile test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` # Filter stale entries from the xdg-screensaver status file # Return if $window_id is being tracked already ( already_tracked=1 IFS_save="$IFS" IFS=":" while read wid pid; do if ps -p "$pid" 2> /dev/null | grep xprop > /dev/null; then echo "$wid:$pid" if [ $wid = $window_id ] ; then already_tracked=0 fi fi done IFS="$IFS_save" exit $already_tracked ) < $screensaver_file > $tmpfile already_tracked=$? if [ "$already_tracked" -eq "0" ] ; then $MV "$tmpfile" "$screensaver_file" # We are already tracking $window_id, don't do anything unlockfile return fi # Start tracking $window_id $XPROP -id $window_id -spy > /dev/null & xprop_pid=$! # Add window_id and xprop_pid to the xdg-screensave status file echo "$window_id:$xprop_pid" >> $tmpfile $MV "$tmpfile" "$screensaver_file" unlockfile # Wait for xprop to edit, it means that the window disappeared wait $xprop_pid # Clean up the administration and resume the screensaver cleanup_suspend } screensaver_freedesktop() { case "$1" in suspend) dbus-send --session \ --dest=org.freedesktop.ScreenSaver \ --type=method_call \ --print-reply \ --reply-timeout=2000 \ /ScreenSaver \ org.freedesktop.ScreenSaver.Inhibit \ string:$window_id \ string:xdg-screensaver \ | grep uint32 | cut -d ' ' -f 5 >| "$screensaver_file.cookie" \ 2> /dev/null result=$? ;; resume) if [ -f "$screensaver_file.cookie" ] ; then value=`cat "$screensaver_file.cookie"` dbus-send --session \ --dest=org.freedesktop.ScreenSaver \ --type=method_call \ /ScreenSaver \ org.freedesktop.ScreenSaver.UnInhibit \ uint32:$value \ 2> /dev/null rm -f "$screensaver_file.cookie" fi result=$? ;; activate) dbus-send --session \ --dest=org.freedesktop.ScreenSaver \ --type=method_call \ /ScreenSaver \ org.freedesktop.ScreenSaver.SetActive \ boolean:true \ 2> /dev/null result=$? ;; lock) dbus-send --session \ --dest=org.freedesktop.ScreenSaver \ --type=method_call \ /ScreenSaver \ org.freedesktop.ScreenSaver.Lock \ 2> /dev/null ;; reset) if [ -f "$screensaver_file.cookie" ] ; then value=`cat "$screensaver_file.cookie"` dbus-send --session \ --dest=org.freedesktop.ScreenSaver \ --type=method_call \ /ScreenSaver \ org.freedesktop.ScreenSaver.UnInhibit \ uint32:$value \ 2> /dev/null rm -f "$screensaver_file.cookie" fi result=$? ;; status) status=`dbus-send --session \ --dest=org.freedesktop.ScreenSaver \ --type=method_call \ --print-reply \ --reply-timeout=2000 \ /ScreenSaver \ org.freedesktop.ScreenSaver.GetActive \ | grep boolean | cut -d ' ' -f 5` result=$? if [ x"$status" = "xtrue" ]; then echo "enabled" elif [ x"$status" = "xfalse" ]; then echo "disabled" else echo "ERROR: dbus org.freedesktop.ScreenSaver.GetActive returned '$status'" >&2 return 1 fi ;; *) echo "ERROR: Unknown command '$1'" >&2 return 1 ;; esac } screensaver_kde() { case "$1" in suspend) dcop kdesktop KScreensaverIface enable false > /dev/null result=$? ;; resume) dcop kdesktop KScreensaverIface configure > /dev/null result=$? ;; activate) dcop kdesktop KScreensaverIface save > /dev/null result=$? ;; lock) dcop kdesktop KScreensaverIface lock > /dev/null result=$? ;; reset) # Turns the screensaver off right now dcop kdesktop KScreensaverIface quit > /dev/null result=$? ;; status) status=`dcop kdesktop KScreensaverIface isEnabled` result=$? if [ x"$status" = "xtrue" ]; then echo "enabled" elif [ x"$status" = "xfalse" ]; then echo "disabled" else echo "ERROR: kdesktop KScreensaverIface isEnabled returned '$status'" >&2 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 return 1 ;; esac } screensaver_suspend_loop() { lockfile test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` # Filter stale entries from the xdg-screensaver status file cat "$screensaver_file" 2> /dev/null | ( IFS_save="$IFS" IFS=":" while read wid pid; do if ps -p "$pid" 2> /dev/null | grep xprop > /dev/null; then echo "$wid:$pid" fi done IFS="$IFS_save" ) > $tmpfile if [ -s "$tmpfile" ] ; then # Suspend pending, don't do a thing $MV "$tmpfile" "$screensaver_file" unlockfile return fi $MV "$tmpfile" "$screensaver_file" unlockfile (while [ -f "$screensaver_file" ]; do $*; sleep 50; done) > /dev/null 2> /dev/null & } 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 case "$1" in suspend) screensaver_suspend_loop gnome-screensaver-command --poke result=0 ;; resume) # Automatic resume when $screensaver_file disappears result=0 ;; activate) gnome-screensaver-command --activate > /dev/null 2> /dev/null result=$? ;; lock) gnome-screensaver-command --lock > /dev/null 2> /dev/null result=$? ;; reset) # Turns the screensaver off right now gnome-screensaver-command --deactivate > /dev/null 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 echo "enabled" else # Something is wrong echo "disabled" fi ;; *) echo "ERROR: Unknown command '$1" >&2 return 1 ;; esac } screensaver_xscreensaver() { case "$1" in suspend) screensaver_suspend_loop xscreensaver-command -deactivate result=0 ;; resume) # Automatic resume when $screensaver_file disappears result=0 ;; activate) xscreensaver-command -activate > /dev/null 2> /dev/null result=$? ;; lock) xscreensaver-command -lock > /dev/null 2> /dev/null result=$? ;; reset) # Turns the screensaver off right now xscreensaver-command -deactivate > /dev/null 2> /dev/null result=$? ;; status) result=0 if [ -f "$screensaver_file" ] ; then echo "disabled" else echo "enabled" fi ;; *) echo "ERROR: Unknown command '$1" >&2 return 1 ;; esac } [ x"$1" != x"" ] || exit_failure_syntax action= window_id= case $1 in suspend) action="$1" shift if [ -z "$1" ] ; then exit_failure_syntax "WindowID argument missing" fi window_id="$1" check_window_id ;; resume) action="$1" shift if [ -z "$1" ] ; then exit_failure_syntax "WindowID argument missing" fi window_id="$1" check_window_id ;; activate) action="$1" ;; lock) action="$1" ;; reset) action="$1" ;; status) action="$1" ;; *) exit_failure_syntax "unknown command '$1'" ;; esac detectDE # Consider "xscreensaver" a separate DE xscreensaver-command -version 2> /dev/null | grep XScreenSaver > /dev/null && DE="xscreensaver" # Consider "gnome-screensaver" a separate DE gnome-screensaver-command -q > /dev/null 2>&1 && DE="gnome_screensaver" if [ "$action" = "resume" ] ; then do_resume exit_success fi perform_action "$action" if [ "$action" = "suspend" ] ; then # Start tracking $window_id and resume the screensaver once it disappears ( track_window ) 2> /dev/null > /dev/null & fi if [ $result -eq 0 ]; then exit_success else exit_failure_operation_failed fi xdg-utils-1.1.0-rc1/scripts/xdg-desktop-menu0000755000175000017500000011241711507575742020575 0ustar fboudrafboudra#!/bin/sh #--------------------------------------------- # xdg-desktop-menu # # Utility script to install menu items on a Linux desktop. # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # 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. # #--------------------------------------------- manualpage() { cat << _MANUALPAGE Name xdg-desktop-menu - command line tool for (un)installing desktop menu items Synopsis xdg-desktop-menu install [--noupdate] [--novendor] [--mode mode] directory-file (s) desktop-file(s) xdg-desktop-menu uninstall [--noupdate] [--mode mode] directory-file(s) desktop-file(s) xdg-desktop-menu forceupdate [--mode mode] xdg-desktop-menu { --help | --manual | --version } Description The xdg-desktop-menu program can be used to install new menu entries to the desktop's application menu. The application menu works according to the XDG Desktop Menu Specification at http://www.freedesktop.org/Standards/menu-spec Commands install Install one or more applications in a submenu of the desktop menu system. desktop-file: A desktop file represents a single menu entry in the menu. Desktop files are defined by the freedesktop.org Desktop Entry Specification. The most important aspects of *.desktop files are summarized below. Menu entries can be added to the menu system in two different ways. They can either be added to a predefined submenu in the menu system based on one or more category keywords, or they can be added to a new submenu. To add a menu entry to a predefined submenu the desktop file that represents the menu entry must have a Categories= entry that lists one or more keywords. The menu item will be included in an appropriate submenu based on the included keywords. To add menu items to a new submenu the desktop-files must be preceded by a directory-file that describes the submenu. If multiple desktop-files are specified, all entries will be added to the same menu. If entries are installed to a menu that has been created with a previous call to xdg-desktop-menu the entries will be installed in addition to any already existing entries. directory-file: The *.directory file indicated by directory-file represents a submenu. The directory file provides the name and icon for a submenu. The name of the directory file is used to identify the submenu. If multiple directory files are provided each file will represent a submenu within the menu that preceeds it, creating a nested menu hierarchy (sub-sub-menus). The menu entries themselves will be added to the last submenu. Directory files follow the syntax defined by the freedesktop.org Desktop Entry Specification. uninstall Remove applications or submenus from the desktop menu system previously installed with xdg-desktop-menu install. A submenu and the associated directory file is only removed when the submenu no longer contains any menu entries. forceupdate Force an update of the menu system. This command is only useful if the last call to xdg-desktop-menu included the --noupdate option. Options --noupdate Postpone updating the menu system. If multiple updates to the menu system are made in sequence this flag can be used to indicate that additional changes will follow and that it is not necassery to update the menu system right away. --novendor Normally, xdg-desktop-menu checks to ensure that any *.directory and *.desktop files to be installed has a vendor prefix. This option can be used to disable that check. A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. --mode mode mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode. The default is to use system mode when called by root and to use user mode when called by a non-root user. --help Show command synopsis. --manual Show this manualpage. --version Show the xdg-utils version information. Desktop Files An application item in the application menu is represented by a *.desktop file. A *.desktop file consists of a [Desktop Entry] header followed by several Key= Value lines. A *.desktop file can provide a name and description for an application in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the Key. This way one can specify different values for the same Key depending on the currently selected language. The following keys are often used: Value=1.0 This is a mandatory field to indicate that the *.desktop file follows the 1.0 version of the specification. Type=Application This is a mandatory field that indicates that the *.desktop file describes an application launcher. Name=Application Name The name of the application. For example Mozilla GenericName=Generic Name A generic description of the application. For example Web Browser Comment=Comment Optional field to specify a tooltip for the application. For example Visit websites on the Internet Icon=Icon File The icon to use for the application. This can either be an absolute path to an image file or an icon-name. If an icon-name is provided an image lookup by name is done in the user's current icon theme. The xdg-icon-resource command can be used to install image files into icon themes. The advantage of using an icon-name instead of an absolute path is that with an icon-name the application icon can be provided in several different sizes as well as in several differently themed styles. Exec=Command Line The command line to start the application. If the application can open files the %f placeholder should be specified. When a file is dropped on the application launcher the %f is replaced with the file path of the dropped file. If multiple files can be specified on the command line the %F placeholder should be used instead of %f. If the application is able to open URLs in addition to local files then %u or %U can be used instead of %f or %F. Categories=Categories A list of categories separated by semi-colons. A category is a keyword that describes and classifies the application. By default applications are organized in the application menu based on category. When menu entries are explicitly assigned to a new submenu it is not necassery to list any categories. When using categories it is recommended to include one of the following categories: AudioVideo, Development, Education, Game, Graphics, Network, Office, Settings, System, Utility. See Appendix A of the XDG Desktop Menu Specification for information about additional categories. http://standards.freedesktop.org/menu-spec/ menu-spec-1.0.html MimeType=Mimetypes A list of mimetypes separated by semi-colons. This field is used to indicate which file types the application is able to open. For a complete oveview of the *.desktop file format please visit http:// www.freedesktop.org/wiki/Standards/desktop-entry-spec Directory Files The appearance of submenu in the application menu is provided by a *.directory file. In particular it provides the title of the submenu and a possible icon. A *.directory file consists of a [Desktop Entry] header followed by several Key= Value lines. A *.directory file can provide a title (name) for the submenu in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the Key. This way one can specify different values for the same Key depending on the currently selected language. The following keys are relevqnt for submenus: Value=1.0 This is a mandatory field to indicate that the *.directory file follows the 1.0 version of the Desktop Entry specification. Type=Directory This is a mandatory field that indicates that the *.directory file describes a submenu. Name=Menu Name The title of submenu. For example Mozilla Comment=Comment Optional field to specify a tooltip for the submenu. Icon=Icon File The icon to use for the submenu. This can either be an absolute path to an image file or an icon-name. If an icon-name is provided an image lookup by name is done in the user's current icon theme. The xdg-icon-resource command can be used to install image files into icon themes. The advantage of using an icon-name instead of an absolute path is that with an icon-name the submenu icon can be provided in several different sizes as well as in several differently themed styles. Environment Variables xdg-desktop-menu honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-desktop-menu do more verbose reporting on stderr. Setting a higher value increases the verbosity. XDG_UTILS_INSTALL_MODE This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. 5 No permission to read one of the files passed on the command line. See Also xdg-desktop-icon(1), xdg-icon-resource(1), xdg-mime(1) Examples The company ShinyThings Inc. has developed an application named "WebMirror" and would like to add it to the application menu. The company will use "shinythings" as its vendor id. In order to add the application to the menu there needs to be a .desktop file with a suitable Categories entry: shinythings-webmirror.desktop: [Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror Icon=webmirror Name=WebMirror Name[nl]=WebSpiegel Categories=Network;WebDevelopment; Now the xdg-desktop-menu tool can be used to add the shinythings-webmirror.desktop file to the desktop application menu: xdg-desktop-menu install ./shinythings-webmirror.desktop Note that for the purpose of this example the menu items are available in two languages, English and Dutch. The language code for Dutch is nl. In the next example the company ShinyThings Inc. will add its own submenu to the desktop application menu consisting of a "WebMirror" menu item and a "WebMirror Admin Tool" menu item. First the company needs to create two .desktop files that describe the two menu items. Since the items are to be added to a new submenu it is not necassery to include a Categories= line: shinythings-webmirror.desktop: [Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror Icon=shinythings-webmirror Name=WebMirror Name[nl]=WebSpiegel shinythings-webmirror-admin.desktop: [Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror-admintool Icon=shinythings-webmirror-admintool Name=WebMirror Admin Tool Name[nl]=WebSpiegel Administratie Tool In addition a .directory file needs to be created to provide a title and icon for the sub-menu itself: shinythings-webmirror.directory: [Desktop Entry] Encoding=UTF-8 Icon=shinythings-webmirror-menu Name=WebMirror Name[nl]=WebSpiegel These file can now be installed with: xdg-desktop-menu install ./shinythings-webmirror.directory \ ./shinythings-webmirror.desktop ./shinythings-webmirror-admin.desktop The menu entries could also be installed one by one: xdg-desktop-menu install --noupdate ./shinythings-webmirror.directory \ ./shinythings-webmirror.desktop xdg-desktop-menu install --noupdate ./shinythings-webmirror.directory \ ./shinythings-webmirror-admin.desktop xdg-desktop-menu forceupdate Although the result is the same it is slightly more efficient to install all files at the same time. The *.desktop and *.directory files reference icons with the names webmirror, webmirror-admin and webmirror-menu which should also be installed. In this example the icons are installed in two different sizes, once with a size of 22x22 pixels and once with a size of 64x64 pixels: xdg-icon-resource install --size 22 ./wmicon-22.png shinythings-webmirror xdg-icon-resource install --size 22 ./wmicon-menu-22.png shinythings-webmirror-menu xdg-icon-resource install --size 22 ./wmicon-admin-22.png shinythings-webmirror-admin xdg-icon-resource install --size 64 ./wmicon-64.png shinythings-webmirror xdg-icon-resource install --size 64 ./wmicon-menu-64.png shinythings-webmirror-menu xdg-icon-resource install --size 64 ./wmicon-admin-64.png shinythings-webmirror-admin _MANUALPAGE } usage() { cat << _USAGE xdg-desktop-menu - command line tool for (un)installing desktop menu items Synopsis xdg-desktop-menu install [--noupdate] [--novendor] [--mode mode] directory-file (s) desktop-file(s) xdg-desktop-menu uninstall [--noupdate] [--mode mode] directory-file(s) desktop-file(s) xdg-desktop-menu forceupdate [--mode mode] xdg-desktop-menu { --help | --manual | --version } _USAGE } #@xdg-utils-common@ #---------------------------------------------------------------------------- # Common utility functions included in all XDG wrapper scripts #---------------------------------------------------------------------------- DEBUG() { [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; shift echo "$@" >&2 } #------------------------------------------------------------- # Exit script on successfully completing the desired operation exit_success() { if [ $# -gt 0 ]; then echo "$@" echo fi exit 0 } #----------------------------------------- # Exit script on malformed arguments, not enough arguments # or missing required option. # prints usage information exit_failure_syntax() { if [ $# -gt 0 ]; then echo "xdg-desktop-menu: $@" >&2 echo "Try 'xdg-desktop-menu --help' for more information." >&2 else usage echo "Use 'man xdg-desktop-menu' or 'xdg-desktop-menu --manual' for additional info." fi exit 1 } #------------------------------------------------------------- # Exit script on missing file specified on command line exit_failure_file_missing() { if [ $# -gt 0 ]; then echo "xdg-desktop-menu: $@" >&2 fi exit 2 } #------------------------------------------------------------- # Exit script on failure to locate necessary tool applications exit_failure_operation_impossible() { if [ $# -gt 0 ]; then echo "xdg-desktop-menu: $@" >&2 fi exit 3 } #------------------------------------------------------------- # Exit script on failure returned by a tool application exit_failure_operation_failed() { if [ $# -gt 0 ]; then echo "xdg-desktop-menu: $@" >&2 fi exit 4 } #------------------------------------------------------------ # Exit script on insufficient permission to read a specified file exit_failure_file_permission_read() { if [ $# -gt 0 ]; then echo "xdg-desktop-menu: $@" >&2 fi exit 5 } #------------------------------------------------------------ # Exit script on insufficient permission to write a specified file exit_failure_file_permission_write() { if [ $# -gt 0 ]; then echo "xdg-desktop-menu: $@" >&2 fi exit 6 } check_input_file() { if [ ! -e "$1" ]; then exit_failure_file_missing "file '$1' does not exist" fi if [ ! -r "$1" ]; then exit_failure_file_permission_read "no permission to read file '$1'" fi } check_vendor_prefix() { file_label="$2" [ -n "$file_label" ] || file_label="filename" file=`basename "$1"` case "$file" in [a-zA-Z]*-*) return ;; esac echo "xdg-desktop-menu: $file_label '$file' does not have a proper vendor prefix" >&2 echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 echo "Use --novendor to override or 'xdg-desktop-menu --manual' for additional info." >&2 exit 1 } check_output_file() { # if the file exists, check if it is writeable # if it does not exists, check if we are allowed to write on the directory if [ -e "$1" ]; then if [ ! -w "$1" ]; then exit_failure_file_permission_write "no permission to write to file '$1'" fi else DIR=`dirname "$1"` if [ ! -w "$DIR" -o ! -x "$DIR" ]; then exit_failure_file_permission_write "no permission to create file '$1'" fi fi } #---------------------------------------- # Checks for shared commands, e.g. --help check_common_commands() { while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --help) usage echo "Use 'man xdg-desktop-menu' or 'xdg-desktop-menu --manual' for additional info." exit_success ;; --manual) manualpage exit_success ;; --version) echo "xdg-desktop-menu 1.0.2" exit_success ;; esac done } check_common_commands "$@" [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then # Be silent xdg_redirect_output=" > /dev/null 2> /dev/null" else # All output to stderr xdg_redirect_output=" >&2" fi #-------------------------------------- # Checks for known desktop environments # set variable DE to the desktop environments name, lowercase detectDE() { if [ 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; elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; else DE="" fi } #---------------------------------------------------------------------------- # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 # It also always returns 1 in KDE 3.4 and earlier # Simply return 0 in such case kfmclient_fix_exit_code() { version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE'` major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` test "$major" -gt 3 && return $1 test "$minor" -gt 5 && return $1 test "$release" -gt 4 && return $1 return 0 } update_desktop_database() { # echo Update desktop database: $mode if [ "$mode" = "system" ] ; then for x in `echo $PATH | sed 's/:/ /g'` /opt/gnome/bin; do if [ -x $x/update-desktop-database ] ; then DEBUG 1 "Running $x/update-desktop-database" eval '$x/update-desktop-database'$xdg_redirect_output return fi done fi } # Make application $1/$2 the default for all the mimetypes it support, # iff such mimetype didn't had a default application already. # $1 Install dir for desktop file # $2 base name of desktop file make_lazy_default() { local mimetypes local xdg_user_dir local xdg_default_dirs DEBUG 1 "make_lazy_default $1/$2" mimetypes=`awk ' { if (match($0,/MimeType=/)) { split(substr($0,RSTART+9),mimetypes,";") for (n in mimetypes) { if (mimetypes[n]) print mimetypes[n] } } }' "$1/$2" 2> /dev/null` for MIME in $mimetypes ; do xdg_default_dirs="$XDG_DATA_DIRS" [ -n "$xdg_default_dirs" ] || xdg_default_dirs=/usr/local/share/:/usr/share/ if [ x"$mode" = x"user" ] ; then xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_default_dirs="$xdg_user_dir:$xdg_default_dirs" fi local default_app for x in `echo "$xdg_default_dirs" | sed 's/:/ /g'`; do DEBUG 2 "Checking $x/applications/defaults.list" default_app=`grep "$MIME=" $x/applications/defaults.list 2> /dev/null | cut -d '=' -f 2` if [ -n "$default_app" ] ; then DEBUG 2 "Found default apps for $MIME: $default_app" default_app="$default_app;" break; fi done DEBUG 2 "Current default apps for $MIME: $default_app" if echo "$default_app" | grep "$2" > /dev/null 2> /dev/null; then # App already listed as default continue; fi default_file="$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 echo "[Default Applications]" >> ${default_file}.new fi echo $MIME="$default_app$2" >> ${default_file}.new mv ${default_file}.new $default_file done } update_submenu() { DEBUG 1 "update_submenu $1" menu_file="$1" xdg_dir_name=menus xdg_user_dir="$XDG_CONFIG_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.config" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_system_dirs="$XDG_CONFIG_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/etc/xdg xdg_global_dir= for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do if [ -w $x/$xdg_dir_name ] ; then xdg_global_dir="$x/$xdg_dir_name" break fi done xdg_user_dir="$xdg_user_dir/applications-merged" xdg_global_dir="$xdg_global_dir/applications-merged" DEBUG 3 "Install locations for *.menu file:" DEBUG 3 "xdg_user_dir: $xdg_user_dir" DEBUG 3 "xdg_global_dir: $xdg_global_dir" DEBUG 3 "kde_user_dir: $kde_user_dir" DEBUG 3 "kde_global_dir: $kde_global_dir" DEBUG 3 "gnome_user_dir: $gnome_user_dir" DEBUG 3 "gnome_global_dir: $gnome_global_dir" if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_user_dir" kde_dir="$kde_user_dir" gnome_dir="$gnome_user_dir" my_umask=077 my_chmod=0600 else xdg_dir="$xdg_global_dir" kde_dir="$kde_global_dir" gnome_dir="$gnome_global_dir" my_umask=022 my_chmod=0644 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then exit_failure_operation_impossible "No writable system menu directory found." fi fi if [ -z "$menu_file" ] ; then # Work around for SUSE/gnome 2.12 to pick up new ~/.local/share/applications save_umask=`umask` umask $my_umask mkdir -p $xdg_dir touch $xdg_dir/xdg-desktop-menu-dummy.menu umask $save_umask return fi if [ $action = "install" -a -f "/etc/xdg/menus/gnome-applications.menu" ] ; then # Work around for Debian Gnome gnome_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/gnome-applications-merged^'` if [ ! -e "$gnome_xdg_dir" ] ; then DEBUG 1 "Debian Workaround: Link '$xdg_dir' to '$gnome_xdg_dir'" mkdir -p `dirname "$gnome_xdg_dir"` eval 'ln -s "applications-merged" "$gnome_xdg_dir"'$xdg_redirect_output fi fi if [ $action = "install" -a -f "/etc/mandrake-release" ] ; then # Work around for Mandriva 2006 mandrake_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/applications-mdk-merged^'` if [ ! -e "$mandrake_xdg_dir" ] ; then DEBUG 1 "Mandriva Workaround: Link '$xdg_dir' to '$mandrake_xdg_dir'" mkdir -p `dirname "$mandrake_xdg_dir"` eval 'ln -s "applications-merged" "$mandrake_xdg_dir"'$xdg_redirect_output fi fi if [ $action = "install" -a x"$mode" = x"user" -a -d "/etc/xdg/menus/kde-applications-merged" ] ; then # Work around for Fedora Core 5 + patched KDE kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-applications-merged^'` if [ ! -e "$kde_xdg_dir" ] ; then DEBUG 1 "Fedora Workaround: Link '$xdg_dir' to '$kde_xdg_dir'" mkdir -p `dirname "$kde_xdg_dir"` eval 'ln -s "applications-merged" "$kde_xdg_dir"'$xdg_redirect_output fi fi if [ $action = "install" -a x"$mode" = x"system" -a -d "/etc/xdg/menus/kde-applications-merged" -a ! -d "/etc/xdg/menus/applications-merged" ] ; then # Work around for Kubuntu 6.06 kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-applications-merged^'` DEBUG 1 "Kubuntu Workaround: Link '$xdg_dir' to 'kde-applications-merged'" eval 'ln -s "kde-applications-merged" "$xdg_dir"'$xdg_redirect_output fi orig_menu_file=$xdg_dir/$menu_file DEBUG 1 "Updating $orig_menu_file ($action)" test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` orig_desktop_files= if [ -r "$orig_menu_file" ] ; then awk ' # List all files within tags BEGIN { RS="<" } /^Filename/ { if (match($0,/>/)) { print substr($0,RSTART+1) } }' $orig_menu_file > $tmpfile fi orig_desktop_files=`cat $tmpfile` new_desktop_files= if [ $action = "install" ] ; then for desktop_file in $desktop_files; do basefile=`basename "$desktop_file"` if ! grep '^'$basefile'$' $tmpfile > /dev/null 2> /dev/null ; then # Append echo "$basefile" >> $tmpfile fi done new_desktop_files=`cat $tmpfile` fi if [ $action = "uninstall" ] ; then echo > $tmpfile for desktop_file in $desktop_files; do echo "$desktop_file" >> $tmpfile done # Files to uninstall are listed in $tmpfile # Existing files are in $orig_desktop_files for desktop_file in $orig_desktop_files; do if ! grep '^'$desktop_file'$' $tmpfile > /dev/null 2> /dev/null; then # Keep this file, it's not in the uninstall list new_desktop_files="$new_desktop_files $desktop_file" fi done fi rm -f "$tmpfile" DEBUG 3 "Files to list in $menu_file: $new_desktop_files" if [ -n "$new_desktop_files" ] ; then # Install/update test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` ( echo '' echo '' echo '' echo ' Applications' for desktop_file in $directory_files; do basefile=`basename "$desktop_file"` basefilename=`echo "$basefile"|cut -d '.' -f 1` echo "" echo " $basefilename" echo " $basefile" done echo " " for desktop_file in $new_desktop_files; do echo " $desktop_file" done echo " " for desktop_file in $directory_files; do echo "" done echo '' ) > $tmpfile chmod $my_chmod $tmpfile save_umask=`umask` umask $my_umask mkdir -p $xdg_dir eval 'cp $tmpfile $xdg_dir/$menu_file'$xdg_redirect_output umask $save_umask rm -f "$tmpfile" else # Uninstall rm -f $xdg_dir/$menu_file fi # Uninstall .directory files only if no longer referenced if [ $action = "uninstall" ] ; then test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` for menu_file in $xdg_dir/*; do if grep 'generated and managed by xdg-desktop-menu' $menu_file > /dev/null 2> /dev/null; then awk ' # List all files within tags BEGIN { RS="<" } /^Directory/ { if (match($0,/>/)) { print substr($0,RSTART+1) } }' $menu_file >> $tmpfile fi done orig_directory_files="$directory_files" directory_files= for desktop_file in $orig_directory_files; do if ! grep '^'$desktop_file'$' $tmpfile > /dev/null 2> /dev/null; then # No longer in use, safe to delete directory_files="$directory_files $desktop_file" fi done rm -f "$tmpfile" fi } [ x"$1" != x"" ] || exit_failure_syntax mode= action= update=yes desktop_files= directory_files= case $1 in install) action=install ;; uninstall) action=uninstall ;; forceupdate) action=forceupdate ;; *) exit_failure_syntax "unknown command '$1'" ;; esac shift vendor=true while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --noupdate) update=no ;; --mode) if [ -z "$1" ] ; then exit_failure_syntax "mode argument missing for --mode" fi case "$1" in user) mode="user" ;; system) mode="system" ;; *) exit_failure_syntax "unknown mode '$1'" ;; esac shift ;; --novendor) vendor=false ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ "$action" = "install" ] ; then check_input_file "$parm" fi case "$parm" in *.directory) if [ -n "$desktop_files" ] ; then exit_failure_syntax "'$parm' must preceed any *.desktop file" fi directory_files="$directory_files $parm" ;; *.desktop) desktop_files="$desktop_files $parm" ;; *) exit_failure_syntax "file to $action must be a *.directory or *.desktop file" ;; esac ;; esac done # Shouldn't happen if [ -z "$action" ] ; then exit_failure_syntax "command argument missing" fi if [ -n "$XDG_UTILS_INSTALL_MODE" ] ; then if [ "$XDG_UTILS_INSTALL_MODE" = "system" ] ; then mode="system" elif [ "$XDG_UTILS_INSTALL_MODE" = "user" ] ; then mode="user" fi fi if [ -z "$mode" ] ; then if [ `whoami` = "root" ] ; then mode="system" else mode="user" fi fi if [ x"$action" = x"forceupdate" ] ; then update_desktop_database exit_success fi if [ -z "$desktop_files" ] ; then exit_failure_syntax "desktop-file argument missing" fi menu_name= for desktop_file in $directory_files; do if [ "$vendor" = "true" -a "$action" = "install" ] ; then check_vendor_prefix "$desktop_file" fi basefilename=`basename "$desktop_file" | cut -d '.' -f 1` if [ -z "$menu_name" ] ; then menu_name="$basefilename" else menu_name="$menu_name-$basefilename" fi done if [ -n "$menu_name" ] ; then if [ x"$mode" = x"user" ] ; then update_submenu "user-$menu_name.menu" else update_submenu "$menu_name.menu" fi else # Work around for SUSE/gnome 2.12 to pick up new ~/.local/share/applications if [ x"$mode" = x"user" ] ; then update_submenu fi fi # Install *.directory files xdg_dir_name=desktop-directories xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ xdg_global_dir= for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do if [ -w $x/$xdg_dir_name ] ; then xdg_global_dir="$x/$xdg_dir_name" break fi done DEBUG 3 "Install locations for *.directory files:" DEBUG 3 "xdg_user_dir: $xdg_user_dir" DEBUG 3 "xdg_global_dir: $xdg_global_dir" DEBUG 3 "kde_user_dir: $kde_user_dir" DEBUG 3 "kde_global_dir: $kde_global_dir" DEBUG 3 "gnome_user_dir: $gnome_user_dir" DEBUG 3 "gnome_global_dir: $gnome_global_dir" if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_user_dir" kde_dir="$kde_user_dir" gnome_dir="$gnome_user_dir" my_umask=077 else xdg_dir="$xdg_global_dir" kde_dir="$kde_global_dir" gnome_dir="$gnome_global_dir" my_umask=022 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then exit_failure_operation_impossible "No writable system menu directory found." fi fi for desktop_file in $directory_files; do basefile=`basename "$desktop_file"` DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir $gnome_dir" case $action in install) save_umask=`umask` umask $my_umask for x in $xdg_dir $kde_dir $gnome_dir ; do mkdir -p $x eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output done umask $save_umask ;; uninstall) for x in $xdg_dir $kde_dir $gnome_dir ; do rm -f $x/$basefile done ;; esac done # Install *.desktop files xdg_dir_name=applications xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ xdg_global_dir= for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do if [ -w $x/$xdg_dir_name ] ; then xdg_global_dir="$x/$xdg_dir_name" break fi done kde_user_dir=`kde${KDE_SESSION_VERSION}-config --path apps 2> /dev/null | cut -d ':' -f 1` kde_global_dir=`kde${KDE_SESSION_VERSION}-config --path apps 2> /dev/null | cut -d ':' -f 2` [ -w $kde_global_dir ] || kde_global_dir= gnome_user_dir="$HOME/.gnome/apps" gnome_global_dir="/usr/share/gnome/apps" [ -w $gnome_global_dir ] || gnome_global_dir= DEBUG 3 "Install locations for *.desktop files:" DEBUG 3 "xdg_user_dir: $xdg_user_dir" DEBUG 3 "xdg_global_dir: $xdg_global_dir" DEBUG 3 "kde_user_dir: $kde_user_dir" DEBUG 3 "kde_global_dir: $kde_global_dir" DEBUG 3 "gnome_user_dir: $gnome_user_dir" DEBUG 3 "gnome_global_dir: $gnome_global_dir" if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_user_dir" kde_dir="$kde_user_dir" gnome_dir="$gnome_user_dir" my_umask=077 else xdg_dir="$xdg_global_dir" kde_dir="$kde_global_dir" gnome_dir="$gnome_global_dir" my_umask=022 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then exit_failure_operation_impossible "No writable system menu directory found." fi fi for desktop_file in $desktop_files; do if [ "$vendor" = "true" -a "$action" = "install" ] ; then check_vendor_prefix "$desktop_file" fi basefile=`basename "$desktop_file"` DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir $gnome_dir" case $action in install) save_umask=`umask` umask $my_umask for x in $xdg_dir $kde_dir $gnome_dir ; do mkdir -p $x eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output done if [ -f $kde_dir/$basefile ] ; then echo "OnlyShowIn=Old;" >> $kde_dir/$basefile fi if [ -f $gnome_dir/$basefile ] ; then echo "OnlyShowIn=Old;" >> $gnome_dir/$basefile fi make_lazy_default "$xdg_dir" "$basefile" umask $save_umask ;; uninstall) for x in $xdg_dir $kde_dir $gnome_dir ; do rm -f $x/$basefile done ;; esac done if [ x"$update" = x"yes" ] ; then update_desktop_database fi exit_success xdg-utils-1.1.0-rc1/scripts/Makefile.in0000644000175000017500000000551411507575742017520 0ustar fboudrafboudraMKDIR = mkdir -p RMDIR = rmdir INSTALL = @INSTALL@ $(INSTALL_FLAGS) INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS) INSTALL_LIBRARY = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS) INSTALL_SCRIPT = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS) INSTALL_DATA = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS) XMLTO = @XMLTO@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ SCRIPTS = \ xdg-desktop-menu \ xdg-desktop-icon \ xdg-mime \ xdg-icon-resource \ xdg-open \ xdg-email \ xdg-screensaver \ xdg-settings # xdg-su # xdg-copy \ # xdg-file-dialog # xdg-terminal MANPAGES= $(SCRIPTS:%=man/%.1) WEBPAGES= $(SCRIPTS:%=%.html) XMLFILES= $(SCRIPTS:%=desc/%.xml) all: html: index.html $(WEBPAGES) scripts: README $(SCRIPTS) man: $(MANPAGES) release: scripts html man rm -f xdg-*.in *~ HACKING generate-help-script.awk rm -rf desc/ rm -rf xsl/ rm -f xdg-file-dialog xdg-su xdg-copy xdg-terminal distclean: clean rm -f Makefile clean: scripts-clean: rm -f $(SCRIPTS) README man/xdg-*.1 html/xdg-*.html README: $(SCRIPTS) echo > $@ @for x in $(SCRIPTS) ; do \ sh ./$$x --help | grep -B 100 Synopsis | sed -e '$$d' >> $@ ; \ done install: $(MKDIR) $(DESTDIR)$(bindir) for x in $(SCRIPTS) ; do \ $(INSTALL_SCRIPT) $$x $(DESTDIR)$(bindir) ; \ done $(MKDIR) $(DESTDIR)$(mandir) $(MKDIR) $(DESTDIR)$(mandir)/man1 for x in $(MANPAGES) ; do \ if [ -f $$x ]; then \ $(INSTALL_DATA) $$x $(DESTDIR)$(mandir)/man1 ; \ fi ; \ done uninstall: for x in $(MANPAGES) ; do \ rm -f $(DESTDIR)$(mandir)/man1/`basename $$x` ; \ done -$(RMDIR) $(DESTDIR)$(mandir)/man1 -$(RMDIR) $(DESTDIR)$(mandir) for x in $(SCRIPTS) ; do \ rm -f $(DESTDIR)$(bindir)/$$x ; \ done -$(RMDIR) $(DESTDIR)$(bindir) %: %.in %.txt awk -f generate-help-script.awk $@.in | sed -e 's/@NAME@/'$@'/g' > $@ chmod a+x $@ xdg-desktop-menu: xdg-desktop-menu.in xdg-utils-common.in xdg-desktop-icon: xdg-desktop-icon.in xdg-utils-common.in xdg-email: xdg-email.in xdg-utils-common.in xdg-mime: xdg-mime.in xdg-utils-common.in xdg-open: xdg-open.in xdg-utils-common.in xdg-screensaver: xdg-screensaver.in xdg-utils-common.in xdg-settings: xdg-settings.in xdg-utils-common.in xdg-icon-resource: xdg-icon-resource.in xdg-utils-common.in xdg-su: xdg-su.in xdg-utils-common.in xdg-copy: xdg-copy.in xdg-utils-common.in xdg-file-dialog: xdg-file-dialog.in xdg-utils-common.in xdg-terminal: xdg-terminal.in xdg-utils-common.in man/%.1: desc/%.xml (cd man;$(XMLTO) man ../$<) index.html: $(XMLFILES) (cat html/index.html.pre; \ xsltproc xsl/refentry2htmlindex.xsl $(XMLFILES); \ cat html/index.html.post ) > html/index.html %.html: desc/%.xml (cd html;$(XMLTO) html-nochunks ../$<) %.txt: desc/%.xml $(XMLTO) txt $< xdg-utils-1.1.0-rc1/scripts/xdg-settings0000755000175000017500000006115611507575742020025 0ustar fboudrafboudra#!/bin/sh #--------------------------------------------- # xdg-settings # # Utility script to get various settings from the desktop environment. # # Refer to the usage() function below for usage. # # Copyright 2009, Google Inc. # # 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. # #--------------------------------------------- manualpage() { cat << _MANUALPAGE Name xdg-settings - get various settings from the desktop environment Synopsis xdg-settings { get | check | set } {property} [value] xdg-settings { --help | --list | --manual | --version } Description xdg-settings gets various settings from the desktop environment. For instance, desktop environments often provide proxy configuration and default web browser settings. Using xdg-settings these parameters can be extracted for use by applications that do not use the desktop environment's libraries (which would use the settings natively). xdg-settings is for use inside a desktop session only. It is not recommended to use xdg-settings as root. Options --help Show command synopsis. --list List all properties xdg-settings knows about. --manual Show this manualpage. --version Show the xdg-utils version information. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. Examples Get the desktop file name of the current default web browser xdg-settings get default-web-browser Check whether the default web browser is firefox.desktop, which can be false even if "get default-web-browser" says that is the current value (if only some of the underlying settings actually reflect that value) xdg-settings check default-web-browser firefox.desktop Set the default web browser to google-chrome.desktop xdg-settings set default-web-browser google-chrome.desktop _MANUALPAGE } usage() { cat << _USAGE xdg-settings - get various settings from the desktop environment Synopsis xdg-settings { get | check | set } {property} [value] xdg-settings { --help | --list | --manual | --version } _USAGE } #@xdg-utils-common@ #---------------------------------------------------------------------------- # Common utility functions included in all XDG wrapper scripts #---------------------------------------------------------------------------- DEBUG() { [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; shift echo "$@" >&2 } #------------------------------------------------------------- # Exit script on successfully completing the desired operation exit_success() { if [ $# -gt 0 ]; then echo "$@" echo fi exit 0 } #----------------------------------------- # Exit script on malformed arguments, not enough arguments # or missing required option. # prints usage information exit_failure_syntax() { if [ $# -gt 0 ]; then echo "xdg-settings: $@" >&2 echo "Try 'xdg-settings --help' for more information." >&2 else usage echo "Use 'man xdg-settings' or 'xdg-settings --manual' for additional info." fi exit 1 } #------------------------------------------------------------- # Exit script on missing file specified on command line exit_failure_file_missing() { if [ $# -gt 0 ]; then echo "xdg-settings: $@" >&2 fi exit 2 } #------------------------------------------------------------- # Exit script on failure to locate necessary tool applications exit_failure_operation_impossible() { if [ $# -gt 0 ]; then echo "xdg-settings: $@" >&2 fi exit 3 } #------------------------------------------------------------- # Exit script on failure returned by a tool application exit_failure_operation_failed() { if [ $# -gt 0 ]; then echo "xdg-settings: $@" >&2 fi exit 4 } #------------------------------------------------------------ # Exit script on insufficient permission to read a specified file exit_failure_file_permission_read() { if [ $# -gt 0 ]; then echo "xdg-settings: $@" >&2 fi exit 5 } #------------------------------------------------------------ # Exit script on insufficient permission to write a specified file exit_failure_file_permission_write() { if [ $# -gt 0 ]; then echo "xdg-settings: $@" >&2 fi exit 6 } check_input_file() { if [ ! -e "$1" ]; then exit_failure_file_missing "file '$1' does not exist" fi if [ ! -r "$1" ]; then exit_failure_file_permission_read "no permission to read file '$1'" fi } check_vendor_prefix() { file_label="$2" [ -n "$file_label" ] || file_label="filename" file=`basename "$1"` case "$file" in [a-zA-Z]*-*) return ;; esac echo "xdg-settings: $file_label '$file' does not have a proper vendor prefix" >&2 echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 echo "Use --novendor to override or 'xdg-settings --manual' for additional info." >&2 exit 1 } check_output_file() { # if the file exists, check if it is writeable # if it does not exists, check if we are allowed to write on the directory if [ -e "$1" ]; then if [ ! -w "$1" ]; then exit_failure_file_permission_write "no permission to write to file '$1'" fi else DIR=`dirname "$1"` if [ ! -w "$DIR" -o ! -x "$DIR" ]; then exit_failure_file_permission_write "no permission to create file '$1'" fi fi } #---------------------------------------- # Checks for shared commands, e.g. --help check_common_commands() { while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --help) usage echo "Use 'man xdg-settings' or 'xdg-settings --manual' for additional info." exit_success ;; --manual) manualpage exit_success ;; --version) echo "xdg-settings 1.0.2" exit_success ;; esac done } check_common_commands "$@" [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then # Be silent xdg_redirect_output=" > /dev/null 2> /dev/null" else # All output to stderr xdg_redirect_output=" >&2" fi #-------------------------------------- # Checks for known desktop environments # set variable DE to the desktop environments name, lowercase detectDE() { if [ 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; elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; else DE="" fi } #---------------------------------------------------------------------------- # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 # It also always returns 1 in KDE 3.4 and earlier # Simply return 0 in such case kfmclient_fix_exit_code() { version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE'` major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` test "$major" -gt 3 && return $1 test "$minor" -gt 5 && return $1 test "$release" -gt 4 && return $1 return 0 } check_desktop_filename() { case "$1" in */*) exit_failure_syntax "invalid application name" ;; *.desktop) return ;; *) exit_failure_syntax "invalid application name" ;; esac } # {{{ default browser # {{{ utility functions # This handles backslashes but not quote marks. first_word() { read first rest echo "$first" } binary_to_desktop_file() { search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" binary="`which "$1"`" binary="`readlink -f "$binary"`" base="`basename "$binary"`" IFS=: for dir in $search; do unset IFS [ "$dir" ] || continue [ -d "$dir/applications" -o -d "$dir/applnk" ] || continue for file in "$dir"/applications/*.desktop "$dir"/applnk/*.desktop; do [ -r "$file" ] || continue # Check to make sure it's worth the processing. grep -q "^Exec.*$base" "$file" || continue # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop"). grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" command="`which "$command"`" if [ x"`readlink -f "$command"`" = x"$binary" ]; then # Fix any double slashes that got added path composition echo "$file" | sed -e 's,//*,/,g' return fi done done } 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 } # In order to remove an application from the automatically-generated list of # applications for handling a given MIME type, the desktop environment may copy # the global .desktop file into the user's .local directory, and remove that # MIME type from its list. In that case, we must restore the MIME type to the # application's list of MIME types before we can set it as the default for that # MIME type. (We can't just delete the local version, since the user may have # made other changes to it as well. So, tweak the existing file.) # This function is hard-coded for text/html but it could be adapted if needed. fix_local_desktop_file() { 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! return 0 ;; esac # Add text/html to the list temp="`mktemp "$apps/$1.XXXXXX"`" || return grep -v "^MimeType=" "$apps/$1" >> "$temp" echo "MimeType=text/html;$MIME" >> "$temp" oldlines="`wc -l < "$apps/$1"`" newlines="`wc -l < "$temp"`" # The new file should have at least as many lines as the old. if [ $oldlines -le $newlines ]; then mv "$temp" "$apps/$1" # This can take a little bit to get noticed. sleep 4 else rm -f "$temp" return 1 fi } # }}} utility functions # {{{ MIME utilities xdg_mime_fixup() { # xdg-mime may use ktradertest, which will fork off a copy of kdeinit if # one does not already exist. It will exit after about 15 seconds if no # further processes need it around. But since it does not close its stdout, # the shell (via grep) will wait around for kdeinit to exit. If we start a # copy here, that copy will be used in xdg-mime and we will avoid waiting. if [ "$DE" = kde -a -z "$XDG_MIME_FIXED" ]; then ktradertest text/html Application > /dev/null 2>&1 # Only do this once, as we only need it once. XDG_MIME_FIXED=yes fi } get_browser_mime() { xdg_mime_fixup xdg-mime query default text/html } set_browser_mime() { xdg_mime_fixup orig="`get_browser_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 mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/applications" xdg-mime default "$1" text/html || return if [ x"`get_browser_mime`" != x"$1" ]; then # Put back the original value xdg-mime default "$orig" text/html exit_failure_operation_failed fi } # }}} MIME utilities # {{{ KDE # Resolves the KDE browser setting to a binary: if prefixed with !, simply removes it; # otherwise, uses desktop_file_to_binary to get the binary out of the desktop file. resolve_kde_browser() { [ -z "$browser" ] && return case "$browser" in !*) echo "${browser#!}" ;; *) desktop_file_to_binary "$browser" ;; esac } # Does the opposite of resolve_kde_browser: if prefixed with !, tries to find a desktop # file corresponding to the binary, otherwise just returns the desktop file name. resolve_kde_browser_desktop() { [ -z "$browser" ] && return case "$browser" in !*) desktop="`binary_to_desktop_file "${browser#!}"`" basename "$desktop" ;; *) echo "$browser" ;; esac } # Reads the KDE browser setting, compensating for a bug in some versions of kreadconfig. read_kde_browser() { browser="`kreadconfig --file kdeglobals --group General --key BrowserApplication`" if [ x"$browser" != x ]; then echo "$browser" else # kreadconfig in KDE 4 may not notice Key[$*]=... localized settings, so # check by hand if it didn't find anything (oddly kwriteconfig works # fine though). kdeglobals_dir=`kde${KDE_SESSION_VERSION}-config --path config | cut -d ':' -f 1` kdeglobals="$kdeglobals_dir/kdeglobals" [ ! -f "$kdeglobals" ] && return # This will only take the first value if there is more than one. grep '^BrowserApplication\[$[^]=]*\]=' "$kdeglobals" | head -n 1 | cut -d= -f 2- fi } get_browser_kde() { browser="`read_kde_browser`" if [ x"$browser" = x ]; then # No explicit default browser; KDE will use the MIME type text/html. get_browser_mime else resolve_kde_browser_desktop fi } check_browser_kde() { check="`desktop_file_to_binary "$1"`" if [ -z "$check" ]; then echo no exit_success fi browser="`read_kde_browser`" binary="`resolve_kde_browser`" # Because KDE will use the handler for MIME type text/html if this value # is empty, we allow either the empty string or a match to $check here. if [ x"$binary" != x -a x"$binary" != x"$check" ]; then echo no exit_success fi browser="`get_browser_mime`" binary="`desktop_file_to_binary "$browser"`" if [ x"$binary" != x"$check" ]; then echo no exit_success fi echo yes exit_success } set_browser_kde() { set_browser_mime "$1" || return kwriteconfig --file kdeglobals --group General --key BrowserApplication "$1" } # }}} KDE # {{{ GNOME 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 } check_browser_gnome() { check="`desktop_file_to_binary "$1"`" if [ -z "$check" ]; then echo no exit_success fi 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:. for protocol in http https; do binary="`gconftool-2 --get /desktop/gnome/url-handlers/$protocol/command | first_word`" if [ x"$binary" != x"$check" ]; then echo no exit_success fi done browser="`get_browser_mime`" binary="`desktop_file_to_binary "$browser"`" if [ x"$binary" != x"$check" ]; then echo no exit_success fi echo yes exit_success } set_browser_gnome() { binary="`desktop_file_to_binary "$1"`" [ "$binary" ] || exit_failure_file_missing set_browser_mime "$1" || return # Set the default browser. 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 # Set the handler for HTTP and HTTPS. for protocol in http https; do gconftool-2 --type string --set /desktop/gnome/url-handlers/$protocol/command "$binary %s" gconftool-2 --type bool --set /desktop/gnome/url-handlers/$protocol/needs_terminal false gconftool-2 --type bool --set /desktop/gnome/url-handlers/$protocol/enabled true done # Set the handler for about: and unknown URL types. for protocol in about unknown; do gconftool-2 --type string --set /desktop/gnome/url-handlers/$protocol/command "$binary %s" done } # }}} GNOME # {{{ xfce get_browser_xfce() { search="${XDG_CONFIG_HOME:-$HOME/.config}:${XDG_CONFIG_DIRS:-/etc/xdg}" IFS=: for dir in $search; do unset IFS [ "$dir" -a -d "$dir/xfce4" ] || continue file="$dir/xfce4/helpers.rc" [ -r "$file" ] || continue grep -q "^WebBrowser=" "$file" || continue desktop="`grep "^WebBrowser=" "$file" | cut -d= -f 2-`" echo "$desktop.desktop" return done exit_failure_operation_failed } check_browser_xfce() { browser="`get_browser_xfce`" if [ x"$browser" != x"$1" ]; then echo no exit_success fi echo yes exit_success } check_xfce_desktop_file() { # Annoyingly, xfce wants its .desktop files in a separate directory instead # of the standard locations, and requires a few custom tweaks to them: # "Type" must be "X-XFCE-Helper" # "X-XFCE-Category" must be "WebBrowser" (for web browsers, anyway) # "X-XFCE-Commands" and "X-XFCE-CommandsWithParameter" must be set search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" IFS=: for dir in $search; do unset IFS [ "$dir" -a -d "$dir/xfce4/helpers" ] || continue file="$dir/xfce4/helpers/$1" # We have the file, no need to create it. [ -r "$file" ] && return done IFS=: for dir in $search; do unset IFS [ "$dir" -a -d "$dir/applications" ] || continue file="$dir/applications/$1" if [ -r "$file" ]; then # Found a file to convert. target="${XDG_DATA_HOME:-$HOME/.local/share}/xfce4/helpers" mkdir -p "$target" grep -v "^Type=" "$file" > "$target/$1" echo "Type=X-XFCE-Helper" >> "$target/$1" echo "X-XFCE-Category=WebBrowser" >> "$target/$1" # Change %F, %f, %U, and %u to "%s". command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | sed -e 's/%[FfUu]/"%s"/g'`" echo "X-XFCE-Commands=`echo "$command" | first_word`" >> "$target/$1" echo "X-XFCE-CommandsWithParameter=$command" >> "$target/$1" return fi done return 1 } set_browser_xfce() { check_xfce_desktop_file "$1" || exit_failure_operation_failed helper_dir="${XDG_CONFIG_HOME:-$HOME/.config}/xfce4" if [ ! -d "$helper_dir" ]; then mkdir -p "$helper_dir" || exit_failure_operation_failed fi helpers_rc="$helper_dir/helpers.rc" # Create the file if it does not exist to avoid special cases below. if [ ! -r "$helpers_rc" ]; then touch "$helpers_rc" || exit_failure_operation_failed fi temp="`mktemp "$helpers_rc.XXXXXX"`" || return grep -v "^WebBrowser=" "$helpers_rc" >> "$temp" echo "WebBrowser=${1%.desktop}" >> "$temp" oldlines="`wc -l < "$helpers_rc"`" newlines="`wc -l < "$temp"`" # The new file should have at least as many lines as the old. if [ $oldlines -le $newlines ]; then mv "$temp" "$helpers_rc" else rm -f "$temp" return 1 fi } # }}} xfce # }}} default browser dispatch_specific() { # The PROP comments in this function are used to generate the output of # the --list option. The formatting is important. Make sure to line up the # property descriptions with spaces so that it will look nice. if [ x"$op" = x"get" ]; then case "$parm" in default-web-browser) # PROP: Default web browser get_browser_$DE ;; *) exit_failure_syntax ;; esac elif [ x"$op" = x"check" ]; then case "$parm" in default-web-browser) check_desktop_filename "$1" check_browser_$DE "$1" ;; *) exit_failure_syntax ;; esac else # set [ $# -eq 1 ] || exit_failure_syntax "unexpected/missing argument" case "$parm" in default-web-browser) check_desktop_filename "$1" set_browser_$DE "$1" ;; *) exit_failure_syntax ;; esac fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } dispatch_generic() { # We only know how to get or check the default web browser. [ x"$op" != x"get" -a x"$op" != x"check" ] && exit_failure_operation_impossible [ x"$parm" != x"default-web-browser" ] && exit_failure_operation_impossible # First look in $BROWSER if [ x"$BROWSER" != x ]; then binary="`which "${BROWSER%%:*}"`" else # Debian and Ubuntu (and others?) have x-www-browser. binary="`which x-www-browser`" fi [ "$binary" ] || exit_failure_operation_failed binary="`readlink -f "$binary"`" [ "$binary" ] || exit_failure_operation_failed if [ x"$op" = x"get" ]; then desktop="`binary_to_desktop_file "$binary"`" basename "$desktop" else # $op = "check" check="`desktop_file_to_binary "$1"`" if [ -z "$check" ]; then echo no exit_success fi if [ x"$binary" != x"$check" ]; then echo no exit_success fi echo yes fi exit_success } if [ x"$1" = x"--list" ]; then echo "Known properties:" # Extract the property names from dispatch_specific() above. grep "^[ ]*[^)]*) # PROP:" "$0" | sed -e 's/^[ ]*\([^)]*\)) # PROP: \(.*\)$/ \1 \2/' | sort exit_success fi [ x"$1" != x ] || exit_failure_syntax "no operation given" [ x"$2" != x ] || exit_failure_syntax "no parameter name given" [ x"$1" = x"get" -o x"$3" != x ] || exit_failure_syntax "no parameter value given" op="$1" parm="$2" shift 2 if [ x"$op" != x"get" -a x"$op" != x"check" -a x"$op" != x"set" ]; then exit_failure_syntax "invalid operation" fi detectDE case "$DE" in kde|gnome|xfce) dispatch_specific "$@" ;; generic) dispatch_generic "$@" ;; *) exit_failure_operation_impossible "unknown desktop environment" ;; esac xdg-utils-1.1.0-rc1/scripts/html/0000755000175000017500000000000011507575742016412 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/scripts/html/index.html0000644000175000017500000000231611507576612020406 0ustar fboudrafboudra

xdg-utils

This version of xdg-utils contains the following commands:

xdg-desktop-menu:command line tool for (un)installing desktop menu items
xdg-desktop-icon:command line tool for (un)installing icons to the desktop
xdg-mime:command line tool for querying information about file type handling and adding descriptions for new file types
xdg-icon-resource:command line tool for (un)installing icon resources
xdg-open:opens a file or URL in the user's preferred application
xdg-email:command line tool for sending mail using the user's preferred e-mail composer
xdg-screensaver:command line tool for controlling the screensaver
xdg-settings:get various settings from the desktop environment
xdg-utils-1.1.0-rc1/scripts/html/xdg-email.html0000644000175000017500000001600411507576621021145 0ustar fboudrafboudraxdg-email

Name

xdg-email — command line tool for sending mail using the user's preferred e-mail composer

Synopsis

xdg-email [--utf8] [--cc address] [--bcc address] [--subject text] [--body text] [--attach file] [ mailto-uri | address(es) ]

xdg-email { --help | --manual | --version }

Description

xdg-email opens the user's preferred e-mail composer in order to send a mail to address(es) or mailto-uri. RFC2368 defines mailto: URIs. xdg-email limits support to, cc, subject and body fields in mailto-uri, all other fields are silently ignored. address(es) must follow the syntax of RFC822. Multiple addresses may be provided as separate arguments.

All information provided on the command line is used to prefill corresponding fields in the user's e-mail composer. The user will have the opportunity to change any of this information before actually sending the e-mail.

xdg-email is for use inside a desktop session only. It is not recommended to use xdg-email as root.

See http://portland.freedesktop.org/EmailConfig for information on how the user can change the e-mail composer that is used.

Options

--utf8
Indicates that all command line options that follow are in utf8. Without this option, command line options are expected to be encoded according to locale. If the locale already specifies utf8 this option has no effect. This option does not affect mailto URIs that are passed on the command line.
--cc address
Specify a recipient to be copied on the e-mail.
--bcc address
Specify a recipient to be blindly copied on the e-mail.
--subject text
Specify a subject for the e-mail.
--body text
Specify a body for the e-mail. Since the user will be able to make changes before actually sending the e-mail, this can be used to provide the user with a template for the e-mail. text may contain linebreaks.
--attach file

Specify an attachment for the e-mail. file must point to an existing file.

Some e-mail applications require the file to remain present after xdg-email returns.

--help
Show command synopsis.
--manual
Show this manualpage.
--version
Show the xdg-utils version information.

Environment Variables

xdg-email honours the following environment variables:

XDG_UTILS_DEBUG_LEVEL
Setting this environment variable to a non-zero numerical value makes xdg-email do more verbose reporting on stderr. Setting a higher value increases the verbosity.

Exit Codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:

1
Error in command line syntax.
2
One of the files passed on the command line did not exist.
3
A required tool could not be found.
4
The action failed.
5
No permission to read one of the files passed on the command line.

Configuration

Visit http://portland.freedesktop.org/EmailConfig for information how to configure xdg-email to use the email client of your choice.

Examples

xdg-email 'Jeremy White <jwhite@example.com>'

xdg-email --attach /tmp/logo.png \
          --subject 'Logo contest' \
          --body 'Attached you find the logo for the contest.' \
          'jwhite@example.com'

xdg-email --subject 'Your password is about to expire' \
          'jwhite@example.com' 'bastian@example.com' 'whipple@example.com'

xdg-utils-1.1.0-rc1/scripts/html/xdg-icon-resource.html0000644000175000017500000002606411507576616022646 0ustar fboudrafboudraxdg-icon-resource

Name

xdg-icon-resource — command line tool for (un)installing icon resources

Synopsis

xdg-icon-resource install [--noupdate] [--novendor] [--theme theme] [--context context] [--mode mode] --size size icon-file [icon-name]

xdg-icon-resource uninstall [--noupdate] [--theme theme] [--context context] [--mode mode] --size size icon-name

xdg-icon-resource forceupdate [--theme theme] [--mode mode]

xdg-icon-resource { --help | --manual | --version }

Description

The xdg-icon-resource program can be used to install icon resources into the desktop icon system in order to illustrate menu entries, to depict desktop icons or to graphically represent file types.

The desktop icon system identifies icons by name. Depending on the required size, the choice of icon theme and the context in which the icon is used, the desktop icon system locates an appropriate icon resource to depict an icon. Icon resources can be XPM files or PNG files.

The desktop icon system works according to the XDG Icon Theme Specification at http://www.freedesktop.org/Standards/icon-theme-spec

Commands

install
Installs the icon file indicated by icon-file to the desktop icon system under the name icon-name. Icon names do not have an extension. If icon-name is not provided the name is derived from icon-file. The icon file must have .png or .xpm as extension. If a corresponding .icon file exists in the same location as icon-file it will be installed as well.
uninstall
Removes the icon indicated by icon-name from the desktop icon system. Note that icon names do not have an extension.
forceupdate
Force an update of the desktop icon system. This is only useful if the last call to xdg-icon-resource included the --noupdate option.

Options

--noupdate
Postpone updating the desktop icon system. If multiple icons are added in sequence this flag can be used to indicate that additional changes will follow and that it is not necassery to update the desktop icon system right away.
--novendor

Normally, xdg-icon-resource checks to ensure that an icon file to be installed in the apps context has a proper vendor prefix. This option can be used to disable that check.

A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts.

--theme theme
Installs or removes the icon file as part of theme. If no theme is specified the icons will be installed as part of the default hicolor theme. Applications may install icons under multiple themes but should at least install icons for the default hicolor theme.
--context context
Specifies the context for the icon. Icons to be used in the application menu and as desktop icon should use apps as context which is the default context. Icons to be used as file icons should use mimetypes as context. Other common contexts are actions, devices, emblems, filesystems and stock.
--size size
Specifies the size of the icon. All icons must be square. Common sizes for icons in the apps context are: 16, 22, 32, 48, 64 and 128. Common sizes for icons in the mimetypes context are: 16, 22, 32, 48, 64 and 128
--mode mode

mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode.

The default is to use system mode when called by root and to use user mode when called by a non-root user.

--help
Show command synopsis.
--manual
Show this manualpage.
--version
Show the xdg-utils version information.

Environment Variables

xdg-icon-resource honours the following environment variables:

XDG_UTILS_DEBUG_LEVEL
Setting this environment variable to a non-zero numerical value makes xdg-icon-resource do more verbose reporting on stderr. Setting a higher value increases the verbosity.
XDG_UTILS_INSTALL_MODE
This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system.

Exit Codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:

1
Error in command line syntax.
2
One of the files passed on the command line did not exist.
3
A required tool could not be found.
4
The action failed.
5
No permission to read one of the files passed on the command line.

See Also

xdg-desktop-icon(1), xdg-desktop-menu(1), xdg-mime(1)

Examples

To install an icon resource to depict a launcher for the application myfoobar, the company ShinyThings Inc. can use:

xdg-icon-resource install --size 64 shinythings-myfoobar.png

To install an icon for a new application/x-foobar file type one can use:

xdg-icon-resource install --context mimetypes --size 48 ./mime-foobar-48.png application-x-foobar
xdg-icon-resource install --context mimetypes --size 64 ./mime-foobar-64.png application-x-foobar

This will install two icons with the name application-x-foobar but with different sizes.

xdg-utils-1.1.0-rc1/scripts/html/xdg-settings.html0000644000175000017500000001001211507576623021711 0ustar fboudrafboudraxdg-settings

Name

xdg-settings — get various settings from the desktop environment

Synopsis

xdg-settings { get | check | set } {property} [value]

xdg-settings { --help | --list | --manual | --version }

Description

xdg-settings gets various settings from the desktop environment. For instance, desktop environments often provide proxy configuration and default web browser settings. Using xdg-settings these parameters can be extracted for use by applications that do not use the desktop environment's libraries (which would use the settings natively).

xdg-settings is for use inside a desktop session only. It is not recommended to use xdg-settings as root.

Options

--help
Show command synopsis.
--list
List all properties xdg-settings knows about.
--manual
Show this manualpage.
--version
Show the xdg-utils version information.

Exit Codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:

1
Error in command line syntax.
2
One of the files passed on the command line did not exist.
3
A required tool could not be found.
4
The action failed.

Examples

Get the desktop file name of the current default web browser

        xdg-settings get default-web-browser
      

Check whether the default web browser is firefox.desktop, which can be false even if "get default-web-browser" says that is the current value (if only some of the underlying settings actually reflect that value)

        xdg-settings check default-web-browser firefox.desktop
      

Set the default web browser to google-chrome.desktop

        xdg-settings set default-web-browser google-chrome.desktop
      

xdg-utils-1.1.0-rc1/scripts/html/xdg-desktop-icon.html0000644000175000017500000002227511507576614022466 0ustar fboudrafboudraxdg-desktop-icon

Name

xdg-desktop-icon — command line tool for (un)installing icons to the desktop

Synopsis

xdg-desktop-icon install [--novendor] FILE

xdg-desktop-icon uninstall FILE

xdg-desktop-icon { --help | --manual | --version }

Description

The xdg-desktop-icon program can be used to install an application launcher or other file on the desktop of the current user.

An application launcher is represented by a *.desktop file. Desktop files are defined by the freedesktop.org Desktop Entry Specification. The most important aspects of *.desktop files are summarized below.

Commands

install
Installs FILE to the desktop of the current user. FILE can be a *.desktop file or any other type of file.
uninstall
Removes FILE from the desktop of the current user.

Options

--novendor

Normally, xdg-desktop-icon checks to ensure that a *.desktop file to be installed has a vendor prefix. This option can be used to disable that check.

A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts.

--help
Show command synopsis.
--manual
Show this manualpage.
--version
Show the xdg-utils version information.

Desktop Files

An application launcher can be added to the desktop by installing a *.desktop file. A *.desktop file consists of a [Desktop Entry] header followed by several Key=Value lines.

A *.desktop file can provide a name and description for an application in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the Key. This way one can specify different values for the same Key depending on the currently selected language.

The following keys are often used:

Value=1.0
This is a mandatory field to indicate that the *.desktop file follows the 1.0 version of the specification.
Type=Application
This is a mandatory field that indicates that the *.desktop file describes an application launcher.
Name=Application Name
The name of the application. For example Mozilla
GenericName=Generic Name
A generic description of the application. For example Web Browser
Comment=Comment
Optional field to specify a tooltip for the application. For example Visit websites on the Internet
Icon=Icon File
The icon to use for the application. This can either be an absolute path to an image file or an icon-name. If an icon-name is provided an image lookup by name is done in the user's current icon theme. The xdg-icon-resource command can be used to install image files into icon themes. The advantage of using an icon-name instead of an absolute path is that with an icon-name the application icon can be provided in several different sizes as well as in several differently themed styles.
Exec=Command Line
The command line to start the application. If the application can open files the %f placeholder should be specified. When a file is dropped on the application launcher the %f is replaced with the file path of the dropped file. If multiple files can be specified on the command line the %F placeholder should be used instead of %f. If the application is able to open URLs in addition to local files then %u or %U can be used instead of %f or %F.

For a complete oveview of the *.desktop file format please visit http://www.freedesktop.org/wiki/Standards/desktop-entry-spec

Environment Variables

xdg-desktop-icon honours the following environment variables:

XDG_UTILS_DEBUG_LEVEL
Setting this environment variable to a non-zero numerical value makes xdg-desktop-icon do more verbose reporting on stderr. Setting a higher value increases the verbosity.

Exit Codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:

1
Error in command line syntax.
2
One of the files passed on the command line did not exist.
3
A required tool could not be found.
4
The action failed.
5
No permission to read one of the files passed on the command line.

See Also

xdg-icon-resource(1)

Examples

The company ShinyThings Inc. has developed an application named "WebMirror" and would like to add a launcher for for on the desktop. The company will use "shinythings" as its vendor id. In order to add the application to the desktop there needs to be a .desktop file for the application:

shinythings-webmirror.desktop:

  [Desktop Entry]
  Encoding=UTF-8
  Type=Application

  Exec=webmirror
  Icon=shinythings-webmirror

  Name=WebMirror
  Name[nl]=WebSpiegel

Now the xdg-desktop-icon tool can be used to add the webmirror.desktop file to the desktop:

xdg-desktop-icon install ./shinythings-webmirror.desktop

To add a README file to the desktop as well, the following command can be used:

xdg-desktop-icon install ./shinythings-README

xdg-utils-1.1.0-rc1/scripts/html/.gitignore0000644000175000017500000000000011507575742020370 0ustar fboudrafboudraxdg-utils-1.1.0-rc1/scripts/html/xdg-mime.html0000644000175000017500000002541611507576615021017 0ustar fboudrafboudraxdg-mime

Name

xdg-mime — command line tool for querying information about file type handling and adding descriptions for new file types

Synopsis

xdg-mime query { filetype | default } ...

xdg-mime default application mimetype(s)

xdg-mime install [--mode mode] [--novendor] mimetypes-file

xdg-mime uninstall [--mode mode] mimetypes-file

xdg-mime { --help | --manual | --version }

Description

The xdg-mime program can be used to query information about file types and to add descriptions for new file types.

Commands

query

Returns information related to file types.

The query option is for use inside a desktop session only. It is not recommended to use xdg-mime query as root.

The following queries are supported:

query filetype FILE: Returns the file type of FILE in the form of a MIME type.

query default mimetype: Returns the default application that the desktop environment uses for opening files of type mimetype. The default application is identified by its *.desktop file.

default

Ask the desktop environment to make application the default application for opening files of type mimetype. An application can be made the default for several file types by specifying multiple mimetypes.

application is the desktop file id of the application and has the form vendor-name.desktop application must already be installed in the desktop menu before it can be made the default handler. The aplication's desktop file must list support for all the MIME types that it wishes to be the default handler for.

Requests to make an application a default handler may be subject to system policy or approval by the end-user. xdg-mime query can be used to verify whether an application is the actual default handler for a specific file type.

The default option is for use inside a desktop session only. It is not recommended to use xdg-mime default as root.

install
Adds the file type descriptions provided in mimetypes-file to the desktop environment. mimetypes-file must be a XML file that follows the freedesktop.org Shared MIME-info Database specification and that has a mime-info element as its document root. For each new file type one or more icons with name type-subtype must be installed with the xdg-icon-resource command in the mimetypes context. For example the filetype application/vnd.oasis.opendocument.text requires an icon named application-vnd.oasis.opendocument.text to be installed (unless the file type recommends another icon name).
uninstall
Removes the file type descriptions provided in mimetypes-file and previously added with xdg-mime install from the desktop environment. mimetypes-file must be a XML file that follows the freedesktop.org Shared MIME-info Database specification and that has a mime-info element as its document root.

Options

--mode mode

mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode.

The default is to use system mode when called by root and to use user mode when called by a non-root user.

--novendor

Normally, xdg-mime checks to ensure that the mimetypes-file to be installed has a proper vendor prefix. This option can be used to disable that check.

A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts.

--help
Show command synopsis.
--manual
Show this manualpage.
--version
Show the xdg-utils version information.

Environment Variables

xdg-mime honours the following environment variables:

XDG_UTILS_DEBUG_LEVEL
Setting this environment variable to a non-zero numerical value makes xdg-mime do more verbose reporting on stderr. Setting a higher value increases the verbosity.
XDG_UTILS_INSTALL_MODE
This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system.

Exit Codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:

1
Error in command line syntax.
2
One of the files passed on the command line did not exist.
3
A required tool could not be found.
4
The action failed.
5
No permission to read one of the files passed on the command line.

See Also

xdg-icon-resource(1), xdg-desktop-menu(1)

Examples

xdg-mime query filetype /tmp/foobar.png

Prints the MIME type of the file /tmp/foobar.png, in this case image/png

xdg-mime query default image/png

Prints the .desktop filename of the application which is registered to open PNG files.

xdg-mime install shinythings-shiny.xml

Adds a file type description for "shiny"-files. "shinythings-" is used as the vendor prefix. The file type description could look as folows.

shinythings-shiny.xml:

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="text/x-shiny">
    <comment>Shiny new file type</comment>
    <glob pattern="*.shiny"/>
    <glob pattern="*.shi"/>
  </mime-type>
</mime-info>

An icon for this new file type must also be installed, for example with:

xdg-icon-resource install --context mimetypes --size 64 shiny-file-icon.png text-x-shiny

xdg-utils-1.1.0-rc1/scripts/html/xdg-screensaver.html0000644000175000017500000001324611507576622022404 0ustar fboudrafboudraxdg-screensaver

Name

xdg-screensaver — command line tool for controlling the screensaver

Synopsis

xdg-screensaver suspend WindowID

xdg-screensaver resume WindowID

xdg-screensaver { activate | lock | reset | status }

xdg-screensaver { --help | --manual | --version }

Description

xdg-screensaver provides commands to control the screensaver.

xdg-screensaver is for use inside a desktop session only. It is not recommended to use xdg-screensaver as root.

Commands

suspend WindowID

Suspends the screensaver and monitor power management. WindowID must be the X Window ID of an existing window of the calling application. The window must remain in existance for the duration of the suspension.

WindowID can be represented as either a decimal number or as a hexadecimal number consisting of the prefix 0x followed by one or more hexadecimal digits.

The screensaver can be suspended in relation to multiple windows at the same time. In that case screensaver operation is only restored once the screensaver has been resumed in relation to each of the windows

resume WindowID
Resume the screensaver and monitor power management after being suspended. WindowID must be the same X Window ID that was passed to a previous call of xdg-screensaver suspend
activate
Turns the screensaver on immediately. This may result in the screen getting locked, depending on existing system policies.
lock
Lock the screen immediately.
reset
Turns the screensaver off immediately. If the screen was locked the user may be asked to authenticate first.
status
Prints enabled to stdout if the screensaver is enabled to turn on after a period of inactivity and prints disabled if the screensaver is not enabled.

Options

--help
Show command synopsis.
--manual
Show this manualpage.
--version
Show the xdg-utils version information.

Exit Codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:

1
Error in command line syntax.
3
A required tool could not be found.
4
The action failed.

Examples

xdg-screensaver suspend 0x1c00007

Causes the screensaver to be disabled till xdg-screensaver resume 0x1c00007 is called. 0x1c00007 must be the X Window ID of an existing window.

xdg-utils-1.1.0-rc1/scripts/html/index.html.post0000644000175000017500000000003011507575742021364 0ustar fboudrafboudra xdg-utils-1.1.0-rc1/scripts/html/xdg-open.html0000644000175000017500000000623211507576617021026 0ustar fboudrafboudraxdg-open

Name

xdg-open — opens a file or URL in the user's preferred application

Synopsis

xdg-open { file | URL }

xdg-open { --help | --manual | --version }

Description

xdg-open opens a file or URL in the user's preferred application. If a URL is provided the URL will be opened in the user's preferred web browser. If a file is provided the file will be opened in the preferred application for files of that type. xdg-open supports file, ftp, http and https URLs.

xdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as root.

Options

--help
Show command synopsis.
--manual
Show this manualpage.
--version
Show the xdg-utils version information.

Exit Codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:

1
Error in command line syntax.
2
One of the files passed on the command line did not exist.
3
A required tool could not be found.
4
The action failed.

Examples

xdg-open 'http://www.freedesktop.org/'

Opens the Freedesktop.org website in the user's default browser

xdg-open /tmp/foobar.png

Opens the PNG image file /tmp/foobar.png in the user's default image viewing application.

xdg-utils-1.1.0-rc1/scripts/html/index.html.pre0000644000175000017500000000015511507575742021175 0ustar fboudrafboudra

xdg-utils

This version of xdg-utils contains the following commands:

xdg-utils-1.1.0-rc1/scripts/html/xdg-desktop-menu.html0000644000175000017500000005016611507576613022501 0ustar fboudrafboudraxdg-desktop-menu

Name

xdg-desktop-menu — command line tool for (un)installing desktop menu items

Synopsis

xdg-desktop-menu install [--noupdate] [--novendor] [--mode mode] directory-file(s) desktop-file(s)

xdg-desktop-menu uninstall [--noupdate] [--mode mode] directory-file(s) desktop-file(s)

xdg-desktop-menu forceupdate [--mode mode]

xdg-desktop-menu { --help | --manual | --version }

Description

The xdg-desktop-menu program can be used to install new menu entries to the desktop's application menu.

The application menu works according to the XDG Desktop Menu Specification at http://www.freedesktop.org/Standards/menu-spec

Commands

install

Install one or more applications in a submenu of the desktop menu system.

desktop-file: A desktop file represents a single menu entry in the menu. Desktop files are defined by the freedesktop.org Desktop Entry Specification. The most important aspects of *.desktop files are summarized below.

Menu entries can be added to the menu system in two different ways. They can either be added to a predefined submenu in the menu system based on one or more category keywords, or they can be added to a new submenu.

To add a menu entry to a predefined submenu the desktop file that represents the menu entry must have a Categories= entry that lists one or more keywords. The menu item will be included in an appropriate submenu based on the included keywords.

To add menu items to a new submenu the desktop-files must be preceded by a directory-file that describes the submenu. If multiple desktop-files are specified, all entries will be added to the same menu. If entries are installed to a menu that has been created with a previous call to xdg-desktop-menu the entries will be installed in addition to any already existing entries.

directory-file: The *.directory file indicated by directory-file represents a submenu. The directory file provides the name and icon for a submenu. The name of the directory file is used to identify the submenu.

If multiple directory files are provided each file will represent a submenu within the menu that preceeds it, creating a nested menu hierarchy (sub-sub-menus). The menu entries themselves will be added to the last submenu.

Directory files follow the syntax defined by the freedesktop.org Desktop Entry Specification.

uninstall

Remove applications or submenus from the desktop menu system previously installed with xdg-desktop-menu install.

A submenu and the associated directory file is only removed when the submenu no longer contains any menu entries.

forceupdate

Force an update of the menu system.

This command is only useful if the last call to xdg-desktop-menu included the --noupdate option.

Options

--noupdate
Postpone updating the menu system. If multiple updates to the menu system are made in sequence this flag can be used to indicate that additional changes will follow and that it is not necassery to update the menu system right away.
--novendor

Normally, xdg-desktop-menu checks to ensure that any *.directory and *.desktop files to be installed has a vendor prefix. This option can be used to disable that check.

A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts.

--mode mode

mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode.

The default is to use system mode when called by root and to use user mode when called by a non-root user.

--help
Show command synopsis.
--manual
Show this manualpage.
--version
Show the xdg-utils version information.

Desktop Files

An application item in the application menu is represented by a *.desktop file. A *.desktop file consists of a [Desktop Entry] header followed by several Key=Value lines.

A *.desktop file can provide a name and description for an application in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the Key. This way one can specify different values for the same Key depending on the currently selected language.

The following keys are often used:

Value=1.0
This is a mandatory field to indicate that the *.desktop file follows the 1.0 version of the specification.
Type=Application
This is a mandatory field that indicates that the *.desktop file describes an application launcher.
Name=Application Name
The name of the application. For example Mozilla
GenericName=Generic Name
A generic description of the application. For example Web Browser
Comment=Comment
Optional field to specify a tooltip for the application. For example Visit websites on the Internet
Icon=Icon File
The icon to use for the application. This can either be an absolute path to an image file or an icon-name. If an icon-name is provided an image lookup by name is done in the user's current icon theme. The xdg-icon-resource command can be used to install image files into icon themes. The advantage of using an icon-name instead of an absolute path is that with an icon-name the application icon can be provided in several different sizes as well as in several differently themed styles.
Exec=Command Line
The command line to start the application. If the application can open files the %f placeholder should be specified. When a file is dropped on the application launcher the %f is replaced with the file path of the dropped file. If multiple files can be specified on the command line the %F placeholder should be used instead of %f. If the application is able to open URLs in addition to local files then %u or %U can be used instead of %f or %F.
Categories=Categories

A list of categories separated by semi-colons. A category is a keyword that describes and classifies the application. By default applications are organized in the application menu based on category. When menu entries are explicitly assigned to a new submenu it is not necassery to list any categories.

When using categories it is recommended to include one of the following categories: AudioVideo, Development, Education, Game, Graphics, Network, Office, Settings, System, Utility.

See Appendix A of the XDG Desktop Menu Specification for information about additional categories. http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html

MimeType=Mimetypes
A list of mimetypes separated by semi-colons. This field is used to indicate which file types the application is able to open.

For a complete oveview of the *.desktop file format please visit http://www.freedesktop.org/wiki/Standards/desktop-entry-spec

Directory Files

The appearance of submenu in the application menu is provided by a *.directory file. In particular it provides the title of the submenu and a possible icon. A *.directory file consists of a [Desktop Entry] header followed by several Key=Value lines.

A *.directory file can provide a title (name) for the submenu in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the Key. This way one can specify different values for the same Key depending on the currently selected language.

The following keys are relevqnt for submenus:

Value=1.0
This is a mandatory field to indicate that the *.directory file follows the 1.0 version of the Desktop Entry specification.
Type=Directory
This is a mandatory field that indicates that the *.directory file describes a submenu.
Name=Menu Name
The title of submenu. For example Mozilla
Comment=Comment
Optional field to specify a tooltip for the submenu.
Icon=Icon File
The icon to use for the submenu. This can either be an absolute path to an image file or an icon-name. If an icon-name is provided an image lookup by name is done in the user's current icon theme. The xdg-icon-resource command can be used to install image files into icon themes. The advantage of using an icon-name instead of an absolute path is that with an icon-name the submenu icon can be provided in several different sizes as well as in several differently themed styles.

Environment Variables

xdg-desktop-menu honours the following environment variables:

XDG_UTILS_DEBUG_LEVEL
Setting this environment variable to a non-zero numerical value makes xdg-desktop-menu do more verbose reporting on stderr. Setting a higher value increases the verbosity.
XDG_UTILS_INSTALL_MODE
This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system.

Exit Codes

An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned:

1
Error in command line syntax.
2
One of the files passed on the command line did not exist.
3
A required tool could not be found.
4
The action failed.
5
No permission to read one of the files passed on the command line.

See Also

xdg-desktop-icon(1), xdg-icon-resource(1), xdg-mime(1)

Examples

The company ShinyThings Inc. has developed an application named "WebMirror" and would like to add it to the application menu. The company will use "shinythings" as its vendor id. In order to add the application to the menu there needs to be a .desktop file with a suitable Categories entry:

shinythings-webmirror.desktop:

  [Desktop Entry]
  Encoding=UTF-8
  Type=Application

  Exec=webmirror
  Icon=webmirror

  Name=WebMirror
  Name[nl]=WebSpiegel

  Categories=Network;WebDevelopment;

Now the xdg-desktop-menu tool can be used to add the shinythings-webmirror.desktop file to the desktop application menu:

xdg-desktop-menu install ./shinythings-webmirror.desktop

Note that for the purpose of this example the menu items are available in two languages, English and Dutch. The language code for Dutch is nl.

In the next example the company ShinyThings Inc. will add its own submenu to the desktop application menu consisting of a "WebMirror" menu item and a "WebMirror Admin Tool" menu item.

First the company needs to create two .desktop files that describe the two menu items. Since the items are to be added to a new submenu it is not necassery to include a Categories= line:

shinythings-webmirror.desktop:

  [Desktop Entry]
  Encoding=UTF-8
  Type=Application

  Exec=webmirror
  Icon=shinythings-webmirror

  Name=WebMirror
  Name[nl]=WebSpiegel


shinythings-webmirror-admin.desktop:

  [Desktop Entry]
  Encoding=UTF-8
  Type=Application

  Exec=webmirror-admintool
  Icon=shinythings-webmirror-admintool

  Name=WebMirror Admin Tool
  Name[nl]=WebSpiegel Administratie Tool

In addition a .directory file needs to be created to provide a title and icon for the sub-menu itself:

shinythings-webmirror.directory:

  [Desktop Entry]
  Encoding=UTF-8

  Icon=shinythings-webmirror-menu

  Name=WebMirror
  Name[nl]=WebSpiegel

These file can now be installed with:

xdg-desktop-menu install ./shinythings-webmirror.directory \
      ./shinythings-webmirror.desktop ./shinythings-webmirror-admin.desktop

The menu entries could also be installed one by one:

xdg-desktop-menu install --noupdate ./shinythings-webmirror.directory \
      ./shinythings-webmirror.desktop
xdg-desktop-menu install --noupdate ./shinythings-webmirror.directory \
      ./shinythings-webmirror-admin.desktop
xdg-desktop-menu forceupdate

Although the result is the same it is slightly more efficient to install all files at the same time.

The *.desktop and *.directory files reference icons with the names webmirror, webmirror-admin and webmirror-menu which should also be installed. In this example the icons are installed in two different sizes, once with a size of 22x22 pixels and once with a size of 64x64 pixels:

xdg-icon-resource install --size 22 ./wmicon-22.png shinythings-webmirror
xdg-icon-resource install --size 22 ./wmicon-menu-22.png shinythings-webmirror-menu
xdg-icon-resource install --size 22 ./wmicon-admin-22.png shinythings-webmirror-admin
xdg-icon-resource install --size 64 ./wmicon-64.png shinythings-webmirror
xdg-icon-resource install --size 64 ./wmicon-menu-64.png shinythings-webmirror-menu
xdg-icon-resource install --size 64 ./wmicon-admin-64.png shinythings-webmirror-admin

xdg-utils-1.1.0-rc1/scripts/Makefile0000644000175000017500000000553111507576513017107 0ustar fboudrafboudraMKDIR = mkdir -p RMDIR = rmdir INSTALL = /usr/bin/install -c $(INSTALL_FLAGS) INSTALL_PROGRAM = ${INSTALL} $(INSTALL_PROGRAM_FLAGS) INSTALL_LIBRARY = ${INSTALL} $(INSTALL_PROGRAM_FLAGS) INSTALL_SCRIPT = ${INSTALL} $(INSTALL_SCRIPT_FLAGS) INSTALL_DATA = ${INSTALL} -m 644 $(INSTALL_DATA_FLAGS) XMLTO = /usr/bin/xmlto prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin mandir = ${prefix}/man SCRIPTS = \ xdg-desktop-menu \ xdg-desktop-icon \ xdg-mime \ xdg-icon-resource \ xdg-open \ xdg-email \ xdg-screensaver \ xdg-settings # xdg-su # xdg-copy \ # xdg-file-dialog # xdg-terminal MANPAGES= $(SCRIPTS:%=man/%.1) WEBPAGES= $(SCRIPTS:%=%.html) XMLFILES= $(SCRIPTS:%=desc/%.xml) all: html: index.html $(WEBPAGES) scripts: README $(SCRIPTS) man: $(MANPAGES) release: scripts html man rm -f xdg-*.in *~ HACKING generate-help-script.awk rm -rf desc/ rm -rf xsl/ rm -f xdg-file-dialog xdg-su xdg-copy xdg-terminal distclean: clean rm -f Makefile clean: scripts-clean: rm -f $(SCRIPTS) README man/xdg-*.1 html/xdg-*.html README: $(SCRIPTS) echo > $@ @for x in $(SCRIPTS) ; do \ sh ./$$x --help | grep -B 100 Synopsis | sed -e '$$d' >> $@ ; \ done install: $(MKDIR) $(DESTDIR)$(bindir) for x in $(SCRIPTS) ; do \ $(INSTALL_SCRIPT) $$x $(DESTDIR)$(bindir) ; \ done $(MKDIR) $(DESTDIR)$(mandir) $(MKDIR) $(DESTDIR)$(mandir)/man1 for x in $(MANPAGES) ; do \ if [ -f $$x ]; then \ $(INSTALL_DATA) $$x $(DESTDIR)$(mandir)/man1 ; \ fi ; \ done uninstall: for x in $(MANPAGES) ; do \ rm -f $(DESTDIR)$(mandir)/man1/`basename $$x` ; \ done -$(RMDIR) $(DESTDIR)$(mandir)/man1 -$(RMDIR) $(DESTDIR)$(mandir) for x in $(SCRIPTS) ; do \ rm -f $(DESTDIR)$(bindir)/$$x ; \ done -$(RMDIR) $(DESTDIR)$(bindir) %: %.in %.txt awk -f generate-help-script.awk $@.in | sed -e 's/@NAME@/'$@'/g' > $@ chmod a+x $@ xdg-desktop-menu: xdg-desktop-menu.in xdg-utils-common.in xdg-desktop-icon: xdg-desktop-icon.in xdg-utils-common.in xdg-email: xdg-email.in xdg-utils-common.in xdg-mime: xdg-mime.in xdg-utils-common.in xdg-open: xdg-open.in xdg-utils-common.in xdg-screensaver: xdg-screensaver.in xdg-utils-common.in xdg-settings: xdg-settings.in xdg-utils-common.in xdg-icon-resource: xdg-icon-resource.in xdg-utils-common.in xdg-su: xdg-su.in xdg-utils-common.in xdg-copy: xdg-copy.in xdg-utils-common.in xdg-file-dialog: xdg-file-dialog.in xdg-utils-common.in xdg-terminal: xdg-terminal.in xdg-utils-common.in man/%.1: desc/%.xml (cd man;$(XMLTO) man ../$<) index.html: $(XMLFILES) (cat html/index.html.pre; \ xsltproc xsl/refentry2htmlindex.xsl $(XMLFILES); \ cat html/index.html.post ) > html/index.html %.html: desc/%.xml (cd html;$(XMLTO) html-nochunks ../$<) %.txt: desc/%.xml $(XMLTO) txt $< xdg-utils-1.1.0-rc1/scripts/xdg-icon-resource0000755000175000017500000006013411507575742020735 0ustar fboudrafboudra#!/bin/sh #--------------------------------------------- # xdg-icon-resource # # Utility script to install icons on a Linux desktop. # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # 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. # #--------------------------------------------- manualpage() { cat << _MANUALPAGE Name xdg-icon-resource - command line tool for (un)installing icon resources Synopsis xdg-icon-resource install [--noupdate] [--novendor] [--theme theme] [--context context] [--mode mode] --size size icon-file [icon-name] xdg-icon-resource uninstall [--noupdate] [--theme theme] [--context context] [--mode mode] --size size icon-name xdg-icon-resource forceupdate [--theme theme] [--mode mode] xdg-icon-resource { --help | --manual | --version } Description The xdg-icon-resource program can be used to install icon resources into the desktop icon system in order to illustrate menu entries, to depict desktop icons or to graphically represent file types. The desktop icon system identifies icons by name. Depending on the required size, the choice of icon theme and the context in which the icon is used, the desktop icon system locates an appropriate icon resource to depict an icon. Icon resources can be XPM files or PNG files. The desktop icon system works according to the XDG Icon Theme Specification at http://www.freedesktop.org/Standards/icon-theme-spec Commands install Installs the icon file indicated by icon-file to the desktop icon system under the name icon-name. Icon names do not have an extension. If icon-name is not provided the name is derived from icon-file. The icon file must have .png or .xpm as extension. If a corresponding .icon file exists in the same location as icon-file it will be installed as well. uninstall Removes the icon indicated by icon-name from the desktop icon system. Note that icon names do not have an extension. forceupdate Force an update of the desktop icon system. This is only useful if the last call to xdg-icon-resource included the --noupdate option. Options --noupdate Postpone updating the desktop icon system. If multiple icons are added in sequence this flag can be used to indicate that additional changes will follow and that it is not necassery to update the desktop icon system right away. --novendor Normally, xdg-icon-resource checks to ensure that an icon file to be installed in the apps context has a proper vendor prefix. This option can be used to disable that check. A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. --theme theme Installs or removes the icon file as part of theme. If no theme is specified the icons will be installed as part of the default hicolor theme. Applications may install icons under multiple themes but should at least install icons for the default hicolor theme. --context context Specifies the context for the icon. Icons to be used in the application menu and as desktop icon should use apps as context which is the default context. Icons to be used as file icons should use mimetypes as context. Other common contexts are actions, devices, emblems, filesystems and stock. --size size Specifies the size of the icon. All icons must be square. Common sizes for icons in the apps context are: 16, 22, 32, 48, 64 and 128. Common sizes for icons in the mimetypes context are: 16, 22, 32, 48, 64 and 128 --mode mode mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode. The default is to use system mode when called by root and to use user mode when called by a non-root user. --help Show command synopsis. --manual Show this manualpage. --version Show the xdg-utils version information. Environment Variables xdg-icon-resource honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-icon-resource do more verbose reporting on stderr. Setting a higher value increases the verbosity. XDG_UTILS_INSTALL_MODE This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. 5 No permission to read one of the files passed on the command line. See Also xdg-desktop-icon(1), xdg-desktop-menu(1), xdg-mime(1) Examples To install an icon resource to depict a launcher for the application myfoobar, the company ShinyThings Inc. can use: xdg-icon-resource install --size 64 shinythings-myfoobar.png To install an icon for a new application/x-foobar file type one can use: xdg-icon-resource install --context mimetypes --size 48 ./mime-foobar-48.png application-x-foobar xdg-icon-resource install --context mimetypes --size 64 ./mime-foobar-64.png application-x-foobar This will install two icons with the name application-x-foobar but with different sizes. _MANUALPAGE } usage() { cat << _USAGE xdg-icon-resource - command line tool for (un)installing icon resources Synopsis xdg-icon-resource install [--noupdate] [--novendor] [--theme theme] [--context context] [--mode mode] --size size icon-file [icon-name] xdg-icon-resource uninstall [--noupdate] [--theme theme] [--context context] [--mode mode] --size size icon-name xdg-icon-resource forceupdate [--theme theme] [--mode mode] xdg-icon-resource { --help | --manual | --version } _USAGE } #@xdg-utils-common@ #---------------------------------------------------------------------------- # Common utility functions included in all XDG wrapper scripts #---------------------------------------------------------------------------- DEBUG() { [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; shift echo "$@" >&2 } #------------------------------------------------------------- # Exit script on successfully completing the desired operation exit_success() { if [ $# -gt 0 ]; then echo "$@" echo fi exit 0 } #----------------------------------------- # Exit script on malformed arguments, not enough arguments # or missing required option. # prints usage information exit_failure_syntax() { if [ $# -gt 0 ]; then echo "xdg-icon-resource: $@" >&2 echo "Try 'xdg-icon-resource --help' for more information." >&2 else usage echo "Use 'man xdg-icon-resource' or 'xdg-icon-resource --manual' for additional info." fi exit 1 } #------------------------------------------------------------- # Exit script on missing file specified on command line exit_failure_file_missing() { if [ $# -gt 0 ]; then echo "xdg-icon-resource: $@" >&2 fi exit 2 } #------------------------------------------------------------- # Exit script on failure to locate necessary tool applications exit_failure_operation_impossible() { if [ $# -gt 0 ]; then echo "xdg-icon-resource: $@" >&2 fi exit 3 } #------------------------------------------------------------- # Exit script on failure returned by a tool application exit_failure_operation_failed() { if [ $# -gt 0 ]; then echo "xdg-icon-resource: $@" >&2 fi exit 4 } #------------------------------------------------------------ # Exit script on insufficient permission to read a specified file exit_failure_file_permission_read() { if [ $# -gt 0 ]; then echo "xdg-icon-resource: $@" >&2 fi exit 5 } #------------------------------------------------------------ # Exit script on insufficient permission to write a specified file exit_failure_file_permission_write() { if [ $# -gt 0 ]; then echo "xdg-icon-resource: $@" >&2 fi exit 6 } check_input_file() { if [ ! -e "$1" ]; then exit_failure_file_missing "file '$1' does not exist" fi if [ ! -r "$1" ]; then exit_failure_file_permission_read "no permission to read file '$1'" fi } check_vendor_prefix() { file_label="$2" [ -n "$file_label" ] || file_label="filename" file=`basename "$1"` case "$file" in [a-zA-Z]*-*) return ;; esac echo "xdg-icon-resource: $file_label '$file' does not have a proper vendor prefix" >&2 echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 echo "Use --novendor to override or 'xdg-icon-resource --manual' for additional info." >&2 exit 1 } check_output_file() { # if the file exists, check if it is writeable # if it does not exists, check if we are allowed to write on the directory if [ -e "$1" ]; then if [ ! -w "$1" ]; then exit_failure_file_permission_write "no permission to write to file '$1'" fi else DIR=`dirname "$1"` if [ ! -w "$DIR" -o ! -x "$DIR" ]; then exit_failure_file_permission_write "no permission to create file '$1'" fi fi } #---------------------------------------- # Checks for shared commands, e.g. --help check_common_commands() { while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --help) usage echo "Use 'man xdg-icon-resource' or 'xdg-icon-resource --manual' for additional info." exit_success ;; --manual) manualpage exit_success ;; --version) echo "xdg-icon-resource 1.0.2" exit_success ;; esac done } check_common_commands "$@" [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then # Be silent xdg_redirect_output=" > /dev/null 2> /dev/null" else # All output to stderr xdg_redirect_output=" >&2" fi #-------------------------------------- # Checks for known desktop environments # set variable DE to the desktop environments name, lowercase detectDE() { if [ 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; elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; else DE="" fi } #---------------------------------------------------------------------------- # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 # It also always returns 1 in KDE 3.4 and earlier # Simply return 0 in such case kfmclient_fix_exit_code() { version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE'` major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` test "$major" -gt 3 && return $1 test "$minor" -gt 5 && return $1 test "$release" -gt 4 && return $1 return 0 } # Set GTK_UPDATE_ICON_CACHE to gtk-update-icon-cache executable path or # to "-" if not found. GTK_UPDATE_ICON_CACHE= find_gtk_update_icon_cache() { [ -n "$GTK_UPDATE_ICON_CACHE" ] && return; GTK_UPDATE_ICON_CACHE="-" for x in `echo "$PATH:/opt/gnome/bin" | sed 's/:/ /g'`; do DEBUG 3 "Checking $x for gtk-update-icon-cache" if [ -x "$x/gtk-update-icon-cache" ] ; then DEBUG 1 "Found $x/gtk-update-icon-cache" GTK_UPDATE_ICON_CACHE="$x/gtk-update-icon-cache" return fi done } # Start GNOME legacy workaround section need_dot_icon_path() { # GTK < 2.6 uses ~/.icons but not XDG_DATA_HOME/icons # The availability of gtk-update-icon-cache is used as indication # of whether the system is using GTK 2.6 or later find_gtk_update_icon_cache [ "$GTK_UPDATE_ICON_CACHE" != "-" ] && return 1; return 0; } update_icon_database() { # Touch me, I'm dirty touch "$1/.xdg-icon-resource-dummy" rm -f "$1/.xdg-icon-resource-dummy" # Don't create a cache if there wan't one already if [ -f "$1/icon-theme.cache" ] ; then find_gtk_update_icon_cache if [ "$GTK_UPDATE_ICON_CACHE" != "-" ] ; then DEBUG 1 "Running $GTK_UPDATE_ICON_CACHE -f -t \"$1\"" eval '$GTK_UPDATE_ICON_CACHE -f -t "$1"'$xdg_redirect_output return fi fi } [ x"$1" != x"" ] || exit_failure_syntax mode= action= update=yes size= theme=hicolor context=apps icon_file= icon_name= case $1 in install) action=install ;; uninstall) action=uninstall ;; forceupdate) action=forceupdate ;; *) exit_failure_syntax "unknown command '$1'" ;; esac shift vendor=true while [ $# -gt 0 ] ; do parm="$1" shift case $parm in --noupdate) update=no ;; --mode) if [ -z "$1" ] ; then exit_failure_syntax "mode argument missing for --mode" fi case "$1" in user) mode="user" ;; system) mode="system" ;; *) exit_failure_syntax "unknown mode '$1'" ;; esac shift ;; --theme) if [ -z "$1" ] ; then exit_failure_syntax "theme argument missing for --theme" fi theme="$1" shift ;; --size) if [ -z "$1" ] ; then exit_failure_syntax "size argument missing for --size" fi if echo "$1" | grep '[^0-9]' > /dev/null 2> /dev/null; then exit_failure_syntax "size argument must be numeric" fi size="$1" shift ;; --context) if [ -z "$1" ] ; then exit_failure_syntax "context argument missing for --context" fi context="$1" shift ;; --novendor) vendor=false ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ -n "$icon_name" ] ; then exit_failure_syntax "unexpected argument '$parm'" elif [ -n "$icon_file" ] ; then icon_name="$parm" else if [ "$action" = "install" ] ; then check_input_file "$parm" fi icon_file="$parm" fi ;; esac done # Shouldn't happen if [ -z "$action" ] ; then exit_failure_syntax "command argument missing" fi # Shouldn't happen if [ -z "$context" ] ; then exit_failure_syntax "context argument missing" fi if [ -n "$XDG_UTILS_INSTALL_MODE" ] ; then if [ "$XDG_UTILS_INSTALL_MODE" = "system" ] ; then mode="system" elif [ "$XDG_UTILS_INSTALL_MODE" = "user" ] ; then mode="user" fi fi if [ -z "$mode" ] ; then if [ `whoami` = "root" ] ; then mode="system" else mode="user" fi fi xdg_dir_name="icons/$theme" xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_user_prefix="$xdg_user_dir/icons" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_global_dir= xdg_global_prefix= xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs="/usr/local/share/:/usr/share/" for x in `echo "$xdg_system_dirs" | sed 's/:/ /g'`; do if [ -w $x/$xdg_dir_name ] ; then xdg_global_prefix="$x/icons" xdg_global_dir="$x/$xdg_dir_name" break fi done [ -w $xdg_global_dir ] || xdg_global_dir= dot_icon_dir= dot_base_dir= if [ x"$mode" = x"user" ] ; then xdg_base_dir="$xdg_user_dir" #Gnome 2.8 supports ~/.icons but not XDG_DATA_HOME if need_dot_icon_path ; then dot_icon_dir="$HOME/.icons" dot_base_dir="$dot_icon_dir/$theme" fi else xdg_base_dir="$xdg_global_dir" if [ -z "$xdg_base_dir" ] ; then exit_failure_operation_impossible "No writable system icon directory found." fi fi if [ x"$action" = x"forceupdate" ] ; then if [ -n "$icon_file" ] ; then exit_failure_syntax "unexpected argument '$icon_file'" fi update_icon_database $xdg_base_dir if [ -n "$dot_icon_dir" ] ; then if [ -d "$dot_icon_dir/" -a ! -L "$dot_icon_dir" ] ; then update_icon_database $dot_base_dir fi fi exit_success fi if [ -z "$icon_file" ] ; then if [ x"$action" = x"install" ] ; then exit_failure_syntax "icon-file argument missing" else exit_failure_syntax "icon-name argument missing" fi fi xdg_size_name= extension= if [ -z "$size" ] ; then exit_failure_syntax "the icon size must be specified with --size" fi xdg_size_name="${size}x${size}" if [ x"$action" = x"install" ] ; then case $icon_file in *.xpm) extension="xpm" ;; *.png) extension="png" ;; *) exit_failure_syntax "icon file to install must be a *.png or *.xpm file" ;; esac fi if [ -n "$icon_name" ] ; then case $icon_name in *.png) exit_failure_syntax "icon name should not include an extension" ;; *.xpm) exit_failure_syntax "icon name should not include an extension" ;; esac fi # Start KDE legacy workaround section need_kde_icon_path() { local path path=`readlink -f "$1" 2> /dev/null` # Normalize path DEBUG 2 "need_kde_icon_path $path" if [ -z "$path" ] ; then DEBUG 2 "need_kde_icon_path RETURN 1 (not needed, no xdg icon dir)" return 1; # Not needed fi # if kde-config not found... return 0 kde_icon_dirs=`kde${KDE_SESSION_VERSION}-config --path icon 2> /dev/null |sed 's/:/ /g'` DEBUG 3 "kde_icon_dirs: $kde_icon_dirs" if [ -z "$kde_icon_dirs" ] ; then DEBUG 3 "no result from kde${KDE_SESSION_VERSION}-config --path icon" DEBUG 2 "need_kde_icon_path RETURN 1 (not needed, no kde icon path)" return 1; # Not needed fi needed=0 # Needed for y in $kde_icon_dirs ; do x=`readlink -f "$y"` # Normalize path DEBUG 3 "Normalize $y --> $x" if [ -n "$x" ] ; then if [ "$x" = "$path" ] ; then needed=1 # Not needed fi if [ -w "$x" ] ; then kde_global_prefix="$x" # Take last writable dir fi fi done DEBUG 2 "kde_global_prefix: $kde_global_prefix" [ $needed -eq "1" ] && DEBUG 2 "need_kde_icon_path RETURN $needed (not needed)" [ $needed -eq "0" ] && DEBUG 2 "need_kde_icon_path RETURN $needed (needed)" return $needed } kde_dir= if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_base_dir/$xdg_size_name/$context" #KDE 3.x doesn't support XDG_DATA_HOME for icons #Check if xdg_dir prefix is listed by kde-config --path icon #If not, install additional symlink to kdedir if need_kde_icon_path "$xdg_user_prefix" ; then kde_user_icon_dir=`kde${KDE_SESSION_VERSION}-config --path icon | cut -d ':' -f 1` kde_user_dir="$kde_user_icon_dir/$theme" kde_dir="$kde_user_dir/$xdg_size_name/$context" fi #Gnome 2.8 supports ~/.icons but not XDG_DATA_HOME if [ -n "$dot_icon_dir" ] ; then if [ -L "$dot_icon_dir" ] ; then # Don't do anything dot_icon_dir= elif [ ! -d "$dot_icon_dir/" ] ; then # Symlink if it doesn't exist eval 'ln -s ".local/share/icons" "$dot_icon_dir"'$xdg_redirect_output dot_icon_dir= else dot_icon_dir="$dot_icon_dir/$theme/$xdg_size_name/$context" fi fi my_umask=077 else xdg_dir="$xdg_base_dir/$xdg_size_name/$context" #KDE 3.x doesn't support XDG_DATA_DIRS for icons #Check if xdg_dir prefix is listed by kde-config --path icon #If not, install additional symlink to kdedir if need_kde_icon_path "$xdg_global_prefix" ; then kde_global_dir="$kde_global_prefix/$theme" kde_dir="$kde_global_dir/$xdg_size_name/$context" fi my_umask=022 fi # End KDE legacy workaround section # Start GNOME legacy workaround section need_gnome_mime= [ $context = "mimetypes" ] && need_gnome_mime=true # End GNOME legacy workaround section [ -n "$icon_name" ] || icon_name=`basename "$icon_file" | sed 's/\.[a-z][a-z][a-z]$//'` if [ "$vendor" = "true" -a "$action" = "install" -a "$context" = "apps" ] ; then check_vendor_prefix "$icon_name" "icon name" fi icon_icon_file=`echo "$icon_file" | sed 's/\.[a-z][a-z][a-z]$/.icon/'` icon_icon_name="$icon_name.icon" DEBUG 1 "$action icon in $xdg_dir" [ $action = "install" -a -f $icon_icon_file ] && DEBUG 1 "install $icon_icon_name meta file in $xdg_dir" [ -n "$kde_dir" ] && DEBUG 1 "$action symlink in $kde_dir (KDE 3.x support)" [ -n "$need_gnome_mime" ] && DEBUG 1 "$action gnome-mime-$icon_name symlink (GNOME 2.x support)" [ $action = "install" -a -n "$dot_icon_dir" ] && DEBUG 1 "$action ~/.icons symlink (GNOME 2.8 support)" case $action in install) save_umask=`umask` umask $my_umask for icon_dir in $xdg_dir $dot_icon_dir; do mkdir -p $icon_dir eval 'cp "$icon_file" "$icon_dir/$icon_name.$extension"'$xdg_redirect_output if [ -f "$icon_icon_file" ] ; then eval 'cp "$icon_icon_file" "$icon_dir/$icon_icon_name"'$xdg_redirect_output fi if [ -n "$need_gnome_mime" ] ; then eval 'ln -s "$icon_name.$extension" "$icon_dir/gnome-mime-$icon_name.$extension"'$xdg_redirect_output fi done if [ -n "$kde_dir" ] ; then mkdir -p $kde_dir eval 'ln -s "$xdg_dir/$icon_name.$extension" "$kde_dir/$icon_name.$extension"'$xdg_redirect_output fi umask $save_umask ;; uninstall) for icon_dir in $xdg_dir $dot_icon_dir; do rm -f "$icon_dir/$icon_name.xpm" "$icon_dir/$icon_name.png" rm -f "$icon_dir/$icon_icon_name" if [ -n "$need_gnome_mime" ] ; then rm -f "$icon_dir/gnome-mime-$icon_name.xpm" rm -f "$icon_dir/gnome-mime-$icon_name.png" fi done if [ -n "$kde_dir" ] ; then rm -f "$kde_dir/$icon_name.xpm" "$kde_dir/$icon_name.png" fi ;; esac if [ x"$update" = x"yes" ] ; then update_icon_database "$xdg_base_dir" if [ -n "$dot_icon_dir" ] ; then if [ -d "$dot_icon_dir/" -a ! -L "$dot_icon_dir" ] ; then update_icon_database $dot_base_dir fi fi fi exit_success xdg-utils-1.1.0-rc1/scripts/xdg-open0000755000175000017500000003245411507575742017125 0ustar fboudrafboudra#!/bin/sh #--------------------------------------------- # xdg-open # # Utility script to open a URL in the registered default application. # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # 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. # #--------------------------------------------- manualpage() { cat << _MANUALPAGE Name xdg-open - opens a file or URL in the user's preferred application Synopsis xdg-open { file | URL } xdg-open { --help | --manual | --version } Description xdg-open opens a file or URL in the user's preferred application. If a URL is provided the URL will be opened in the user's preferred web browser. If a file is provided the file will be opened in the preferred application for files of that type. xdg-open supports file, ftp, http and https URLs. xdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as root. Options --help Show command synopsis. --manual Show this manualpage. --version Show the xdg-utils version information. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. Examples xdg-open 'http://www.freedesktop.org/' Opens the Freedesktop.org website in the user's default browser xdg-open /tmp/foobar.png Opens the PNG image file /tmp/foobar.png in the user's default image viewing application. _MANUALPAGE } usage() { cat << _USAGE xdg-open - opens a file or URL in the user's preferred application Synopsis xdg-open { file | URL } xdg-open { --help | --manual | --version } _USAGE } #@xdg-utils-common@ #---------------------------------------------------------------------------- # Common utility functions included in all XDG wrapper scripts #---------------------------------------------------------------------------- DEBUG() { [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; shift echo "$@" >&2 } #------------------------------------------------------------- # Exit script on successfully completing the desired operation exit_success() { if [ $# -gt 0 ]; then echo "$@" echo fi exit 0 } #----------------------------------------- # Exit script on malformed arguments, not enough arguments # or missing required option. # prints usage information exit_failure_syntax() { if [ $# -gt 0 ]; then echo "xdg-open: $@" >&2 echo "Try 'xdg-open --help' for more information." >&2 else usage echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." fi exit 1 } #------------------------------------------------------------- # Exit script on missing file specified on command line exit_failure_file_missing() { if [ $# -gt 0 ]; then echo "xdg-open: $@" >&2 fi exit 2 } #------------------------------------------------------------- # Exit script on failure to locate necessary tool applications exit_failure_operation_impossible() { if [ $# -gt 0 ]; then echo "xdg-open: $@" >&2 fi exit 3 } #------------------------------------------------------------- # Exit script on failure returned by a tool application exit_failure_operation_failed() { if [ $# -gt 0 ]; then echo "xdg-open: $@" >&2 fi exit 4 } #------------------------------------------------------------ # Exit script on insufficient permission to read a specified file exit_failure_file_permission_read() { if [ $# -gt 0 ]; then echo "xdg-open: $@" >&2 fi exit 5 } #------------------------------------------------------------ # Exit script on insufficient permission to write a specified file exit_failure_file_permission_write() { if [ $# -gt 0 ]; then echo "xdg-open: $@" >&2 fi exit 6 } check_input_file() { if [ ! -e "$1" ]; then exit_failure_file_missing "file '$1' does not exist" fi if [ ! -r "$1" ]; then exit_failure_file_permission_read "no permission to read file '$1'" fi } check_vendor_prefix() { file_label="$2" [ -n "$file_label" ] || file_label="filename" file=`basename "$1"` case "$file" in [a-zA-Z]*-*) return ;; esac echo "xdg-open: $file_label '$file' does not have a proper vendor prefix" >&2 echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 echo "Use --novendor to override or 'xdg-open --manual' for additional info." >&2 exit 1 } check_output_file() { # if the file exists, check if it is writeable # if it does not exists, check if we are allowed to write on the directory if [ -e "$1" ]; then if [ ! -w "$1" ]; then exit_failure_file_permission_write "no permission to write to file '$1'" fi else DIR=`dirname "$1"` if [ ! -w "$DIR" -o ! -x "$DIR" ]; then exit_failure_file_permission_write "no permission to create file '$1'" fi fi } #---------------------------------------- # Checks for shared commands, e.g. --help check_common_commands() { while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --help) usage echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." exit_success ;; --manual) manualpage exit_success ;; --version) echo "xdg-open 1.0.2" exit_success ;; esac done } check_common_commands "$@" [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then # Be silent xdg_redirect_output=" > /dev/null 2> /dev/null" else # All output to stderr xdg_redirect_output=" >&2" fi #-------------------------------------- # Checks for known desktop environments # set variable DE to the desktop environments name, lowercase detectDE() { if [ 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; elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; else DE="" fi } #---------------------------------------------------------------------------- # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 # It also always returns 1 in KDE 3.4 and earlier # Simply return 0 in such case kfmclient_fix_exit_code() { version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE'` major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` test "$major" -gt 3 && return $1 test "$minor" -gt 5 && return $1 test "$release" -gt 4 && return $1 return 0 } # This handles backslashes but not quote marks. first_word() { read first rest echo "$first" } open_kde() { if kde-open -v 2>/dev/null 1>&2; then kde-open "$1" else if [ x"$KDE_SESSION_VERSION" = x"4" ]; then kfmclient openURL "$1" else kfmclient exec "$1" kfmclient_fix_exit_code $? fi fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_gnome() { if gvfs-open --help 2>/dev/null 1>&2; then gvfs-open "$1" else gnome-open "$1" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_xfce() { exo-open "$1" if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_generic_xdg_mime() { filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` default=`xdg-mime query default "$filetype"` if [ -n "$default" ] ; then xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" 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 local file="$x/applications/$default" if [ -r "$file" ] ; then command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" command_exec=`which $command 2>/dev/null` if [ -x "$command_exec" ] ; then $command_exec "$1" if [ $? -eq 0 ]; then exit_success fi fi fi done fi } open_generic() { # Paths or file:// URLs if (echo "$1" | grep -q '^file://' || ! echo "$1" | egrep -q '^[a-zA-Z+\.\-]+:'); then local file="$1" # 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')")" fi check_input_file "$file" open_generic_xdg_mime "$file" if [ -f /etc/debian_version ] && which run-mailcap 2>/dev/null 1>&2; then run-mailcap --action=view "$file" if [ $? -eq 0 ]; then exit_success fi fi if mimeopen -v 2>/dev/null 1>&2; then mimeopen -L -n "$file" if [ $? -eq 0 ]; then exit_success fi fi fi IFS=":" for browser in $BROWSER; do if [ x"$browser" != x"" ]; then browser_with_arg=`printf "$browser" "$1" 2>/dev/null` if [ $? -ne 0 ]; then browser_with_arg=$browser; fi if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1"; else eval '$browser_with_arg'$xdg_redirect_output; fi if [ $? -eq 0 ]; then exit_success; fi fi done exit_failure_operation_impossible "no method available for opening '$1'" } open_lxde() { # pcmanfm only knows how to handle file:// urls and filepaths, it seems. if (echo "$1" | grep -q '^file://' || ! echo "$1" | egrep -q '^[a-zA-Z+\.\-]+:') then local file="$(echo "$1" | sed 's%^file://%%')" # handle relative paths if ! echo "$file" | grep -q '^/'; then file="$(pwd)/$file" fi pcmanfm "$file" else open_generic "$1" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } [ x"$1" != x"" ] || exit_failure_syntax url= while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ -n "$url" ] ; then exit_failure_syntax "unexpected argument '$parm'" fi url="$parm" ;; esac done if [ -z "${url}" ] ; then exit_failure_syntax "file or URL argument missing" fi detectDE if [ x"$DE" = x"" ]; then DE=generic fi # if BROWSER variable is not set, check some well known browsers instead if [ x"$BROWSER" = x"" ]; then BROWSER=links2:links:lynx:w3m if [ -n "$DISPLAY" ]; then BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER fi fi case "$DE" in kde) open_kde "$url" ;; gnome) open_gnome "$url" ;; xfce) open_xfce "$url" ;; lxde) open_lxde "$url" ;; generic) open_generic "$url" ;; *) exit_failure_operation_impossible "no method available for opening '$url'" ;; esac xdg-utils-1.1.0-rc1/scripts/.gitignore0000644000175000017500000000001111507575742017426 0ustar fboudrafboudraMakefile xdg-utils-1.1.0-rc1/scripts/man/0000755000175000017500000000000011507575742016221 5ustar fboudrafboudraxdg-utils-1.1.0-rc1/scripts/man/xdg-email.10000644000175000017500000001271211507575742020155 0ustar fboudrafboudra'\" t .\" Title: xdg-email .\" Author: Kevin Krammer .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/31/2010 .\" Manual: xdg-email Manual .\" Source: xdg-utils 1.0 .\" Language: English .\" .TH "XDG\-EMAIL" "1" "12/31/2010" "xdg-utils 1.0" "xdg-email Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xdg-email \- command line tool for sending mail using the user\*(Aqs preferred e\-mail composer .SH "SYNOPSIS" .HP \w'\fBxdg\-email\fR\ 'u \fBxdg\-email\fR [\fB\-\-utf8\fR] [\fB\-\-cc\fR\ \fIaddress\fR] [\fB\-\-bcc\fR\ \fIaddress\fR] [\fB\-\-subject\fR\ \fItext\fR] [\fB\-\-body\fR\ \fItext\fR] [\fB\-\-attach\fR\ \fIfile\fR] [\fImailto\-uri\fR | \fIaddress(es)\fR] .HP \w'\fBxdg\-email\fR\ 'u \fBxdg\-email\fR {\fB\-\-help\fR | \fB\-\-manual\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP xdg\-email opens the user\*(Aqs preferred e\-mail composer in order to send a mail to \fIaddress(es)\fR or \fImailto\-uri\fR\&. RFC2368 defines mailto: URIs\&. xdg\-email limits support to, cc, subject and body fields in \fImailto\-uri\fR, all other fields are silently ignored\&. \fIaddress(es)\fR must follow the syntax of RFC822\&. Multiple addresses may be provided as separate arguments\&. .PP All information provided on the command line is used to prefill corresponding fields in the user\*(Aqs e\-mail composer\&. The user will have the opportunity to change any of this information before actually sending the e\-mail\&. .PP xdg\-email is for use inside a desktop session only\&. It is not recommended to use xdg\-email as root\&. .PP See http://portland\&.freedesktop\&.org/EmailConfig for information on how the user can change the e\-mail composer that is used\&. .SH "OPTIONS" .PP \fB\-\-utf8\fR .RS 4 Indicates that all command line options that follow are in utf8\&. Without this option, command line options are expected to be encoded according to locale\&. If the locale already specifies utf8 this option has no effect\&. This option does not affect mailto URIs that are passed on the command line\&. .RE .PP \fB\-\-cc\fR \fIaddress\fR .RS 4 Specify a recipient to be copied on the e\-mail\&. .RE .PP \fB\-\-bcc\fR \fIaddress\fR .RS 4 Specify a recipient to be blindly copied on the e\-mail\&. .RE .PP \fB\-\-subject\fR \fItext\fR .RS 4 Specify a subject for the e\-mail\&. .RE .PP \fB\-\-body\fR \fItext\fR .RS 4 Specify a body for the e\-mail\&. Since the user will be able to make changes before actually sending the e\-mail, this can be used to provide the user with a template for the e\-mail\&. \fItext\fR may contain linebreaks\&. .RE .PP \fB\-\-attach\fR \fIfile\fR .RS 4 Specify an attachment for the e\-mail\&. \fIfile\fR must point to an existing file\&. .sp Some e\-mail applications require the file to remain present after xdg\-email returns\&. .RE .PP \fB\-\-help\fR .RS 4 Show command synopsis\&. .RE .PP \fB\-\-manual\fR .RS 4 Show this manualpage\&. .RE .PP \fB\-\-version\fR .RS 4 Show the xdg\-utils version information\&. .RE .SH "ENVIRONMENT VARIABLES" .PP xdg\-email honours the following environment variables: .PP XDG_UTILS_DEBUG_LEVEL .RS 4 Setting this environment variable to a non\-zero numerical value makes xdg\-email do more verbose reporting on stderr\&. Setting a higher value increases the verbosity\&. .RE .SH "EXIT CODES" .PP An exit code of 0 indicates success while a non\-zero exit code indicates failure\&. The following failure codes can be returned: .PP \fB1\fR .RS 4 Error in command line syntax\&. .RE .PP \fB2\fR .RS 4 One of the files passed on the command line did not exist\&. .RE .PP \fB3\fR .RS 4 A required tool could not be found\&. .RE .PP \fB4\fR .RS 4 The action failed\&. .RE .PP \fB5\fR .RS 4 No permission to read one of the files passed on the command line\&. .RE .SH "CONFIGURATION" .PP Visit http://portland\&.freedesktop\&.org/EmailConfig for information how to configure xdg\-email to use the email client of your choice\&. .SH "EXAMPLES" .PP .sp .if n \{\ .RS 4 .\} .nf xdg\-email \*(AqJeremy White \*(Aq .fi .if n \{\ .RE .\} .PP .sp .if n \{\ .RS 4 .\} .nf xdg\-email \-\-attach /tmp/logo\&.png \e \-\-subject \*(AqLogo contest\*(Aq \e \-\-body \*(AqAttached you find the logo for the contest\&.\*(Aq \e \*(Aqjwhite@example\&.com\*(Aq .fi .if n \{\ .RE .\} .PP .sp .if n \{\ .RS 4 .\} .nf xdg\-email \-\-subject \*(AqYour password is about to expire\*(Aq \e \*(Aqjwhite@example\&.com\*(Aq \*(Aqbastian@example\&.com\*(Aq \*(Aqwhipple@example\&.com\*(Aq .fi .if n \{\ .RE .\} .sp .SH "AUTHORS" .PP \fBKevin Krammer\fR .RS 4 Author. .RE .PP \fBJeremy White\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2006 .br xdg-utils-1.1.0-rc1/scripts/man/xdg-desktop-menu.10000644000175000017500000003670411507575742021510 0ustar fboudrafboudra'\" t .\" Title: xdg-desktop-menu .\" Author: Kevin Krammer .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/31/2010 .\" Manual: xdg-desktop-menu Manual .\" Source: xdg-utils 1.0 .\" Language: English .\" .TH "XDG\-DESKTOP\-MENU" "1" "12/31/2010" "xdg-utils 1.0" "xdg-desktop-menu Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xdg-desktop-menu \- command line tool for (un)installing desktop menu items .SH "SYNOPSIS" .HP \w'\fBxdg\-desktop\-menu\fR\ 'u \fBxdg\-desktop\-menu\fR install [\fB\-\-noupdate\fR] [\fB\-\-novendor\fR] [\fB\-\-mode\ \fR\fB\fImode\fR\fR] \fIdirectory\-file(s)\fR \fIdesktop\-file(s)\fR .HP \w'\fBxdg\-desktop\-menu\fR\ 'u \fBxdg\-desktop\-menu\fR uninstall [\fB\-\-noupdate\fR] [\fB\-\-mode\ \fR\fB\fImode\fR\fR] \fIdirectory\-file(s)\fR \fIdesktop\-file(s)\fR .HP \w'\fBxdg\-desktop\-menu\fR\ 'u \fBxdg\-desktop\-menu\fR forceupdate [\fB\-\-mode\ \fR\fB\fImode\fR\fR] .HP \w'\fBxdg\-desktop\-menu\fR\ 'u \fBxdg\-desktop\-menu\fR {\fB\-\-help\fR | \fB\-\-manual\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP The xdg\-desktop\-menu program can be used to install new menu entries to the desktop\*(Aqs application menu\&. .PP The application menu works according to the XDG Desktop Menu Specification at http://www\&.freedesktop\&.org/Standards/menu\-spec .SH "COMMANDS" .PP install .RS 4 Install one or more applications in a submenu of the desktop menu system\&. .sp \fIdesktop\-file\fR: A desktop file represents a single menu entry in the menu\&. Desktop files are defined by the freedesktop\&.org Desktop Entry Specification\&. The most important aspects of *\&.desktop files are summarized below\&. .sp Menu entries can be added to the menu system in two different ways\&. They can either be added to a predefined submenu in the menu system based on one or more category keywords, or they can be added to a new submenu\&. .sp To add a menu entry to a predefined submenu the desktop file that represents the menu entry must have a Categories= entry that lists one or more keywords\&. The menu item will be included in an appropriate submenu based on the included keywords\&. .sp To add menu items to a new submenu the desktop\-files must be preceded by a directory\-file that describes the submenu\&. If multiple desktop\-files are specified, all entries will be added to the same menu\&. If entries are installed to a menu that has been created with a previous call to \fBxdg\-desktop\-menu\fR the entries will be installed in addition to any already existing entries\&. .sp \fIdirectory\-file\fR: The *\&.directory file indicated by \fIdirectory\-file\fR represents a submenu\&. The directory file provides the name and icon for a submenu\&. The name of the directory file is used to identify the submenu\&. .sp If multiple directory files are provided each file will represent a submenu within the menu that preceeds it, creating a nested menu hierarchy (sub\-sub\-menus)\&. The menu entries themselves will be added to the last submenu\&. .sp Directory files follow the syntax defined by the freedesktop\&.org Desktop Entry Specification\&. .RE .PP uninstall .RS 4 Remove applications or submenus from the desktop menu system previously installed with \fBxdg\-desktop\-menu install\fR\&. .sp A submenu and the associated directory file is only removed when the submenu no longer contains any menu entries\&. .RE .PP forceupdate .RS 4 Force an update of the menu system\&. .sp This command is only useful if the last call to xdg\-desktop\-menu included the \fB\-\-noupdate\fR option\&. .RE .SH "OPTIONS" .PP \fB\-\-noupdate\fR .RS 4 Postpone updating the menu system\&. If multiple updates to the menu system are made in sequence this flag can be used to indicate that additional changes will follow and that it is not necassery to update the menu system right away\&. .RE .PP \fB\-\-novendor\fR .RS 4 Normally, xdg\-desktop\-menu checks to ensure that any *\&.directory and *\&.desktop files to be installed has a vendor prefix\&. This option can be used to disable that check\&. .sp A vendor prefix consists of alpha characters ([a\-zA\-Z]) and is terminated with a dash ("\-")\&. Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix\&. The purpose of the vendor prefix is to prevent name conflicts\&. .RE .PP \fB\-\-mode\fR \fImode\fR .RS 4 \fImode\fR can be \fIuser\fR or \fIsystem\fR\&. In user mode the file is (un)installed for the current user only\&. In system mode the file is (un)installed for all users on the system\&. Usually only root is allowed to install in system mode\&. .sp The default is to use system mode when called by root and to use user mode when called by a non\-root user\&. .RE .PP \fB\-\-help\fR .RS 4 Show command synopsis\&. .RE .PP \fB\-\-manual\fR .RS 4 Show this manualpage\&. .RE .PP \fB\-\-version\fR .RS 4 Show the xdg\-utils version information\&. .RE .SH "DESKTOP FILES" .PP An application item in the application menu is represented by a *\&.desktop file\&. A *\&.desktop file consists of a \fI[Desktop Entry]\fR header followed by several \fIKey\fR=\fIValue\fR lines\&. .PP A *\&.desktop file can provide a name and description for an application in several different languages\&. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the \fIKey\fR\&. This way one can specify different values for the same \fIKey\fR depending on the currently selected language\&. .PP The following keys are often used: .PP Value=1\&.0 .RS 4 This is a mandatory field to indicate that the *\&.desktop file follows the 1\&.0 version of the specification\&. .RE .PP Type=Application .RS 4 This is a mandatory field that indicates that the *\&.desktop file describes an application launcher\&. .RE .PP Name=\fIApplication Name\fR .RS 4 The name of the application\&. For example \fIMozilla\fR .RE .PP GenericName=\fIGeneric Name\fR .RS 4 A generic description of the application\&. For example \fIWeb Browser\fR .RE .PP Comment=\fIComment\fR .RS 4 Optional field to specify a tooltip for the application\&. For example \fIVisit websites on the Internet\fR .RE .PP Icon=\fIIcon File\fR .RS 4 The icon to use for the application\&. This can either be an absolute path to an image file or an icon\-name\&. If an icon\-name is provided an image lookup by name is done in the user\*(Aqs current icon theme\&. The \fBxdg\-icon\-resource\fR command can be used to install image files into icon themes\&. The advantage of using an icon\-name instead of an absolute path is that with an icon\-name the application icon can be provided in several different sizes as well as in several differently themed styles\&. .RE .PP Exec=\fICommand Line\fR .RS 4 The command line to start the application\&. If the application can open files the %f placeholder should be specified\&. When a file is dropped on the application launcher the %f is replaced with the file path of the dropped file\&. If multiple files can be specified on the command line the %F placeholder should be used instead of %f\&. If the application is able to open URLs in addition to local files then %u or %U can be used instead of %f or %F\&. .RE .PP Categories=\fICategories\fR .RS 4 A list of categories separated by semi\-colons\&. A category is a keyword that describes and classifies the application\&. By default applications are organized in the application menu based on category\&. When menu entries are explicitly assigned to a new submenu it is not necassery to list any categories\&. .sp When using categories it is recommended to include one of the following categories: AudioVideo, Development, Education, Game, Graphics, Network, Office, Settings, System, Utility\&. .sp See Appendix A of the XDG Desktop Menu Specification for information about additional categories\&. http://standards\&.freedesktop\&.org/menu\-spec/menu\-spec\-1\&.0\&.html .RE .PP MimeType=\fIMimetypes\fR .RS 4 A list of mimetypes separated by semi\-colons\&. This field is used to indicate which file types the application is able to open\&. .RE .PP For a complete oveview of the *\&.desktop file format please visit http://www\&.freedesktop\&.org/wiki/Standards/desktop\-entry\-spec .SH "DIRECTORY FILES" .PP The appearance of submenu in the application menu is provided by a *\&.directory file\&. In particular it provides the title of the submenu and a possible icon\&. A *\&.directory file consists of a \fI[Desktop Entry]\fR header followed by several \fIKey\fR=\fIValue\fR lines\&. .PP A *\&.directory file can provide a title (name) for the submenu in several different languages\&. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the \fIKey\fR\&. This way one can specify different values for the same \fIKey\fR depending on the currently selected language\&. .PP The following keys are relevqnt for submenus: .PP Value=1\&.0 .RS 4 This is a mandatory field to indicate that the *\&.directory file follows the 1\&.0 version of the Desktop Entry specification\&. .RE .PP Type=Directory .RS 4 This is a mandatory field that indicates that the *\&.directory file describes a submenu\&. .RE .PP Name=\fIMenu Name\fR .RS 4 The title of submenu\&. For example \fIMozilla\fR .RE .PP Comment=\fIComment\fR .RS 4 Optional field to specify a tooltip for the submenu\&. .RE .PP Icon=\fIIcon File\fR .RS 4 The icon to use for the submenu\&. This can either be an absolute path to an image file or an icon\-name\&. If an icon\-name is provided an image lookup by name is done in the user\*(Aqs current icon theme\&. The \fBxdg\-icon\-resource\fR command can be used to install image files into icon themes\&. The advantage of using an icon\-name instead of an absolute path is that with an icon\-name the submenu icon can be provided in several different sizes as well as in several differently themed styles\&. .RE .SH "ENVIRONMENT VARIABLES" .PP xdg\-desktop\-menu honours the following environment variables: .PP XDG_UTILS_DEBUG_LEVEL .RS 4 Setting this environment variable to a non\-zero numerical value makes xdg\-desktop\-menu do more verbose reporting on stderr\&. Setting a higher value increases the verbosity\&. .RE .PP XDG_UTILS_INSTALL_MODE .RS 4 This environment variable can be used by the user or administrator to override the installation mode\&. Valid values are \fIuser\fR and \fIsystem\fR\&. .RE .SH "EXIT CODES" .PP An exit code of 0 indicates success while a non\-zero exit code indicates failure\&. The following failure codes can be returned: .PP \fB1\fR .RS 4 Error in command line syntax\&. .RE .PP \fB2\fR .RS 4 One of the files passed on the command line did not exist\&. .RE .PP \fB3\fR .RS 4 A required tool could not be found\&. .RE .PP \fB4\fR .RS 4 The action failed\&. .RE .PP \fB5\fR .RS 4 No permission to read one of the files passed on the command line\&. .RE .SH "SEE ALSO" .PP \fBxdg-desktop-icon\fR(1), \fBxdg-icon-resource\fR(1), \fBxdg-mime\fR(1) .SH "EXAMPLES" .PP The company ShinyThings Inc\&. has developed an application named "WebMirror" and would like to add it to the application menu\&. The company will use "shinythings" as its vendor id\&. In order to add the application to the menu there needs to be a \&.desktop file with a suitable \fICategories\fR entry: .sp .if n \{\ .RS 4 .\} .nf shinythings\-webmirror\&.desktop: [Desktop Entry] Encoding=UTF\-8 Type=Application Exec=webmirror Icon=webmirror Name=WebMirror Name[nl]=WebSpiegel Categories=Network;WebDevelopment; .fi .if n \{\ .RE .\} .PP Now the xdg\-desktop\-menu tool can be used to add the shinythings\-webmirror\&.desktop file to the desktop application menu: .sp .if n \{\ .RS 4 .\} .nf xdg\-desktop\-menu install \&./shinythings\-webmirror\&.desktop .fi .if n \{\ .RE .\} .PP Note that for the purpose of this example the menu items are available in two languages, English and Dutch\&. The language code for Dutch is nl\&. .PP In the next example the company ShinyThings Inc\&. will add its own submenu to the desktop application menu consisting of a "WebMirror" menu item and a "WebMirror Admin Tool" menu item\&. .PP First the company needs to create two \&.desktop files that describe the two menu items\&. Since the items are to be added to a new submenu it is not necassery to include a Categories= line: .sp .if n \{\ .RS 4 .\} .nf shinythings\-webmirror\&.desktop: [Desktop Entry] Encoding=UTF\-8 Type=Application Exec=webmirror Icon=shinythings\-webmirror Name=WebMirror Name[nl]=WebSpiegel shinythings\-webmirror\-admin\&.desktop: [Desktop Entry] Encoding=UTF\-8 Type=Application Exec=webmirror\-admintool Icon=shinythings\-webmirror\-admintool Name=WebMirror Admin Tool Name[nl]=WebSpiegel Administratie Tool .fi .if n \{\ .RE .\} .PP In addition a \&.directory file needs to be created to provide a title and icon for the sub\-menu itself: .sp .if n \{\ .RS 4 .\} .nf shinythings\-webmirror\&.directory: [Desktop Entry] Encoding=UTF\-8 Icon=shinythings\-webmirror\-menu Name=WebMirror Name[nl]=WebSpiegel .fi .if n \{\ .RE .\} .PP These file can now be installed with: .sp .if n \{\ .RS 4 .\} .nf xdg\-desktop\-menu install \&./shinythings\-webmirror\&.directory \e \&./shinythings\-webmirror\&.desktop \&./shinythings\-webmirror\-admin\&.desktop .fi .if n \{\ .RE .\} .PP The menu entries could also be installed one by one: .sp .if n \{\ .RS 4 .\} .nf xdg\-desktop\-menu install \-\-noupdate \&./shinythings\-webmirror\&.directory \e \&./shinythings\-webmirror\&.desktop xdg\-desktop\-menu install \-\-noupdate \&./shinythings\-webmirror\&.directory \e \&./shinythings\-webmirror\-admin\&.desktop xdg\-desktop\-menu forceupdate .fi .if n \{\ .RE .\} .PP Although the result is the same it is slightly more efficient to install all files at the same time\&. .PP The *\&.desktop and *\&.directory files reference icons with the names webmirror, webmirror\-admin and webmirror\-menu which should also be installed\&. In this example the icons are installed in two different sizes, once with a size of 22x22 pixels and once with a size of 64x64 pixels: .sp .if n \{\ .RS 4 .\} .nf xdg\-icon\-resource install \-\-size 22 \&./wmicon\-22\&.png shinythings\-webmirror xdg\-icon\-resource install \-\-size 22 \&./wmicon\-menu\-22\&.png shinythings\-webmirror\-menu xdg\-icon\-resource install \-\-size 22 \&./wmicon\-admin\-22\&.png shinythings\-webmirror\-admin xdg\-icon\-resource install \-\-size 64 \&./wmicon\-64\&.png shinythings\-webmirror xdg\-icon\-resource install \-\-size 64 \&./wmicon\-menu\-64\&.png shinythings\-webmirror\-menu xdg\-icon\-resource install \-\-size 64 \&./wmicon\-admin\-64\&.png shinythings\-webmirror\-admin .fi .if n \{\ .RE .\} .sp .SH "AUTHORS" .PP \fBKevin Krammer\fR .RS 4 Author. .RE .PP \fBJeremy White\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2006 .br xdg-utils-1.1.0-rc1/scripts/man/xdg-icon-resource.10000644000175000017500000001733711507575742021653 0ustar fboudrafboudra'\" t .\" Title: xdg-icon-resource .\" Author: Kevin Krammer .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/31/2010 .\" Manual: xdg-icon-resource Manual .\" Source: xdg-utils 1.0 .\" Language: English .\" .TH "XDG\-ICON\-RESOURCE" "1" "12/31/2010" "xdg-utils 1.0" "xdg-icon-resource Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xdg-icon-resource \- command line tool for (un)installing icon resources .SH "SYNOPSIS" .HP \w'\fBxdg\-icon\-resource\fR\ 'u \fBxdg\-icon\-resource\fR install [\fB\-\-noupdate\fR] [\fB\-\-novendor\fR] [\fB\-\-theme\ \fR\fB\fItheme\fR\fR] [\fB\-\-context\ \fR\fB\fIcontext\fR\fR] [\fB\-\-mode\ \fR\fB\fImode\fR\fR] \fB\-\-size\ \fR\fB\fIsize\fR\fR \fIicon\-file\fR [\fIicon\-name\fR] .HP \w'\fBxdg\-icon\-resource\fR\ 'u \fBxdg\-icon\-resource\fR uninstall [\fB\-\-noupdate\fR] [\fB\-\-theme\ \fR\fB\fItheme\fR\fR] [\fB\-\-context\ \fR\fB\fIcontext\fR\fR] [\fB\-\-mode\ \fR\fB\fImode\fR\fR] \fB\-\-size\ \fR\fB\fIsize\fR\fR \fIicon\-name\fR .HP \w'\fBxdg\-icon\-resource\fR\ 'u \fBxdg\-icon\-resource\fR forceupdate [\fB\-\-theme\ \fR\fB\fItheme\fR\fR] [\fB\-\-mode\ \fR\fB\fImode\fR\fR] .HP \w'\fBxdg\-icon\-resource\fR\ 'u \fBxdg\-icon\-resource\fR {\fB\-\-help\fR | \fB\-\-manual\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP The xdg\-icon\-resource program can be used to install icon resources into the desktop icon system in order to illustrate menu entries, to depict desktop icons or to graphically represent file types\&. .PP The desktop icon system identifies icons by name\&. Depending on the required size, the choice of icon theme and the context in which the icon is used, the desktop icon system locates an appropriate icon resource to depict an icon\&. Icon resources can be XPM files or PNG files\&. .PP The desktop icon system works according to the XDG Icon Theme Specification at http://www\&.freedesktop\&.org/Standards/icon\-theme\-spec .SH "COMMANDS" .PP install .RS 4 Installs the icon file indicated by \fIicon\-file\fR to the desktop icon system under the name \fIicon\-name\fR\&. Icon names do not have an extension\&. If \fIicon\-name\fR is not provided the name is derived from \fIicon\-file\fR\&. The icon file must have \fI\&.png\fR or \fI\&.xpm\fR as extension\&. If a corresponding \fI\&.icon\fR file exists in the same location as \fIicon\-file\fR it will be installed as well\&. .RE .PP uninstall .RS 4 Removes the icon indicated by \fIicon\-name\fR from the desktop icon system\&. Note that icon names do not have an extension\&. .RE .PP forceupdate .RS 4 Force an update of the desktop icon system\&. This is only useful if the last call to xdg\-icon\-resource included the \fB\-\-noupdate\fR option\&. .RE .SH "OPTIONS" .PP \fB\-\-noupdate\fR .RS 4 Postpone updating the desktop icon system\&. If multiple icons are added in sequence this flag can be used to indicate that additional changes will follow and that it is not necassery to update the desktop icon system right away\&. .RE .PP \fB\-\-novendor\fR .RS 4 Normally, xdg\-icon\-resource checks to ensure that an icon file to be installed in the \fIapps\fR context has a proper vendor prefix\&. This option can be used to disable that check\&. .sp A vendor prefix consists of alpha characters ([a\-zA\-Z]) and is terminated with a dash ("\-")\&. Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix\&. The purpose of the vendor prefix is to prevent name conflicts\&. .RE .PP \fB\-\-theme\fR \fItheme\fR .RS 4 Installs or removes the icon file as part of \fItheme\fR\&. If no theme is specified the icons will be installed as part of the default \fIhicolor\fR theme\&. Applications may install icons under multiple themes but should at least install icons for the default \fIhicolor\fR theme\&. .RE .PP \fB\-\-context\fR \fIcontext\fR .RS 4 Specifies the context for the icon\&. Icons to be used in the application menu and as desktop icon should use \fIapps\fR as context which is the default context\&. Icons to be used as file icons should use \fImimetypes\fR as context\&. Other common contexts are \fIactions\fR, \fIdevices\fR, \fIemblems\fR, \fIfilesystems\fR and \fIstock\fR\&. .RE .PP \fB\-\-size\fR \fIsize\fR .RS 4 Specifies the size of the icon\&. All icons must be square\&. Common sizes for icons in the apps context are: 16, 22, 32, 48, 64 and 128\&. Common sizes for icons in the mimetypes context are: 16, 22, 32, 48, 64 and 128 .RE .PP \fB\-\-mode\fR \fImode\fR .RS 4 \fImode\fR can be \fIuser\fR or \fIsystem\fR\&. In user mode the file is (un)installed for the current user only\&. In system mode the file is (un)installed for all users on the system\&. Usually only root is allowed to install in system mode\&. .sp The default is to use system mode when called by root and to use user mode when called by a non\-root user\&. .RE .PP \fB\-\-help\fR .RS 4 Show command synopsis\&. .RE .PP \fB\-\-manual\fR .RS 4 Show this manualpage\&. .RE .PP \fB\-\-version\fR .RS 4 Show the xdg\-utils version information\&. .RE .SH "ENVIRONMENT VARIABLES" .PP xdg\-icon\-resource honours the following environment variables: .PP XDG_UTILS_DEBUG_LEVEL .RS 4 Setting this environment variable to a non\-zero numerical value makes xdg\-icon\-resource do more verbose reporting on stderr\&. Setting a higher value increases the verbosity\&. .RE .PP XDG_UTILS_INSTALL_MODE .RS 4 This environment variable can be used by the user or administrator to override the installation mode\&. Valid values are \fIuser\fR and \fIsystem\fR\&. .RE .SH "EXIT CODES" .PP An exit code of 0 indicates success while a non\-zero exit code indicates failure\&. The following failure codes can be returned: .PP \fB1\fR .RS 4 Error in command line syntax\&. .RE .PP \fB2\fR .RS 4 One of the files passed on the command line did not exist\&. .RE .PP \fB3\fR .RS 4 A required tool could not be found\&. .RE .PP \fB4\fR .RS 4 The action failed\&. .RE .PP \fB5\fR .RS 4 No permission to read one of the files passed on the command line\&. .RE .SH "SEE ALSO" .PP \fBxdg-desktop-icon\fR(1), \fBxdg-desktop-menu\fR(1), \fBxdg-mime\fR(1) .SH "EXAMPLES" .PP To install an icon resource to depict a launcher for the application myfoobar, the company ShinyThings Inc\&. can use: .sp .if n \{\ .RS 4 .\} .nf xdg\-icon\-resource install \-\-size 64 shinythings\-myfoobar\&.png .fi .if n \{\ .RE .\} .PP To install an icon for a new application/x\-foobar file type one can use: .sp .if n \{\ .RS 4 .\} .nf xdg\-icon\-resource install \-\-context mimetypes \-\-size 48 \&./mime\-foobar\-48\&.png application\-x\-foobar xdg\-icon\-resource install \-\-context mimetypes \-\-size 64 \&./mime\-foobar\-64\&.png application\-x\-foobar .fi .if n \{\ .RE .\} .sp This will install two icons with the name application\-x\-foobar but with different sizes\&. .SH "AUTHORS" .PP \fBKevin Krammer\fR .RS 4 Author. .RE .PP \fBJeremy White\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2006 .br xdg-utils-1.1.0-rc1/scripts/man/xdg-desktop-icon.10000644000175000017500000001621711507575742021471 0ustar fboudrafboudra'\" t .\" Title: xdg-desktop-icon .\" Author: Kevin Krammer .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/31/2010 .\" Manual: xdg-desktop-icon Manual .\" Source: xdg-utils 1.0 .\" Language: English .\" .TH "XDG\-DESKTOP\-ICON" "1" "12/31/2010" "xdg-utils 1.0" "xdg-desktop-icon Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xdg-desktop-icon \- command line tool for (un)installing icons to the desktop .SH "SYNOPSIS" .HP \w'\fBxdg\-desktop\-icon\fR\ 'u \fBxdg\-desktop\-icon\fR install [\fB\-\-novendor\fR] \fIFILE\fR .HP \w'\fBxdg\-desktop\-icon\fR\ 'u \fBxdg\-desktop\-icon\fR uninstall \fIFILE\fR .HP \w'\fBxdg\-desktop\-icon\fR\ 'u \fBxdg\-desktop\-icon\fR {\fB\-\-help\fR | \fB\-\-manual\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP The xdg\-desktop\-icon program can be used to install an application launcher or other file on the desktop of the current user\&. .PP An application launcher is represented by a *\&.desktop file\&. Desktop files are defined by the freedesktop\&.org Desktop Entry Specification\&. The most important aspects of *\&.desktop files are summarized below\&. .SH "COMMANDS" .PP install .RS 4 Installs \fIFILE\fR to the desktop of the current user\&. \fIFILE\fR can be a *\&.desktop file or any other type of file\&. .RE .PP uninstall .RS 4 Removes \fIFILE\fR from the desktop of the current user\&. .RE .SH "OPTIONS" .PP \fB\-\-novendor\fR .RS 4 Normally, xdg\-desktop\-icon checks to ensure that a *\&.desktop file to be installed has a vendor prefix\&. This option can be used to disable that check\&. .sp A vendor prefix consists of alpha characters ([a\-zA\-Z]) and is terminated with a dash ("\-")\&. Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix\&. The purpose of the vendor prefix is to prevent name conflicts\&. .RE .PP \fB\-\-help\fR .RS 4 Show command synopsis\&. .RE .PP \fB\-\-manual\fR .RS 4 Show this manualpage\&. .RE .PP \fB\-\-version\fR .RS 4 Show the xdg\-utils version information\&. .RE .SH "DESKTOP FILES" .PP An application launcher can be added to the desktop by installing a *\&.desktop file\&. A *\&.desktop file consists of a \fI[Desktop Entry]\fR header followed by several \fIKey\fR=\fIValue\fR lines\&. .PP A *\&.desktop file can provide a name and description for an application in several different languages\&. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the \fIKey\fR\&. This way one can specify different values for the same \fIKey\fR depending on the currently selected language\&. .PP The following keys are often used: .PP Value=1\&.0 .RS 4 This is a mandatory field to indicate that the *\&.desktop file follows the 1\&.0 version of the specification\&. .RE .PP Type=Application .RS 4 This is a mandatory field that indicates that the *\&.desktop file describes an application launcher\&. .RE .PP Name=\fIApplication Name\fR .RS 4 The name of the application\&. For example \fIMozilla\fR .RE .PP GenericName=\fIGeneric Name\fR .RS 4 A generic description of the application\&. For example \fIWeb Browser\fR .RE .PP Comment=\fIComment\fR .RS 4 Optional field to specify a tooltip for the application\&. For example \fIVisit websites on the Internet\fR .RE .PP Icon=\fIIcon File\fR .RS 4 The icon to use for the application\&. This can either be an absolute path to an image file or an icon\-name\&. If an icon\-name is provided an image lookup by name is done in the user\*(Aqs current icon theme\&. The \fBxdg\-icon\-resource\fR command can be used to install image files into icon themes\&. The advantage of using an icon\-name instead of an absolute path is that with an icon\-name the application icon can be provided in several different sizes as well as in several differently themed styles\&. .RE .PP Exec=\fICommand Line\fR .RS 4 The command line to start the application\&. If the application can open files the %f placeholder should be specified\&. When a file is dropped on the application launcher the %f is replaced with the file path of the dropped file\&. If multiple files can be specified on the command line the %F placeholder should be used instead of %f\&. If the application is able to open URLs in addition to local files then %u or %U can be used instead of %f or %F\&. .RE .PP For a complete oveview of the *\&.desktop file format please visit http://www\&.freedesktop\&.org/wiki/Standards/desktop\-entry\-spec .SH "ENVIRONMENT VARIABLES" .PP xdg\-desktop\-icon honours the following environment variables: .PP XDG_UTILS_DEBUG_LEVEL .RS 4 Setting this environment variable to a non\-zero numerical value makes xdg\-desktop\-icon do more verbose reporting on stderr\&. Setting a higher value increases the verbosity\&. .RE .SH "EXIT CODES" .PP An exit code of 0 indicates success while a non\-zero exit code indicates failure\&. The following failure codes can be returned: .PP \fB1\fR .RS 4 Error in command line syntax\&. .RE .PP \fB2\fR .RS 4 One of the files passed on the command line did not exist\&. .RE .PP \fB3\fR .RS 4 A required tool could not be found\&. .RE .PP \fB4\fR .RS 4 The action failed\&. .RE .PP \fB5\fR .RS 4 No permission to read one of the files passed on the command line\&. .RE .SH "SEE ALSO" .PP \fBxdg-icon-resource\fR(1) .SH "EXAMPLES" .PP The company ShinyThings Inc\&. has developed an application named "WebMirror" and would like to add a launcher for for on the desktop\&. The company will use "shinythings" as its vendor id\&. In order to add the application to the desktop there needs to be a \&.desktop file for the application: .sp .if n \{\ .RS 4 .\} .nf shinythings\-webmirror\&.desktop: [Desktop Entry] Encoding=UTF\-8 Type=Application Exec=webmirror Icon=shinythings\-webmirror Name=WebMirror Name[nl]=WebSpiegel .fi .if n \{\ .RE .\} .PP Now the xdg\-desktop\-icon tool can be used to add the webmirror\&.desktop file to the desktop: .sp .if n \{\ .RS 4 .\} .nf xdg\-desktop\-icon install \&./shinythings\-webmirror\&.desktop .fi .if n \{\ .RE .\} .PP To add a README file to the desktop as well, the following command can be used: .sp .if n \{\ .RS 4 .\} .nf xdg\-desktop\-icon install \&./shinythings\-README .fi .if n \{\ .RE .\} .sp .SH "AUTHORS" .PP \fBKevin Krammer\fR .RS 4 Author. .RE .PP \fBJeremy White\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2006 .br xdg-utils-1.1.0-rc1/scripts/man/xdg-open.10000644000175000017500000000573411507575742020035 0ustar fboudrafboudra'\" t .\" Title: xdg-open .\" Author: Kevin Krammer .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/31/2010 .\" Manual: xdg-open Manual .\" Source: xdg-utils 1.0 .\" Language: English .\" .TH "XDG\-OPEN" "1" "12/31/2010" "xdg-utils 1.0" "xdg-open Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xdg-open \- opens a file or URL in the user\*(Aqs preferred application .SH "SYNOPSIS" .HP \w'\fBxdg\-open\fR\ 'u \fBxdg\-open\fR {\fB\fIfile\fR\fR | \fB\fIURL\fR\fR} .HP \w'\fBxdg\-open\fR\ 'u \fBxdg\-open\fR {\fB\-\-help\fR | \fB\-\-manual\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP xdg\-open opens a file or URL in the user\*(Aqs preferred application\&. If a URL is provided the URL will be opened in the user\*(Aqs preferred web browser\&. If a file is provided the file will be opened in the preferred application for files of that type\&. xdg\-open supports file, ftp, http and https URLs\&. .PP xdg\-open is for use inside a desktop session only\&. It is not recommended to use xdg\-open as root\&. .SH "OPTIONS" .PP \fB\-\-help\fR .RS 4 Show command synopsis\&. .RE .PP \fB\-\-manual\fR .RS 4 Show this manualpage\&. .RE .PP \fB\-\-version\fR .RS 4 Show the xdg\-utils version information\&. .RE .SH "EXIT CODES" .PP An exit code of 0 indicates success while a non\-zero exit code indicates failure\&. The following failure codes can be returned: .PP \fB1\fR .RS 4 Error in command line syntax\&. .RE .PP \fB2\fR .RS 4 One of the files passed on the command line did not exist\&. .RE .PP \fB3\fR .RS 4 A required tool could not be found\&. .RE .PP \fB4\fR .RS 4 The action failed\&. .RE .SH "EXAMPLES" .PP .sp .if n \{\ .RS 4 .\} .nf xdg\-open \*(Aqhttp://www\&.freedesktop\&.org/\*(Aq .fi .if n \{\ .RE .\} .sp Opens the Freedesktop\&.org website in the user\*(Aqs default browser .PP .sp .if n \{\ .RS 4 .\} .nf xdg\-open /tmp/foobar\&.png .fi .if n \{\ .RE .\} .sp Opens the PNG image file /tmp/foobar\&.png in the user\*(Aqs default image viewing application\&. .SH "AUTHORS" .PP \fBKevin Krammer\fR .RS 4 Author. .RE .PP \fBJeremy White\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2006 .br xdg-utils-1.1.0-rc1/scripts/man/xdg-screensaver.10000644000175000017500000001026511507575742021407 0ustar fboudrafboudra'\" t .\" Title: xdg-screensaver .\" Author: Bryce Harrington .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/31/2010 .\" Manual: xdg-screensaver Manual .\" Source: xdg-utils 1.0 .\" Language: English .\" .TH "XDG\-SCREENSAVER" "1" "12/31/2010" "xdg-utils 1.0" "xdg-screensaver Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xdg-screensaver \- command line tool for controlling the screensaver .SH "SYNOPSIS" .HP \w'\fBxdg\-screensaver\fR\ 'u \fBxdg\-screensaver\fR \fBsuspend\ \fR\fB\fIWindowID\fR\fR .HP \w'\fBxdg\-screensaver\fR\ 'u \fBxdg\-screensaver\fR \fBresume\ \fR\fB\fIWindowID\fR\fR .HP \w'\fBxdg\-screensaver\fR\ 'u \fBxdg\-screensaver\fR {\fBactivate\fR | \fBlock\fR | \fBreset\fR | \fBstatus\fR} .HP \w'\fBxdg\-screensaver\fR\ 'u \fBxdg\-screensaver\fR {\fB\-\-help\fR | \fB\-\-manual\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP xdg\-screensaver provides commands to control the screensaver\&. .PP xdg\-screensaver is for use inside a desktop session only\&. It is not recommended to use xdg\-screensaver as root\&. .SH "COMMANDS" .PP \fBsuspend \fR\fB\fIWindowID\fR\fR .RS 4 Suspends the screensaver and monitor power management\&. \fIWindowID\fR must be the X Window ID of an existing window of the calling application\&. The window must remain in existance for the duration of the suspension\&. .sp WindowID can be represented as either a decimal number or as a hexadecimal number consisting of the prefix \fI0x\fR followed by one or more hexadecimal digits\&. .sp The screensaver can be suspended in relation to multiple windows at the same time\&. In that case screensaver operation is only restored once the screensaver has been resumed in relation to each of the windows .RE .PP \fBresume \fR\fB\fIWindowID\fR\fR .RS 4 Resume the screensaver and monitor power management after being suspended\&. \fIWindowID\fR must be the same X Window ID that was passed to a previous call of \fBxdg\-screensaver suspend\fR .RE .PP \fBactivate\fR .RS 4 Turns the screensaver on immediately\&. This may result in the screen getting locked, depending on existing system policies\&. .RE .PP \fBlock\fR .RS 4 Lock the screen immediately\&. .RE .PP \fBreset\fR .RS 4 Turns the screensaver off immediately\&. If the screen was locked the user may be asked to authenticate first\&. .RE .PP \fBstatus\fR .RS 4 Prints \fIenabled\fR to stdout if the screensaver is enabled to turn on after a period of inactivity and prints \fIdisabled\fR if the screensaver is not enabled\&. .RE .SH "OPTIONS" .PP \fB\-\-help\fR .RS 4 Show command synopsis\&. .RE .PP \fB\-\-manual\fR .RS 4 Show this manualpage\&. .RE .PP \fB\-\-version\fR .RS 4 Show the xdg\-utils version information\&. .RE .SH "EXIT CODES" .PP An exit code of 0 indicates success while a non\-zero exit code indicates failure\&. The following failure codes can be returned: .PP \fB1\fR .RS 4 Error in command line syntax\&. .RE .PP \fB3\fR .RS 4 A required tool could not be found\&. .RE .PP \fB4\fR .RS 4 The action failed\&. .RE .SH "EXAMPLES" .PP .sp .if n \{\ .RS 4 .\} .nf xdg\-screensaver suspend 0x1c00007 .fi .if n \{\ .RE .\} .sp Causes the screensaver to be disabled till \fBxdg\-screensaver resume 0x1c00007\fR is called\&. \fI0x1c00007\fR must be the X Window ID of an existing window\&. .SH "AUTHOR" .PP \fBBryce Harrington\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2006 .br xdg-utils-1.1.0-rc1/scripts/man/xdg-mime.10000644000175000017500000001755611507575742020030 0ustar fboudrafboudra'\" t .\" Title: xdg-mime .\" Author: Kevin Krammer .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/31/2010 .\" Manual: xdg-mime Manual .\" Source: xdg-utils 1.0 .\" Language: English .\" .TH "XDG\-MIME" "1" "12/31/2010" "xdg-utils 1.0" "xdg-mime Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xdg-mime \- command line tool for querying information about file type handling and adding descriptions for new file types .SH "SYNOPSIS" .HP \w'\fBxdg\-mime\fR\ 'u \fBxdg\-mime\fR query {filetype | default} \&.\&.\&. .HP \w'\fBxdg\-mime\fR\ 'u \fBxdg\-mime\fR default \fIapplication\fR \fImimetype(s)\fR .HP \w'\fBxdg\-mime\fR\ 'u \fBxdg\-mime\fR install [\fB\-\-mode\ \fR\fB\fImode\fR\fR] [\fB\-\-novendor\fR] \fImimetypes\-file\fR .HP \w'\fBxdg\-mime\fR\ 'u \fBxdg\-mime\fR uninstall [\fB\-\-mode\ \fR\fB\fImode\fR\fR] \fImimetypes\-file\fR .HP \w'\fBxdg\-mime\fR\ 'u \fBxdg\-mime\fR {\fB\-\-help\fR | \fB\-\-manual\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP The xdg\-mime program can be used to query information about file types and to add descriptions for new file types\&. .SH "COMMANDS" .PP query .RS 4 Returns information related to file types\&. .sp The \fIquery\fR option is for use inside a desktop session only\&. It is not recommended to use xdg\-mime query as root\&. .sp The following queries are supported: .sp query filetype \fIFILE\fR: Returns the file type of \fIFILE\fR in the form of a MIME type\&. .sp query default \fImimetype\fR: Returns the default application that the desktop environment uses for opening files of type \fImimetype\fR\&. The default application is identified by its *\&.desktop file\&. .RE .PP default .RS 4 Ask the desktop environment to make \fIapplication\fR the default application for opening files of type \fImimetype\fR\&. An application can be made the default for several file types by specifying multiple mimetypes\&. .sp \fIapplication\fR is the desktop file id of the application and has the form vendor\-name\&.desktop \fIapplication\fR must already be installed in the desktop menu before it can be made the default handler\&. The aplication\*(Aqs desktop file must list support for all the MIME types that it wishes to be the default handler for\&. .sp Requests to make an application a default handler may be subject to system policy or approval by the end\-user\&. xdg\-mime query can be used to verify whether an application is the actual default handler for a specific file type\&. .sp The \fIdefault\fR option is for use inside a desktop session only\&. It is not recommended to use xdg\-mime default as root\&. .RE .PP install .RS 4 Adds the file type descriptions provided in \fImimetypes\-file\fR to the desktop environment\&. \fImimetypes\-file\fR must be a XML file that follows the freedesktop\&.org Shared MIME\-info Database specification and that has a mime\-info element as its document root\&. For each new file type one or more icons with name \fItype\fR\-\fIsubtype\fR must be installed with the \fBxdg\-icon\-resource\fR command in the \fImimetypes\fR context\&. For example the filetype application/vnd\&.oasis\&.opendocument\&.text requires an icon named application\-vnd\&.oasis\&.opendocument\&.text to be installed (unless the file type recommends another icon name)\&. .RE .PP uninstall .RS 4 Removes the file type descriptions provided in \fImimetypes\-file\fR and previously added with \fBxdg\-mime install\fR from the desktop environment\&. \fImimetypes\-file\fR must be a XML file that follows the freedesktop\&.org Shared MIME\-info Database specification and that has a mime\-info element as its document root\&. .RE .SH "OPTIONS" .PP \fB\-\-mode\fR \fImode\fR .RS 4 \fImode\fR can be \fIuser\fR or \fIsystem\fR\&. In user mode the file is (un)installed for the current user only\&. In system mode the file is (un)installed for all users on the system\&. Usually only root is allowed to install in system mode\&. .sp The default is to use system mode when called by root and to use user mode when called by a non\-root user\&. .RE .PP \fB\-\-novendor\fR .RS 4 Normally, xdg\-mime checks to ensure that the \fImimetypes\-file\fR to be installed has a proper vendor prefix\&. This option can be used to disable that check\&. .sp A vendor prefix consists of alpha characters ([a\-zA\-Z]) and is terminated with a dash ("\-")\&. Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix\&. The purpose of the vendor prefix is to prevent name conflicts\&. .RE .PP \fB\-\-help\fR .RS 4 Show command synopsis\&. .RE .PP \fB\-\-manual\fR .RS 4 Show this manualpage\&. .RE .PP \fB\-\-version\fR .RS 4 Show the xdg\-utils version information\&. .RE .SH "ENVIRONMENT VARIABLES" .PP xdg\-mime honours the following environment variables: .PP XDG_UTILS_DEBUG_LEVEL .RS 4 Setting this environment variable to a non\-zero numerical value makes xdg\-mime do more verbose reporting on stderr\&. Setting a higher value increases the verbosity\&. .RE .PP XDG_UTILS_INSTALL_MODE .RS 4 This environment variable can be used by the user or administrator to override the installation mode\&. Valid values are \fIuser\fR and \fIsystem\fR\&. .RE .SH "EXIT CODES" .PP An exit code of 0 indicates success while a non\-zero exit code indicates failure\&. The following failure codes can be returned: .PP \fB1\fR .RS 4 Error in command line syntax\&. .RE .PP \fB2\fR .RS 4 One of the files passed on the command line did not exist\&. .RE .PP \fB3\fR .RS 4 A required tool could not be found\&. .RE .PP \fB4\fR .RS 4 The action failed\&. .RE .PP \fB5\fR .RS 4 No permission to read one of the files passed on the command line\&. .RE .SH "SEE ALSO" .PP \fBxdg-icon-resource\fR(1), \fBxdg-desktop-menu\fR(1) .SH "EXAMPLES" .PP .sp .if n \{\ .RS 4 .\} .nf xdg\-mime query filetype /tmp/foobar\&.png .fi .if n \{\ .RE .\} .sp Prints the MIME type of the file /tmp/foobar\&.png, in this case image/png .PP .sp .if n \{\ .RS 4 .\} .nf xdg\-mime query default image/png .fi .if n \{\ .RE .\} .sp Prints the \&.desktop filename of the application which is registered to open PNG files\&. .PP .sp .if n \{\ .RS 4 .\} .nf xdg\-mime install shinythings\-shiny\&.xml .fi .if n \{\ .RE .\} .sp Adds a file type description for "shiny"\-files\&. "shinythings\-" is used as the vendor prefix\&. The file type description could look as folows\&. .sp .if n \{\ .RS 4 .\} .nf shinythings\-shiny\&.xml: Shiny new file type .fi .if n \{\ .RE .\} .sp An icon for this new file type must also be installed, for example with: .sp .if n \{\ .RS 4 .\} .nf xdg\-icon\-resource install \-\-context mimetypes \-\-size 64 shiny\-file\-icon\&.png text\-x\-shiny .fi .if n \{\ .RE .\} .sp .SH "AUTHORS" .PP \fBKevin Krammer\fR .RS 4 Author. .RE .PP \fBJeremy White\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2006 .br xdg-utils-1.1.0-rc1/scripts/man/.gitignore0000644000175000017500000000000011507575742020177 0ustar fboudrafboudraxdg-utils-1.1.0-rc1/scripts/man/xdg-settings.10000644000175000017500000000675011507575742020733 0ustar fboudrafboudra'\" t .\" Title: xdg-settings .\" Author: Mike Mammarella .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/31/2010 .\" Manual: xdg-settings Manual .\" Source: [FIXME: source] .\" Language: English .\" .TH "XDG\-SETTINGS" "1" "12/31/2010" "[FIXME: source]" "xdg-settings Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xdg-settings \- get various settings from the desktop environment .SH "SYNOPSIS" .HP \w'\fBxdg\-settings\fR\ 'u \fBxdg\-settings\fR {\fB\fIget\fR\fR | \fB\fIcheck\fR\fR | \fB\fIset\fR\fR} {\fBproperty\fR} [\fBvalue\fR] .HP \w'\fBxdg\-settings\fR\ 'u \fBxdg\-settings\fR {\fB\-\-help\fR | \fB\-\-list\fR | \fB\-\-manual\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP xdg\-settings gets various settings from the desktop environment\&. For instance, desktop environments often provide proxy configuration and default web browser settings\&. Using xdg\-settings these parameters can be extracted for use by applications that do not use the desktop environment\*(Aqs libraries (which would use the settings natively)\&. .PP xdg\-settings is for use inside a desktop session only\&. It is not recommended to use xdg\-settings as root\&. .SH "OPTIONS" .PP \fB\-\-help\fR .RS 4 Show command synopsis\&. .RE .PP \fB\-\-list\fR .RS 4 List all properties xdg\-settings knows about\&. .RE .PP \fB\-\-manual\fR .RS 4 Show this manualpage\&. .RE .PP \fB\-\-version\fR .RS 4 Show the xdg\-utils version information\&. .RE .SH "EXIT CODES" .PP An exit code of 0 indicates success while a non\-zero exit code indicates failure\&. The following failure codes can be returned: .PP \fB1\fR .RS 4 Error in command line syntax\&. .RE .PP \fB2\fR .RS 4 One of the files passed on the command line did not exist\&. .RE .PP \fB3\fR .RS 4 A required tool could not be found\&. .RE .PP \fB4\fR .RS 4 The action failed\&. .RE .SH "EXAMPLES" .PP Get the desktop file name of the current default web browser .sp .if n \{\ .RS 4 .\} .nf xdg\-settings get default\-web\-browser .fi .if n \{\ .RE .\} .PP Check whether the default web browser is firefox\&.desktop, which can be false even if "get default\-web\-browser" says that is the current value (if only some of the underlying settings actually reflect that value) .sp .if n \{\ .RS 4 .\} .nf xdg\-settings check default\-web\-browser firefox\&.desktop .fi .if n \{\ .RE .\} .PP Set the default web browser to google\-chrome\&.desktop .sp .if n \{\ .RS 4 .\} .nf xdg\-settings set default\-web\-browser google\-chrome\&.desktop .fi .if n \{\ .RE .\} .sp .SH "AUTHOR" .PP \fBMike Mammarella\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2009 .br xdg-utils-1.1.0-rc1/scripts/README0000644000175000017500000000120511507575742016324 0ustar fboudrafboudra xdg-desktop-menu - command line tool for (un)installing desktop menu items xdg-desktop-icon - command line tool for (un)installing icons to the desktop xdg-mime - command line tool for querying information about file type handling and adding descriptions for new file types xdg-icon-resource - command line tool for (un)installing icon resources xdg-open - opens a file or URL in the user's preferred application xdg-email - command line tool for sending mail using the user's preferred e-mail composer xdg-screensaver - command line tool for controlling the screensaver xdg-settings - get various settings from the desktop environment xdg-utils-1.1.0-rc1/scripts/xdg-email0000755000175000017500000004551211507575742017252 0ustar fboudrafboudra#!/bin/sh #--------------------------------------------- # xdg-email # # Utility script to open the users favorite email program, using the # RFC 2368 mailto: URI spec # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # 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. # #--------------------------------------------- manualpage() { cat << _MANUALPAGE Name xdg-email - command line tool for sending mail using the user's preferred e-mail composer Synopsis xdg-email [--utf8] [--cc address] [--bcc address] [--subject text] [--body text ] [--attach file] [ mailto-uri | address(es) ] xdg-email { --help | --manual | --version } Description xdg-email opens the user's preferred e-mail composer in order to send a mail to address(es) or mailto-uri. RFC2368 defines mailto: URIs. xdg-email limits support to, cc, subject and body fields in mailto-uri, all other fields are silently ignored. address(es) must follow the syntax of RFC822. Multiple addresses may be provided as separate arguments. All information provided on the command line is used to prefill corresponding fields in the user's e-mail composer. The user will have the opportunity to change any of this information before actually sending the e-mail. xdg-email is for use inside a desktop session only. It is not recommended to use xdg-email as root. See http://portland.freedesktop.org/EmailConfig for information on how the user can change the e-mail composer that is used. Options --utf8 Indicates that all command line options that follow are in utf8. Without this option, command line options are expected to be encoded according to locale. If the locale already specifies utf8 this option has no effect. This option does not affect mailto URIs that are passed on the command line. --cc address Specify a recipient to be copied on the e-mail. --bcc address Specify a recipient to be blindly copied on the e-mail. --subject text Specify a subject for the e-mail. --body text Specify a body for the e-mail. Since the user will be able to make changes before actually sending the e-mail, this can be used to provide the user with a template for the e-mail. text may contain linebreaks. --attach file Specify an attachment for the e-mail. file must point to an existing file. Some e-mail applications require the file to remain present after xdg-email returns. --help Show command synopsis. --manual Show this manualpage. --version Show the xdg-utils version information. Environment Variables xdg-email honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-email do more verbose reporting on stderr. Setting a higher value increases the verbosity. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. 5 No permission to read one of the files passed on the command line. Configuration Visit http://portland.freedesktop.org/EmailConfig for information how to configure xdg-email to use the email client of your choice. Examples xdg-email 'Jeremy White ' xdg-email --attach /tmp/logo.png \ --subject 'Logo contest' \ --body 'Attached you find the logo for the contest.' \ 'jwhite@example.com' xdg-email --subject 'Your password is about to expire' \ 'jwhite@example.com' 'bastian@example.com' 'whipple@example.com' _MANUALPAGE } usage() { cat << _USAGE xdg-email - command line tool for sending mail using the user's preferred e-mail composer Synopsis xdg-email [--utf8] [--cc address] [--bcc address] [--subject text] [--body text ] [--attach file] [ mailto-uri | address(es) ] xdg-email { --help | --manual | --version } _USAGE } #@xdg-utils-common@ #---------------------------------------------------------------------------- # Common utility functions included in all XDG wrapper scripts #---------------------------------------------------------------------------- DEBUG() { [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; shift echo "$@" >&2 } #------------------------------------------------------------- # Exit script on successfully completing the desired operation exit_success() { if [ $# -gt 0 ]; then echo "$@" echo fi exit 0 } #----------------------------------------- # Exit script on malformed arguments, not enough arguments # or missing required option. # prints usage information exit_failure_syntax() { if [ $# -gt 0 ]; then echo "xdg-email: $@" >&2 echo "Try 'xdg-email --help' for more information." >&2 else usage echo "Use 'man xdg-email' or 'xdg-email --manual' for additional info." fi exit 1 } #------------------------------------------------------------- # Exit script on missing file specified on command line exit_failure_file_missing() { if [ $# -gt 0 ]; then echo "xdg-email: $@" >&2 fi exit 2 } #------------------------------------------------------------- # Exit script on failure to locate necessary tool applications exit_failure_operation_impossible() { if [ $# -gt 0 ]; then echo "xdg-email: $@" >&2 fi exit 3 } #------------------------------------------------------------- # Exit script on failure returned by a tool application exit_failure_operation_failed() { if [ $# -gt 0 ]; then echo "xdg-email: $@" >&2 fi exit 4 } #------------------------------------------------------------ # Exit script on insufficient permission to read a specified file exit_failure_file_permission_read() { if [ $# -gt 0 ]; then echo "xdg-email: $@" >&2 fi exit 5 } #------------------------------------------------------------ # Exit script on insufficient permission to write a specified file exit_failure_file_permission_write() { if [ $# -gt 0 ]; then echo "xdg-email: $@" >&2 fi exit 6 } check_input_file() { if [ ! -e "$1" ]; then exit_failure_file_missing "file '$1' does not exist" fi if [ ! -r "$1" ]; then exit_failure_file_permission_read "no permission to read file '$1'" fi } check_vendor_prefix() { file_label="$2" [ -n "$file_label" ] || file_label="filename" file=`basename "$1"` case "$file" in [a-zA-Z]*-*) return ;; esac echo "xdg-email: $file_label '$file' does not have a proper vendor prefix" >&2 echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 echo "Use --novendor to override or 'xdg-email --manual' for additional info." >&2 exit 1 } check_output_file() { # if the file exists, check if it is writeable # if it does not exists, check if we are allowed to write on the directory if [ -e "$1" ]; then if [ ! -w "$1" ]; then exit_failure_file_permission_write "no permission to write to file '$1'" fi else DIR=`dirname "$1"` if [ ! -w "$DIR" -o ! -x "$DIR" ]; then exit_failure_file_permission_write "no permission to create file '$1'" fi fi } #---------------------------------------- # Checks for shared commands, e.g. --help check_common_commands() { while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --help) usage echo "Use 'man xdg-email' or 'xdg-email --manual' for additional info." exit_success ;; --manual) manualpage exit_success ;; --version) echo "xdg-email 1.0.2" exit_success ;; esac done } check_common_commands "$@" [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then # Be silent xdg_redirect_output=" > /dev/null 2> /dev/null" else # All output to stderr xdg_redirect_output=" >&2" fi #-------------------------------------- # Checks for known desktop environments # set variable DE to the desktop environments name, lowercase detectDE() { if [ 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; elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; else DE="" fi } #---------------------------------------------------------------------------- # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 # It also always returns 1 in KDE 3.4 and earlier # Simply return 0 in such case kfmclient_fix_exit_code() { version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE'` major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` test "$major" -gt 3 && return $1 test "$minor" -gt 5 && return $1 test "$release" -gt 4 && return $1 return 0 } run_thunderbird() { local THUNDERBIRD MAILTO NEWMAILTO TO CC BCC SUBJECT BODY ATTACH THUNDERBIRD="$1" MAILTO=$(echo "$2" | sed 's/^mailto://') echo "$MAILTO" | grep -qs "^?" if [ "$?" = "0" ] ; then MAILTO=$(echo "$MAILTO" | sed 's/^?//') else MAILTO=$(echo "$MAILTO" | sed 's/^/to=/' | sed 's/?/\&/') fi MAILTO=$(echo "$MAILTO" | sed 's/&/\n/g') TO=$(echo "$MAILTO" | grep '^to=' | sed 's/^to=//' | awk '{ printf "%s,",$0 }') CC=$(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//' | awk '{ printf "%s,",$0 }') BCC=$(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//' | awk '{ printf "%s,",$0 }') SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1) BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1) ATTACH=$(echo "$MAILTO" | sed 's/^attach=/\n\nfile:\/\//g' | awk '/^file:/ { printf "%s,",$0 }' | sed 's/,$//') if [ -z "$TO" ] ; then NEWMAILTO= else NEWMAILTO="to='$TO'" fi if [ -n "$CC" ] ; then NEWMAILTO="${NEWMAILTO},cc='$CC'" fi if [ -n "$BCC" ] ; then NEWMAILTO="${NEWMAILTO},bcc='$BCC'" fi if [ -n "$SUBJECT" ] ; then NEWMAILTO="${NEWMAILTO},$SUBJECT" fi if [ -n "$BODY" ] ; then NEWMAILTO="${NEWMAILTO},$BODY" fi if [ -n "$ATTACH" ] ; then NEWMAILTO="${NEWMAILTO},attachment='${ATTACH}'" fi NEWMAILTO=$(echo "$NEWMAILTO" | sed 's/^,//') DEBUG 1 "Running $THUNDERBIRD -compose \"$NEWMAILTO\"" "$THUNDERBIRD" -compose "$NEWMAILTO" if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_kde() { local client kde_email_profile_name kde_email_profile_name=`kreadconfig --file emaildefaults --group Defaults --key Profile` client=`kreadconfig --file emaildefaults --group PROFILE_"$kde_email_profile_name" --key EmailClient | cut -d ' ' -f 1` echo $client | grep thunderbird > /dev/null 2>&1 if [ $? -eq 0 ] ; then run_thunderbird "$client" "$1" fi if [ -f /etc/SuSE-release ] ; then # Workaround for SUSE 10.0 [ -z "$client" ] && client="kmail" if ! which "$client" > /dev/null 2> /dev/null; then DEBUG 3 "KDE has $client configured as email client which isn't installed" if which gnome-open > /dev/null 2> /dev/null && which evolution > /dev/null 2> /dev/null; then DEBUG 3 "Try gnome-open instead" open_gnome "$1" fi fi fi DEBUG 1 "Running kmailservice \"$1\"" if [ x"$KDE_SESSION_VERSION" = x"4" ]; then KMAILSERVICE=`kde4-config --locate kmailservice --path exe 2>/dev/null` else KMAILSERVICE=`which kmailservice 2>/dev/null` fi # KDE uses locale's encoding when decoding the URI, so set it to UTF-8 LC_ALL=C.UTF-8 $KMAILSERVICE "$1" kfmclient_fix_exit_code $? if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_gnome() { local client client=`gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -d ' ' -f 1` || "" echo $client | grep thunderbird > /dev/null 2>&1 if [ $? -eq 0 ] ; then run_thunderbird "$client" "$1" fi if gvfs-open --help 2>/dev/null 1>&2; then DEBUG 1 "Running gvfs-open \"$1\"" gvfs-open "$1" else DEBUG 1 "Running gnome-open \"$1\"" gnome-open "$1" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_xfce() { DEBUG 1 "Running exo-open \"$1\"" exo-open "$1" if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_generic() { IFS=":" for browser in $BROWSER; do if [ x"$browser" != x"" ]; then browser_with_arg=`printf "$browser" "$1" 2>/dev/null` if [ $? -ne 0 ]; then browser_with_arg=$browser; fi if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1"; else $browser_with_arg; fi if [ $? -eq 0 ]; then exit_success; fi fi done exit_failure_operation_impossible "no method available for opening '$1'" } url_encode() { result=$(echo "$1" | $utf8 | awk ' BEGIN { for ( i=1; i<=255; ++i ) ord [ sprintf ("%c", i) "" ] = i + 0 e = "" linenr = 1 } { if ( linenr++ != 1 ) { e = e "%0D%0A" } for ( i=1; i<=length ($0); ++i ) { c = substr ($0, i, 1) if ( ord [c] > 127 ) { e = e "%" sprintf("%02X", ord [c]) } else if ( c ~ /[@a-zA-Z0-9.-\\\/]/ ) { e = e c } else { e = e "%" sprintf("%02X", ord [c]) } } } END { print e } ') } options= mailto= utf8="iconv -t utf8" while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --utf8) utf8="cat" ;; --to) if [ -z "$1" ] ; then exit_failure_syntax "email address argument missing for --to" fi url_encode "$1" options="${options}to=${result}&" shift ;; --cc) if [ -z "$1" ] ; then exit_failure_syntax "email address argument missing for --cc" fi url_encode "$1" options="${options}cc=${result}&" shift ;; --bcc) if [ -z "$1" ] ; then exit_failure_syntax "email address argument missing for --bcc" fi url_encode "$1" options="${options}bcc=${result}&" shift ;; --subject) if [ -z "$1" ] ; then exit_failure_syntax "text argument missing for --subject option" fi url_encode "$1" options="${options}subject=${result}&" shift ;; --body) if [ -z "$1" ] ; then exit_failure_syntax "text argument missing for --body option" fi url_encode "$1" options="${options}body=${result}&" shift ;; --attach) if [ -z "$1" ] ; then exit_failure_syntax "file argument missing for --attach option" fi check_input_file "$1" file=`readlink -f "$1"` # Normalize path if [ -z "$file" -o ! -f "$file" ] ; then exit_failure_file_missing "file '$1' does not exist" fi url_encode "$file" options="${options}attach=${result}&" shift ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; mailto:*) mailto="$parm" ;; *@*) url_encode "$parm" if [ -z "${mailto}" ] ; then mailto="mailto:"${result}"?" else options="${options}to=${result}&" fi ;; *) exit_failure_syntax "unexpected argument '$parm'" ;; esac done if [ -z "${mailto}" ] ; then # TO address is optional mailto="mailto:?" fi case $mailto in *\?) mailto="${mailto}${options}" ;; *\?*) mailto="${mailto}&${options}" ;; *) mailto="${mailto}?${options}" ;; esac # Strip trailing ? and & mailto=`echo "${mailto}"| sed 's/[?&]$//'` # Shouldn't happen [ x"${mailto}" != x"" ] || exit_failure_syntax if which xdg-email-hook.sh > /dev/null 2> /dev/null; then xdg-email-hook.sh "${mailto}" if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi fi detectDE if [ x"$DE" = x"" ]; then DE=generic fi # if BROWSER variable is not set, check some well known browsers instead if [ x"$BROWSER" = x"" ]; then BROWSER=links2:links:lynx:w3m if [ -n "$DISPLAY" ]; then BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER fi fi case "$DE" in kde) open_kde "${mailto}" ;; gnome) open_gnome "${mailto}" ;; xfce) open_xfce "${mailto}" ;; generic|lxde) open_generic "${mailto}" ;; *) exit_failure_operation_impossible "no method available for opening '${mailto}'" ;; esac xdg-utils-1.1.0-rc1/scripts/xdg-mime0000755000175000017500000007636311507575742017122 0ustar fboudrafboudra#!/bin/sh #--------------------------------------------- # xdg-mime # # Utility script to manipulate MIME related information # on XDG compliant systems. # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # 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. # #--------------------------------------------- manualpage() { cat << _MANUALPAGE Name xdg-mime - command line tool for querying information about file type handling and adding descriptions for new file types Synopsis xdg-mime query { filetype | default } ... xdg-mime default application mimetype(s) xdg-mime install [--mode mode] [--novendor] mimetypes-file xdg-mime uninstall [--mode mode] mimetypes-file xdg-mime { --help | --manual | --version } Description The xdg-mime program can be used to query information about file types and to add descriptions for new file types. Commands query Returns information related to file types. The query option is for use inside a desktop session only. It is not recommended to use xdg-mime query as root. The following queries are supported: query filetype FILE: Returns the file type of FILE in the form of a MIME type. query default mimetype: Returns the default application that the desktop environment uses for opening files of type mimetype. The default application is identified by its *.desktop file. default Ask the desktop environment to make application the default application for opening files of type mimetype. An application can be made the default for several file types by specifying multiple mimetypes. application is the desktop file id of the application and has the form vendor-name.desktop application must already be installed in the desktop menu before it can be made the default handler. The aplication's desktop file must list support for all the MIME types that it wishes to be the default handler for. Requests to make an application a default handler may be subject to system policy or approval by the end-user. xdg-mime query can be used to verify whether an application is the actual default handler for a specific file type. The default option is for use inside a desktop session only. It is not recommended to use xdg-mime default as root. install Adds the file type descriptions provided in mimetypes-file to the desktop environment. mimetypes-file must be a XML file that follows the freedesktop.org Shared MIME-info Database specification and that has a mime-info element as its document root. For each new file type one or more icons with name type-subtype must be installed with the xdg-icon-resource command in the mimetypes context. For example the filetype application/ vnd.oasis.opendocument.text requires an icon named application-vnd.oasis.opendocument.text to be installed (unless the file type recommends another icon name). uninstall Removes the file type descriptions provided in mimetypes-file and previously added with xdg-mime install from the desktop environment. mimetypes-file must be a XML file that follows the freedesktop.org Shared MIME-info Database specification and that has a mime-info element as its document root. Options --mode mode mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode. The default is to use system mode when called by root and to use user mode when called by a non-root user. --novendor Normally, xdg-mime checks to ensure that the mimetypes-file to be installed has a proper vendor prefix. This option can be used to disable that check. A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. --help Show command synopsis. --manual Show this manualpage. --version Show the xdg-utils version information. Environment Variables xdg-mime honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-mime do more verbose reporting on stderr. Setting a higher value increases the verbosity. XDG_UTILS_INSTALL_MODE This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. 5 No permission to read one of the files passed on the command line. See Also xdg-icon-resource(1), xdg-desktop-menu(1) Examples xdg-mime query filetype /tmp/foobar.png Prints the MIME type of the file /tmp/foobar.png, in this case image/png xdg-mime query default image/png Prints the .desktop filename of the application which is registered to open PNG files. xdg-mime install shinythings-shiny.xml Adds a file type description for "shiny"-files. "shinythings-" is used as the vendor prefix. The file type description could look as folows. shinythings-shiny.xml: Shiny new file type An icon for this new file type must also be installed, for example with: xdg-icon-resource install --context mimetypes --size 64 shiny-file-icon.png text-x-shiny _MANUALPAGE } usage() { cat << _USAGE xdg-mime - command line tool for querying information about file type handling and adding descriptions for new file types Synopsis xdg-mime query { filetype | default } ... xdg-mime default application mimetype(s) xdg-mime install [--mode mode] [--novendor] mimetypes-file xdg-mime uninstall [--mode mode] mimetypes-file xdg-mime { --help | --manual | --version } _USAGE } #@xdg-utils-common@ #---------------------------------------------------------------------------- # Common utility functions included in all XDG wrapper scripts #---------------------------------------------------------------------------- DEBUG() { [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; shift echo "$@" >&2 } #------------------------------------------------------------- # Exit script on successfully completing the desired operation exit_success() { if [ $# -gt 0 ]; then echo "$@" echo fi exit 0 } #----------------------------------------- # Exit script on malformed arguments, not enough arguments # or missing required option. # prints usage information exit_failure_syntax() { if [ $# -gt 0 ]; then echo "xdg-mime: $@" >&2 echo "Try 'xdg-mime --help' for more information." >&2 else usage echo "Use 'man xdg-mime' or 'xdg-mime --manual' for additional info." fi exit 1 } #------------------------------------------------------------- # Exit script on missing file specified on command line exit_failure_file_missing() { if [ $# -gt 0 ]; then echo "xdg-mime: $@" >&2 fi exit 2 } #------------------------------------------------------------- # Exit script on failure to locate necessary tool applications exit_failure_operation_impossible() { if [ $# -gt 0 ]; then echo "xdg-mime: $@" >&2 fi exit 3 } #------------------------------------------------------------- # Exit script on failure returned by a tool application exit_failure_operation_failed() { if [ $# -gt 0 ]; then echo "xdg-mime: $@" >&2 fi exit 4 } #------------------------------------------------------------ # Exit script on insufficient permission to read a specified file exit_failure_file_permission_read() { if [ $# -gt 0 ]; then echo "xdg-mime: $@" >&2 fi exit 5 } #------------------------------------------------------------ # Exit script on insufficient permission to write a specified file exit_failure_file_permission_write() { if [ $# -gt 0 ]; then echo "xdg-mime: $@" >&2 fi exit 6 } check_input_file() { if [ ! -e "$1" ]; then exit_failure_file_missing "file '$1' does not exist" fi if [ ! -r "$1" ]; then exit_failure_file_permission_read "no permission to read file '$1'" fi } check_vendor_prefix() { file_label="$2" [ -n "$file_label" ] || file_label="filename" file=`basename "$1"` case "$file" in [a-zA-Z]*-*) return ;; esac echo "xdg-mime: $file_label '$file' does not have a proper vendor prefix" >&2 echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 echo "Use --novendor to override or 'xdg-mime --manual' for additional info." >&2 exit 1 } check_output_file() { # if the file exists, check if it is writeable # if it does not exists, check if we are allowed to write on the directory if [ -e "$1" ]; then if [ ! -w "$1" ]; then exit_failure_file_permission_write "no permission to write to file '$1'" fi else DIR=`dirname "$1"` if [ ! -w "$DIR" -o ! -x "$DIR" ]; then exit_failure_file_permission_write "no permission to create file '$1'" fi fi } #---------------------------------------- # Checks for shared commands, e.g. --help check_common_commands() { while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --help) usage echo "Use 'man xdg-mime' or 'xdg-mime --manual' for additional info." exit_success ;; --manual) manualpage exit_success ;; --version) echo "xdg-mime 1.0.2" exit_success ;; esac done } check_common_commands "$@" [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then # Be silent xdg_redirect_output=" > /dev/null 2> /dev/null" else # All output to stderr xdg_redirect_output=" >&2" fi #-------------------------------------- # Checks for known desktop environments # set variable DE to the desktop environments name, lowercase detectDE() { if [ 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; elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; else DE="" fi } #---------------------------------------------------------------------------- # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 # It also always returns 1 in KDE 3.4 and earlier # Simply return 0 in such case kfmclient_fix_exit_code() { version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE'` major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` test "$major" -gt 3 && return $1 test "$minor" -gt 5 && return $1 test "$release" -gt 4 && return $1 return 0 } update_mime_database() { if [ x"$mode" = x"user" -a -n "$DISPLAY" ] ; then detectDE if [ x"$DE" = x"kde" ] ; then DEBUG 1 "Running kbuildsycoca" if [ x"$KDE_SESSION_VERSION" = x"4" ]; then eval 'kbuildsycoca4'$xdg_redirect_output else eval 'kbuildsycoca'$xdg_redirect_output fi fi fi for x in `echo "$PATH:/opt/gnome/bin" | sed 's/:/ /g'`; do if [ -x $x/update-mime-database ] ; then DEBUG 1 "Running $x/update-mime-database $1" eval '$x/update-mime-database $1'$xdg_redirect_output return fi done } info_kde() { if [ x"$KDE_SESSION_VERSION" = x"4" ]; then DEBUG 1 "Running kmimetypefinder \"$1\"" KMIMETYPEFINDER=`which kmimetypefinder 2>/dev/null` $KMIMETYPEFINDER "$1" 2>/dev/null | head -n 1 else DEBUG 1 "Running kfile \"$1\"" KFILE=`which kfile 2>/dev/null` $KFILE "$1" 2> /dev/null | head -n 1 | cut -d "(" -f 2 | cut -d ")" -f 1 fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } 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 else DEBUG 1 "Running gnomevfs-info \"$file\"" gnomevfs-info --slow-mime "$file" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "// fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } info_generic() { DEBUG 1 "Running file -i \"$1\"" /usr/bin/file -i "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^ "// if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } make_default_kde() { # $1 is vendor-name.desktop # $2 is mime/type # # On KDE 3, add to $KDE_CONFIG_PATH/profilerc: # [$2 - 1] # Application=$1 # # Remove all [$2 - *] sections, or even better, # renumber [$2 - *] sections and remove duplicate # # On KDE 4, add $2=$1 to $XDG_DATA_APPS/mimeapps.list # # Example file: # # [Added Associations] # text/plain=kde4-kate.desktop;kde4-kwrite.desktop; # # [Removed Associations] # text/plain=gnome-gedit.desktop;gnu-emacs.desktop; vendor="$1" mimetype="$2" if [ x"$KDE_SESSION_VERSION" = x"4" ]; then default_dir=`kde4-config --path xdgdata-apps 2> /dev/null | cut -d ':' -f 1` default_file="$default_dir/mimeapps.list" else default_dir=`kde-config --path config 2> /dev/null | cut -d ':' -f 1` default_file="$default_dir/profilerc" fi if [ -z "$default_dir" ]; then DEBUG 2 "make_default_kde: No kde runtime detected" return fi DEBUG 2 "make_default_kde $vendor $mimetype" DEBUG 1 "Updating $default_file" mkdir -p "$default_dir" [ -f $default_file ] || touch $default_file if [ x"$KDE_SESSION_VERSION" = x"4" ]; then [ -f $default_file ] || touch $default_file awk -v application="$vendor" -v mimetype="$mimetype" ' BEGIN { prefix=mimetype "=" associations=0 found=0 blanks=0 } { suppress=0 if (index($0, "[Added Associations]") == 1) { associations=1 } else if (index($0, "[") == 1) { if (associations && !found) { print prefix application found=1 } associations=0 } else if ($0 == "") { blanks++ suppress=1 } else if (associations && index($0, prefix) == 1) { value=substr($0, length(prefix) + 1, length) split(value, apps, ";") value=application ";" count=0 for (i in apps) { count++ } for (i=0; i < count; i++) { if (apps[i] != application && apps[i] != "") { value=value apps[i] ";" } } $0=prefix value found=1 } if (!suppress) { while (blanks > 0) { print "" blanks-- } print $0 } } END { if (!found) { if (!associations) { print "[Added Associations]" } print prefix application } while (blanks > 0) { print "" blanks-- } } ' $default_file > ${default_file}.new && mv ${default_file}.new $default_file eval 'kbuildsycoca4'$xdg_redirect_output else awk -v application="$vendor" -v mimetype="$mimetype" ' BEGIN { header_start="[" mimetype " - " suppress=0 } { if (index($0, header_start) == 1 ) suppress=1 else if (/^\[/) { suppress=0 } if (!suppress) { print $0 } } END { print "" print "[" mimetype " - 1]" print "Application=" application print "AllowAsDefault=true" print "GenericServiceType=Application" print "Preference=1" print "ServiceType=" mimetype } ' $default_file > ${default_file}.new && mv ${default_file}.new $default_file fi } make_default_generic() { # $1 is vendor-name.desktop # $2 is mime/type # 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" 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 } defapp_generic() { MIME="$1" xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" 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 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 echo $trader_result exit_success fi done exit_success } defapp_kde() { MIME="$1" if [ x"$KDE_SESSION_VERSION" = x"4" ]; then KTRADER=`which ktraderclient 2> /dev/null` MIMETYPE="--mimetype" SERVICETYPE="--servicetype" else KTRADER=`which ktradertest 2> /dev/null` fi if [ -n "$KTRADER" ] ; then DEBUG 1 "Running KDE trader query \"$MIME\" mimetype and \"Application\" servicetype" trader_result=`$KTRADER $MIMETYPE "$MIME" $SERVICETYPE Application 2>/dev/null \ | grep DesktopEntryPath | head -n 1 | cut -d ':' -f 2 | cut -d \' -f 2` if [ -n "$trader_result" ] ; then basename "$trader_result" exit_success else exit_failure_operation_failed fi else defapp_generic "$1" fi } [ x"$1" != x"" ] || exit_failure_syntax mode= action= filename= mimetype= case $1 in install) action=install ;; uninstall) action=uninstall ;; query) shift if [ -z "$1" ] ; then exit_failure_syntax "query type argument missing" fi case $1 in filetype) action=info filename="$2" if [ -z "$filename" ] ; then exit_failure_syntax "FILE argument missing" fi case $filename in -*) exit_failure_syntax "unexpected option '$filename'" ;; esac check_input_file "$filename" ;; default) action=defapp mimetype="$2" if [ -z "$mimetype" ] ; then exit_failure_syntax "mimetype argument missing" fi case $mimetype in -*) exit_failure_syntax "unexpected option '$mimetype'" ;; */*) # Ok ;; *) exit_failure_syntax "mimetype '$mimetype' is not in the form 'minor/major'" ;; esac ;; *) exit_failure_syntax "unknown query type '$1'" ;; esac ;; default) action=makedefault shift if [ -z "$1" ] ; then exit_failure_syntax "application argument missing" fi case $1 in -*) exit_failure_syntax "unexpected option '$1'" ;; *.desktop) filename="$1" ;; *) exit_failure_syntax "malformed argument '$1', expected *.desktop" ;; esac ;; *) exit_failure_syntax "unknown command '$1'" ;; esac shift if [ "$action" = "makedefault" ]; then if [ -z "$1" ] ; then exit_failure_syntax "mimetype argument missing" fi while [ $# -gt 0 ] ; do case $1 in -*) exit_failure_syntax "unexpected option '$1'" ;; esac mimetype="$1" shift make_default_kde "$filename" "$mimetype" make_default_generic "$filename" "$mimetype" done exit_success fi if [ "$action" = "info" ]; then detectDE if [ x"$DE" = x"" ]; then if [ -x /usr/bin/file ]; then DE=generic fi fi case "$DE" in kde) info_kde "$filename" ;; gnome) info_gnome "$filename" ;; *) info_generic "$filename" ;; esac exit_failure_operation_impossible "no method available for quering MIME type of '$filename'" fi if [ "$action" = "defapp" ]; then detectDE case "$DE" in kde) defapp_kde "$mimetype" ;; *) defapp_generic "$mimetype" ;; esac exit_failure_operation_impossible "no method available for quering default application for '$mimetype'" fi vendor=true while [ $# -gt 0 ] ; do parm="$1" shift case $parm in --mode) if [ -z "$1" ] ; then exit_failure_syntax "mode argument missing for --mode" fi case "$1" in user) mode="user" ;; system) mode="system" ;; *) exit_failure_syntax "unknown mode '$1'" ;; esac shift ;; --novendor) vendor=false ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ -n "$filename" ] ; then exit_failure_syntax "unexpected argument '$parm'" fi filename="$parm" check_input_file "$filename" ;; esac done if [ -z "$action" ] ; then exit_failure_syntax "command argument missing" fi if [ -n "$XDG_UTILS_INSTALL_MODE" ] ; then if [ "$XDG_UTILS_INSTALL_MODE" = "system" ] ; then mode="system" elif [ "$XDG_UTILS_INSTALL_MODE" = "user" ] ; then mode="user" fi fi if [ -z "$mode" ] ; then if [ `whoami` = "root" ] ; then mode="system" else mode="user" fi fi if [ -z "$filename" ] ; then exit_failure_syntax "mimetypes-file argument missing" fi if [ "$vendor" = "true" -a "$action" = "install" ] ; then check_vendor_prefix "$filename" fi xdg_base_dir= xdg_dir_name=mime/packages/ xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" [ x"$mode" = x"user" ] && xdg_base_dir="$xdg_user_dir/mime" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ for x in `echo $xdg_system_dirs | sed 's/:/ /g'`; do if [ -w $x/$xdg_dir_name ] ; then [ x"$mode" = x"system" ] && xdg_base_dir="$x/mime" xdg_global_dir="$x/$xdg_dir_name" break fi done [ -w $xdg_global_dir ] || xdg_global_dir= DEBUG 3 "xdg_user_dir: $xdg_user_dir" DEBUG 3 "xdg_global_dir: $xdg_global_dir" # Find KDE3 mimelnk directory kde_user_dir= kde_global_dir= kde_global_dirs=`kde${KDE_SESSION_VERSION}-config --path mime 2> /dev/null` DEBUG 3 "kde_global_dirs: $kde_global_dirs" first= for x in `echo $kde_global_dirs | sed 's/:/ /g'` ; do if [ -z "$first" ] ; then first=false kde_user_dir="$x" elif [ -w $x ] ; then kde_global_dir="$x" fi done DEBUG 3 "kde_user_dir: $kde_user_dir" DEBUG 3 "kde_global_dir: $kde_global_dir" # TODO: Gnome legacy support # See http://forums.fedoraforum.org/showthread.php?t=26875 gnome_user_dir="$HOME/.gnome/apps" gnome_global_dir=/usr/share/gnome/apps [ -w $gnome_global_dir ] || gnome_global_dir= DEBUG 3 "gnome_user_dir: $gnome_user_dir" DEBUG 3 "gnome_global_dir: $gnome_global_dir" if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_user_dir" kde_dir="$kde_user_dir" gnome_dir="$gnome_user_dir" my_umask=077 else xdg_dir="$xdg_global_dir" kde_dir="$kde_global_dir" gnome_dir="$gnome_global_dir" my_umask=022 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then exit_failure_operation_impossible "No writable system mimetype directory found." fi fi # echo "[xdg|$xdg_user_dir|$xdg_global_dir]" # echo "[kde|$kde_user_dir|$kde_global_dir]" # echo "[gnome|$gnome_user_dir|$gnome_global_dir]" # echo "[using|$xdg_dir|$kde_dir|$gnome_dir]" basefile=`basename "$filename"` #[ -z $vendor ] || basefile="$vendor-$basefile" mimetypes= if [ -n "$kde_dir" ] ; then DEBUG 2 "KDE3 mimelnk directory found, extracting mimetypes from XML file" mimetypes=`awk < "$filename" ' # Strip XML comments BEGIN { suppress=0 } { do if (suppress) { if (match($0,/-->/)) { $0=substr($0,RSTART+RLENGTH) suppress=0 } else { break } } else { if (match($0,//)) { $0=substr($0,RSTART+RLENGTH) suppress=0 } else { break } } else { if (match($0,/