forked from pool/xdg-utils
Accepting request 126847 from X11:common:Factory
update to latest snapshot of the utils. It fixes a pile of bugs. (I don't wanna be a maintainer, I'm just fixing bugs which remain unresolved for months.) (forwarded request 126552 from jirislaby) OBS-URL: https://build.opensuse.org/request/show/126847 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xdg-utils?expand=0&rev=25
This commit is contained in:
commit
3150c85026
@ -1,63 +0,0 @@
|
||||
--- scripts/xdg-open
|
||||
+++ scripts/xdg-open
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/sh
|
||||
+#!/bin/bash
|
||||
#---------------------------------------------
|
||||
# xdg-open
|
||||
#
|
||||
@@ -382,7 +382,8 @@ open_generic()
|
||||
for browser in $BROWSER; do
|
||||
if [ x"$browser" != x"" ]; then
|
||||
|
||||
- browser_with_arg=`echo "$browser" | sed s#%s#"$1"#`
|
||||
+ IFS=' '
|
||||
+ browser_with_arg=${browser//'%s'/"$1"}
|
||||
|
||||
if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1";
|
||||
else $browser_with_arg;
|
||||
--- scripts/xdg-email
|
||||
+++ scripts/xdg-email
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/sh
|
||||
+#!/bin/bash
|
||||
#---------------------------------------------
|
||||
# xdg-email
|
||||
#
|
||||
@@ -435,7 +435,8 @@ open_generic()
|
||||
for browser in $BROWSER; do
|
||||
if [ x"$browser" != x"" ]; then
|
||||
|
||||
- browser_with_arg=`echo "$browser" | sed s#%s#"$1"#`
|
||||
+ IFS=' '
|
||||
+ browser_with_arg=${browser//'%s'/"$1"}
|
||||
|
||||
if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1";
|
||||
else $browser_with_arg;
|
||||
@@ -495,7 +496,7 @@ while [ $# -gt 0 ] ; do
|
||||
exit_failure_syntax "email address argument missing for --to"
|
||||
fi
|
||||
url_encode "$1"
|
||||
- options="${options}to=${result}&"
|
||||
+ options="${options}to=${result}&"
|
||||
shift
|
||||
;;
|
||||
|
||||
@@ -531,7 +532,7 @@ while [ $# -gt 0 ] ; do
|
||||
exit_failure_syntax "text argument missing for --body option"
|
||||
fi
|
||||
url_encode "$1"
|
||||
- options="${options}body=${result}&"
|
||||
+ options="${options}body=${result}&"
|
||||
shift
|
||||
;;
|
||||
|
||||
@@ -575,7 +576,7 @@ done
|
||||
|
||||
if [ -z "${mailto}" ] ; then
|
||||
# TO address is optional
|
||||
- mailto="mailto:?"
|
||||
+ mailto="mailto:?"
|
||||
fi
|
||||
|
||||
case $mailto in
|
21
install-some-more-scripts.diff
Normal file
21
install-some-more-scripts.diff
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
scripts/Makefile.in | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/scripts/Makefile.in
|
||||
+++ b/scripts/Makefile.in
|
||||
@@ -20,11 +20,11 @@ SCRIPTS = \
|
||||
xdg-open \
|
||||
xdg-email \
|
||||
xdg-screensaver \
|
||||
- xdg-settings
|
||||
-# xdg-su
|
||||
+ xdg-settings \
|
||||
+ xdg-su \
|
||||
+ xdg-terminal
|
||||
# xdg-copy \
|
||||
# xdg-file-dialog
|
||||
-# xdg-terminal
|
||||
|
||||
MANPAGES= $(SCRIPTS:%=man/%.1)
|
||||
WEBPAGES= $(SCRIPTS:%=%.html)
|
@ -1,521 +0,0 @@
|
||||
Index: xdg-utils-1.0.2/scripts/xdg-email
|
||||
===================================================================
|
||||
--- xdg-utils-1.0.2.orig/scripts/xdg-email
|
||||
+++ xdg-utils-1.0.2/scripts/xdg-email
|
||||
@@ -367,7 +367,7 @@ detectDE()
|
||||
|
||||
kfmclient_fix_exit_code()
|
||||
{
|
||||
- version=`kde-config --version 2>/dev/null | grep KDE`
|
||||
+ 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/'`
|
||||
@@ -393,8 +393,13 @@ open_kde()
|
||||
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"
|
||||
+ LC_ALL=C.UTF-8 $KMAILSERVICE "$1"
|
||||
kfmclient_fix_exit_code $?
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
Index: xdg-utils-1.0.2/scripts/xdg-mime
|
||||
===================================================================
|
||||
--- xdg-utils-1.0.2.orig/scripts/xdg-mime
|
||||
+++ xdg-utils-1.0.2/scripts/xdg-mime
|
||||
@@ -436,7 +436,7 @@ detectDE()
|
||||
|
||||
kfmclient_fix_exit_code()
|
||||
{
|
||||
- version=`kde-config --version 2>/dev/null | grep KDE`
|
||||
+ 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/'`
|
||||
@@ -452,7 +452,11 @@ update_mime_database()
|
||||
detectDE
|
||||
if [ x"$DE" = x"kde" ] ; then
|
||||
DEBUG 1 "Running kbuildsycoca"
|
||||
- eval 'kbuildsycoca'$xdg_redirect_output
|
||||
+ 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
|
||||
@@ -466,8 +470,15 @@ update_mime_database()
|
||||
|
||||
info_kde()
|
||||
{
|
||||
- DEBUG 1 "Running kfile \"$1\""
|
||||
- kfile "$1" 2> /dev/null | head -n 1 | cut -d "(" -f 2 | cut -d ")" -f 1
|
||||
+ 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
|
||||
|
||||
exit_success
|
||||
}
|
||||
@@ -483,7 +494,7 @@ info_gnome()
|
||||
|
||||
info_generic()
|
||||
{
|
||||
- DEBUG 1 "Running /usr/bin/file -i \"$1\""
|
||||
+ DEBUG 1 "Running file -i \"$1\""
|
||||
/usr/bin/file -i "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^ "//
|
||||
|
||||
exit_success
|
||||
@@ -492,25 +503,47 @@ info_generic()
|
||||
make_default_kde()
|
||||
{
|
||||
# $1 is vendor-name.desktop
|
||||
- # $2 is mime/type
|
||||
- # Add to $KDE_HOME/share/config/profilerc:
|
||||
+ # $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
|
||||
-
|
||||
- default_file="$HOME/.kde/share/config/profilerc"
|
||||
- DEBUG 2 "make_default_kde $1 $2"
|
||||
+ #
|
||||
+ # 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 | cut -d ':' -f 1`
|
||||
+ default_file="$default_dir/mimeapps.list"
|
||||
+ else
|
||||
+ default_dir=`kde-config --path config | cut -d ':' -f 1`
|
||||
+ default_file="$default_dir/profilerc"
|
||||
+ fi
|
||||
+ DEBUG 2 "make_default_kde $vendor $mimetype"
|
||||
DEBUG 1 "Updating $default_file"
|
||||
- mkdir -p "$HOME/.kde/share/config"
|
||||
+ mkdir -p "$default_dir"
|
||||
[ -f $default_file ] || touch $default_file
|
||||
- awk -v application="$1" -v mimetype="$2" '
|
||||
+ if [ x"$KDE_SESSION_VERSION" = x"4" ]; then
|
||||
+ # FIXME update the required section "[Added Associations]"
|
||||
+ DEBUG 1 "NOT IMPLEMENTED YET"
|
||||
+ else
|
||||
+ awk -v application="$vendor" -v mimetype="$mimetype" '
|
||||
BEGIN {
|
||||
header_start="[" mimetype " - "
|
||||
supress=0
|
||||
}
|
||||
- {
|
||||
+ {
|
||||
if (index($0, header_start) == 1 )
|
||||
supress=1
|
||||
else
|
||||
@@ -521,7 +554,7 @@ make_default_kde()
|
||||
}
|
||||
}
|
||||
END {
|
||||
- print ""
|
||||
+ print ""
|
||||
print "[" mimetype " - 1]"
|
||||
print "Application=" application
|
||||
print "AllowAsDefault=true"
|
||||
@@ -530,18 +563,21 @@ make_default_kde()
|
||||
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
|
||||
+ # $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"
|
||||
+ mkdir -p "$xdg_user_dir/applications"
|
||||
+ [ -f $default_file ] || touch $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
|
||||
@@ -573,11 +609,17 @@ defapp_generic()
|
||||
defapp_kde()
|
||||
{
|
||||
MIME="$1"
|
||||
- ktradertest=`which ktradertest 2> /dev/null`
|
||||
- if [ -n "$ktradertest" ] ; then
|
||||
- DEBUG 1 "Running ktradertest \"$MIME\" Application"
|
||||
- trader_result=`ktradertest "$MIME" Application 2>/dev/null | grep DesktopEntryPath \
|
||||
- | head -n 1 | cut -d ':' -f 2 | cut -d \' -f 2`
|
||||
+ 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
|
||||
@@ -608,16 +650,16 @@ case $1 in
|
||||
query)
|
||||
shift
|
||||
|
||||
- if [ -z "$1" ] ; then
|
||||
+ if [ -z "$1" ] ; then
|
||||
exit_failure_syntax "query type argument missing"
|
||||
fi
|
||||
-
|
||||
+
|
||||
case $1 in
|
||||
filetype)
|
||||
action=info
|
||||
|
||||
filename="$2"
|
||||
- if [ -z "$filename" ] ; then
|
||||
+ if [ -z "$filename" ] ; then
|
||||
exit_failure_syntax "FILE argument missing"
|
||||
fi
|
||||
case $filename in
|
||||
@@ -631,7 +673,7 @@ case $1 in
|
||||
default)
|
||||
action=defapp
|
||||
mimetype="$2"
|
||||
- if [ -z "$mimetype" ] ; then
|
||||
+ if [ -z "$mimetype" ] ; then
|
||||
exit_failure_syntax "mimetype argument missing"
|
||||
fi
|
||||
case $mimetype in
|
||||
@@ -659,7 +701,7 @@ case $1 in
|
||||
action=makedefault
|
||||
shift
|
||||
|
||||
- if [ -z "$1" ] ; then
|
||||
+ if [ -z "$1" ] ; then
|
||||
exit_failure_syntax "application argument missing"
|
||||
fi
|
||||
case $1 in
|
||||
@@ -686,7 +728,7 @@ shift
|
||||
|
||||
|
||||
if [ "$action" = "makedefault" ]; then
|
||||
- if [ -z "$1" ] ; then
|
||||
+ if [ -z "$1" ] ; then
|
||||
exit_failure_syntax "mimetype argument missing"
|
||||
fi
|
||||
|
||||
@@ -698,7 +740,7 @@ if [ "$action" = "makedefault" ]; then
|
||||
esac
|
||||
mimetype="$1"
|
||||
shift
|
||||
-
|
||||
+
|
||||
make_default_kde "$filename" "$mimetype"
|
||||
make_default_generic "$filename" "$mimetype"
|
||||
done
|
||||
@@ -723,7 +765,7 @@ if [ "$action" = "info" ]; then
|
||||
info_gnome "$filename"
|
||||
;;
|
||||
|
||||
- generic)
|
||||
+ *)
|
||||
info_generic "$filename"
|
||||
;;
|
||||
esac
|
||||
@@ -763,7 +805,7 @@ while [ $# -gt 0 ] ; do
|
||||
system)
|
||||
mode="system"
|
||||
;;
|
||||
-
|
||||
+
|
||||
*)
|
||||
exit_failure_syntax "unknown mode '$1'"
|
||||
;;
|
||||
@@ -842,7 +884,7 @@ DEBUG 3 "xdg_global_dir: $xdg_global_dir
|
||||
# Find KDE3 mimelnk directory
|
||||
kde_user_dir=
|
||||
kde_global_dir=
|
||||
-kde_global_dirs=`kde-config --path mime 2> /dev/null`
|
||||
+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
|
||||
@@ -897,7 +939,7 @@ BEGIN {
|
||||
supress=0
|
||||
}
|
||||
{
|
||||
- do
|
||||
+ do
|
||||
if (supress) {
|
||||
if (match($0,/-->/)) {
|
||||
$0=substr($0,RSTART+RLENGTH)
|
||||
@@ -932,7 +974,7 @@ BEGIN {
|
||||
}
|
||||
}
|
||||
}'`
|
||||
-fi
|
||||
+fi
|
||||
|
||||
DEBUG 1 "$action mimetype in $xdg_dir"
|
||||
|
||||
@@ -948,7 +990,7 @@ case $action in
|
||||
|
||||
if [ -n "$mimetypes" ] ; then
|
||||
# No quotes around $mimetypes
|
||||
- for x in $mimetypes ; do
|
||||
+ for x in $mimetypes ; do
|
||||
DEBUG 1 "Installing $kde_dir/$x.desktop (KDE 3.x support)"
|
||||
mkdir -p `dirname $kde_dir/$x.desktop`
|
||||
awk < "$filename" '
|
||||
@@ -957,7 +999,7 @@ BEGIN {
|
||||
supress=0
|
||||
}
|
||||
{
|
||||
- do
|
||||
+ do
|
||||
if (supress) {
|
||||
if (match($0,/-->/)) {
|
||||
$0=substr($0,RSTART+RLENGTH)
|
||||
@@ -982,7 +1024,7 @@ BEGIN {
|
||||
}
|
||||
' | awk > $kde_dir/$x.desktop '
|
||||
# Extract mimetype $x from the XML file $filename
|
||||
-# Note that bash requires us to escape a single quote as '"'"'
|
||||
+# Note that bash requires us to escape a single quote as '"'"'
|
||||
BEGIN {
|
||||
the_type=ARGV[1]
|
||||
the_source=ARGV[2]
|
||||
@@ -1002,7 +1044,7 @@ BEGIN {
|
||||
print "MimeType=" the_type
|
||||
the_icon=the_type
|
||||
sub("/", "-", the_icon)
|
||||
- print "Icon=" the_icon
|
||||
+ print "Icon=" the_icon
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1014,25 +1056,25 @@ BEGIN {
|
||||
}
|
||||
|
||||
if (match($0,/^sub-class-of/)) {
|
||||
- if (match($0,/type="[^"]*/) || match($0,/type='"'"'[^'"'"']*/)) {
|
||||
+ if (match($0,/type="[^"]*/) || match($0,/type='"'"'[^'"'"']*/)) {
|
||||
print "X-KDE-IsAlso=" substr($0,RSTART+6,RLENGTH-6)
|
||||
}
|
||||
else {
|
||||
print "Error: '"'"'type'"'"' argument missing in " RS $0
|
||||
- exit 1
|
||||
+ exit 1
|
||||
}
|
||||
}
|
||||
if (match($0,/^glob/)) {
|
||||
- if (match($0,/pattern="[^"]*/) || match($0,/pattern='"'"'[^'"'"']*/)) {
|
||||
+ if (match($0,/pattern="[^"]*/) || match($0,/pattern='"'"'[^'"'"']*/)) {
|
||||
glob_patterns = glob_patterns substr($0,RSTART+9,RLENGTH-9) ";"
|
||||
}
|
||||
else {
|
||||
print "Error: '"'"'pattern'"'"' argument missing in " RS $0
|
||||
- exit 1
|
||||
+ exit 1
|
||||
}
|
||||
}
|
||||
if (match($0,/^comment/)) {
|
||||
- if (match($0,/xml:lang="[^"]*/) || match($0,/xml:lang='"'"'[^'"'"']*/)) {
|
||||
+ if (match($0,/xml:lang="[^"]*/) || match($0,/xml:lang='"'"'[^'"'"']*/)) {
|
||||
lang=substr($0,RSTART+10,RLENGTH-10)
|
||||
}
|
||||
else {
|
||||
@@ -1061,7 +1103,7 @@ END {
|
||||
if [ "$?" = "1" ] ; then
|
||||
grep -A 10 "^Error:" $kde_dir/$x.desktop >&2
|
||||
rm $kde_dir/$x.desktop
|
||||
- exit 1
|
||||
+ exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -1075,8 +1117,8 @@ END {
|
||||
done
|
||||
|
||||
# No quotes around $mimetypes
|
||||
- for x in $mimetypes ; do
|
||||
- if grep '^# Installed by xdg-mime' $kde_dir/$x.desktop &>/dev/null ; then
|
||||
+ for x in $mimetypes ; do
|
||||
+ if grep '^# Installed by xdg-mime' $kde_dir/$x.desktop >/dev/null 2>&1; then
|
||||
DEBUG 1 "Removing $kde_dir/$x.desktop (KDE 3.x support)"
|
||||
rm -f $kde_dir/$x.desktop
|
||||
fi
|
||||
Index: xdg-utils-1.0.2/scripts/xdg-screensaver
|
||||
===================================================================
|
||||
--- xdg-utils-1.0.2.orig/scripts/xdg-screensaver
|
||||
+++ xdg-utils-1.0.2/scripts/xdg-screensaver
|
||||
@@ -344,7 +344,7 @@ detectDE()
|
||||
|
||||
kfmclient_fix_exit_code()
|
||||
{
|
||||
- version=`kde-config --version 2>/dev/null | grep KDE`
|
||||
+ 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/'`
|
||||
@@ -414,7 +414,11 @@ perform_action()
|
||||
|
||||
case "$DE" in
|
||||
kde)
|
||||
- screensaver_kde "$1"
|
||||
+ if [ x"$KDE_SESSION_VERSION" = x"4" ]; then
|
||||
+ screensaver_freedesktop "$1"
|
||||
+ else
|
||||
+ screensaver_kde "$1"
|
||||
+ fi
|
||||
;;
|
||||
|
||||
gnome)
|
||||
@@ -535,6 +539,101 @@ track_window()
|
||||
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
|
||||
Index: xdg-utils-1.0.2/scripts/xdg-open
|
||||
===================================================================
|
||||
--- xdg-utils-1.0.2.orig/scripts/xdg-open
|
||||
+++ xdg-utils-1.0.2/scripts/xdg-open
|
||||
@@ -315,7 +315,7 @@ detectDE()
|
||||
|
||||
kfmclient_fix_exit_code()
|
||||
{
|
||||
- version=`kde-config --version 2>/dev/null | grep KDE`
|
||||
+ 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/'`
|
@ -1,83 +0,0 @@
|
||||
Source of the patch: http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=666d65cae0f2e66d33ec0dc48c054afbf16c9e3f
|
||||
--- scripts/xdg-screensaver 2012-05-21 12:55:11.846122671 +0200
|
||||
+++ scripts/xdg-screensaver 2012-05-21 12:58:36.269876261 +0200
|
||||
@@ -613,16 +613,18 @@
|
||||
|
||||
screensaver_gnome()
|
||||
{
|
||||
-# TODO
|
||||
-# There seems to be a DBUS interface for gnome-screensaver
|
||||
-# See http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2006-April/042579.html and
|
||||
-# http://cvs.gnome.org/viewcvs/gnome-screensaver/src/gs-listener-dbus.c?rev=1.36&view=log
|
||||
-# A problem seems to be that Inhibit is tied to the lifetime of the DBUS appname and
|
||||
-# this can not be used from a script
|
||||
+# DBUS interface for gnome-screensaver
|
||||
+# http://people.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html
|
||||
case "$1" in
|
||||
suspend)
|
||||
- screensaver_suspend_loop gnome-screensaver-command --poke
|
||||
- result=0
|
||||
+ screensaver_suspend_loop \
|
||||
+ dbus-send --session \
|
||||
+ --dest=org.gnome.ScreenSaver \
|
||||
+ --type=method_call \
|
||||
+ /org/gnome/ScreenSaver \
|
||||
+ org.gnome.ScreenSaver.SimulateUserActivity \
|
||||
+ 2> /dev/null
|
||||
+ result=$?
|
||||
;;
|
||||
|
||||
resume)
|
||||
@@ -631,7 +633,13 @@
|
||||
;;
|
||||
|
||||
activate)
|
||||
- gnome-screensaver-command --activate > /dev/null 2> /dev/null
|
||||
+ dbus-send --session \
|
||||
+ --dest=org.gnome.ScreenSaver \
|
||||
+ --type=method_call \
|
||||
+ /org/gnome/ScreenSaver \
|
||||
+ org.gnome.ScreenSaver.SetActive \
|
||||
+ boolean:true \
|
||||
+ 2> /dev/null
|
||||
result=$?
|
||||
;;
|
||||
|
||||
@@ -642,18 +650,31 @@
|
||||
|
||||
reset)
|
||||
# Turns the screensaver off right now
|
||||
- gnome-screensaver-command --deactivate > /dev/null 2> /dev/null
|
||||
+ dbus-send --session \
|
||||
+ --dest=org.gnome.ScreenSaver \
|
||||
+ --type=method_call \
|
||||
+ /org/gnome/ScreenSaver \
|
||||
+ org.gnome.ScreenSaver.SimulateUserActivity \
|
||||
+ 2> /dev/null
|
||||
result=$?
|
||||
;;
|
||||
|
||||
status)
|
||||
- result=0
|
||||
- if [ -f "$screensaver_file" ] ; then
|
||||
- echo "disabled"
|
||||
- elif gnome-screensaver-command --query > /dev/null 2> /dev/null; then
|
||||
+ status=`dbus-send --session \
|
||||
+ --dest=org.gnome.ScreenSaver \
|
||||
+ --type=method_call \
|
||||
+ --print-reply \
|
||||
+ --reply-timeout=2000 \
|
||||
+ /org/gnome/ScreenSaver \
|
||||
+ org.gnome.ScreenSaver.GetActive \
|
||||
+ | grep boolean | cut -d ' ' -f 5`
|
||||
+ result=$?
|
||||
+ if [ x"$status" = "xtrue" -o x"$status" = "xfalse" ]; then
|
||||
echo "enabled"
|
||||
+ elif [ x"$result" != "x0" ]; then
|
||||
+ echo "ERROR: dbus org.gnome.ScreenSaver.GetActive returned '$status'" >&2
|
||||
+ return 1
|
||||
else
|
||||
- # Something is wrong
|
||||
echo "disabled"
|
||||
fi
|
||||
;;
|
@ -1,7 +1,11 @@
|
||||
Source of the patch: http://patch-tracker.debian.org/patch/series/view/xdg-utils/1.1.0~rc1+git20111210-6/xdg-screensaver-new-gnome.diff
|
||||
--- scripts/xdg-screensaver 2012-05-21 12:58:36.269876261 +0200
|
||||
+++ scripts/xdg-screensaver 2012-05-21 13:01:12.328342683 +0200
|
||||
@@ -617,14 +617,54 @@
|
||||
---
|
||||
scripts/xdg-screensaver.in | 56 ++++++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 48 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/scripts/xdg-screensaver.in
|
||||
+++ b/scripts/xdg-screensaver.in
|
||||
@@ -435,14 +435,54 @@ screensaver_gnome_screensaver()
|
||||
# http://people.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html
|
||||
case "$1" in
|
||||
suspend)
|
||||
|
@ -1,12 +0,0 @@
|
||||
Source of the patch: http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=7465b22a95e9a28e3f4960e6ea40a4abeca1c2e9
|
||||
--- scripts/xdg-screensaver 2007-06-24 21:58:06.000000000 +0200
|
||||
+++ scripts/xdg-screensaver 2012-05-21 12:51:51.108252420 +0200
|
||||
@@ -608,7 +608,7 @@
|
||||
fi
|
||||
$MV "$tmpfile" "$screensaver_file"
|
||||
unlockfile
|
||||
- (while [ -f "$screensaver_file" ]; do $*; sleep 59; done) > /dev/null 2> /dev/null &
|
||||
+ (while [ -f "$screensaver_file" ]; do $*; sleep 50; done) > /dev/null 2> /dev/null &
|
||||
}
|
||||
|
||||
screensaver_gnome()
|
736
xdg-su.diff
736
xdg-su.diff
@ -1,736 +0,0 @@
|
||||
--- scripts/Makefile.in
|
||||
+++ scripts/Makefile.in
|
||||
@@ -19,8 +19,8 @@
|
||||
xdg-icon-resource \
|
||||
xdg-open \
|
||||
xdg-email \
|
||||
- xdg-screensaver
|
||||
-# xdg-su
|
||||
+ xdg-screensaver \
|
||||
+ xdg-su
|
||||
# xdg-copy \
|
||||
# xdg-file-dialog
|
||||
# xdg-terminal
|
||||
--- scripts/desc/xdg-su.xml
|
||||
+++ scripts/desc/xdg-su.xml
|
||||
@@ -0,0 +1,166 @@
|
||||
+<?xml version="1.0"?>
|
||||
+<?xml-stylesheet type="text/xsl"
|
||||
+ href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
|
||||
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
+]>
|
||||
+<refentry id="xdg-su">
|
||||
+ <refentryinfo>
|
||||
+ <title>xdg-su Manual</title>
|
||||
+ <copyright>
|
||||
+ <year>2006</year>
|
||||
+ </copyright>
|
||||
+ <author>
|
||||
+ <firstname>Kevin</firstname>
|
||||
+ <surname>Krammer</surname>
|
||||
+ </author>
|
||||
+ <address><email>kevin.krammer@gmx.at</email></address>
|
||||
+ <author>
|
||||
+ <firstname>Jeremy</firstname>
|
||||
+ <surname>White</surname>
|
||||
+ </author>
|
||||
+ <address><email>jwhite@codeweavers.com</email></address>
|
||||
+ <releaseinfo>This is release 0.5 of the xdg-su Manual.</releaseinfo>
|
||||
+ </refentryinfo>
|
||||
+
|
||||
+ <refmeta>
|
||||
+ <refentrytitle>xdg-su</refentrytitle>
|
||||
+ <manvolnum>1</manvolnum>
|
||||
+ </refmeta>
|
||||
+
|
||||
+ <refnamediv>
|
||||
+ <refname>xdg-su</refname>
|
||||
+ <refpurpose>run a GUI program as root after prompting for the root password</refpurpose>
|
||||
+ </refnamediv>
|
||||
+
|
||||
+ <refsynopsisdiv>
|
||||
+ <cmdsynopsis>
|
||||
+ <command>xdg-su</command>
|
||||
+ <arg><option>-u <replaceable>user</replaceable></option></arg>
|
||||
+ <arg choice="plain"><option>-c <replaceable>command</replaceable></option></arg>
|
||||
+ </cmdsynopsis>
|
||||
+ <cmdsynopsis>
|
||||
+ <command>xdg-su</command>
|
||||
+ <group choice="req">
|
||||
+ <arg choice="plain"><option>--help</option></arg>
|
||||
+ <arg choice="plain"><option>--manual</option></arg>
|
||||
+ <arg choice="plain"><option>--version</option></arg>
|
||||
+ </group>
|
||||
+ </cmdsynopsis>
|
||||
+ </refsynopsisdiv>
|
||||
+
|
||||
+ <refsect1 id="description">
|
||||
+ <title>Description</title>
|
||||
+ <para>
|
||||
+ xdg-su provides a graphical dialog that prompts the user for a password
|
||||
+ to run <replaceable>command</replaceable> as <replaceable>user</replaceable>
|
||||
+ or as root if no user was specified.
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ xdg-su is for use inside a desktop session only.
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ xdg-su discards any stdout and stderr output from
|
||||
+ <replaceable>command</replaceable>.
|
||||
+ </para>
|
||||
+ </refsect1>
|
||||
+ <refsect1 id="options">
|
||||
+ <title>Options</title>
|
||||
+ <variablelist>
|
||||
+ <varlistentry>
|
||||
+ <term><option>-u <replaceable>user</replaceable></option></term>
|
||||
+ <listitem>
|
||||
+ <simpara>
|
||||
+ run <replaceable>command</replaceable> as
|
||||
+ <replaceable>user</replaceable>. The default is to run as root.
|
||||
+ </simpara>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ <varlistentry>
|
||||
+ <term><option>--help</option></term>
|
||||
+ <listitem>
|
||||
+ <simpara>
|
||||
+ Show command synopsis.
|
||||
+ </simpara>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ <varlistentry>
|
||||
+ <term><option>--manual</option></term>
|
||||
+ <listitem>
|
||||
+ <simpara>
|
||||
+ Show this manualpage.
|
||||
+ </simpara>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ <varlistentry>
|
||||
+ <term><option>--version</option></term>
|
||||
+ <listitem>
|
||||
+ <simpara>
|
||||
+ Show the xdg-utils version information.
|
||||
+ </simpara>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
+ </variablelist>
|
||||
+ </refsect1>
|
||||
+ <refsect1 id="exitcodes">
|
||||
+ <title>Exit Codes</title>
|
||||
+ <para>
|
||||
+ An exit code of 0 indicates success while a non-zero exit code
|
||||
+ indicates failure. The following failure codes can be returned:
|
||||
+ </para>
|
||||
+ <variablelist>
|
||||
+ <varlistentry>
|
||||
+ <term><option>1</option></term>
|
||||
+ <listitem>
|
||||
+ <simpara>
|
||||
+ Error in command line syntax.
|
||||
+ </simpara>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ <varlistentry>
|
||||
+ <term><option>2</option></term>
|
||||
+ <listitem>
|
||||
+ <simpara>
|
||||
+ One of the files passed on the command line did not exist.
|
||||
+ </simpara>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ <varlistentry>
|
||||
+ <term><option>3</option></term>
|
||||
+ <listitem>
|
||||
+ <simpara>
|
||||
+ A required tool could not be found.
|
||||
+ </simpara>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ <varlistentry>
|
||||
+ <term><option>4</option></term>
|
||||
+ <listitem>
|
||||
+ <simpara>
|
||||
+ The action failed.
|
||||
+ </simpara>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ </variablelist>
|
||||
+ </refsect1>
|
||||
+ <refsect1 id="seealso">
|
||||
+ <title>See Also</title>
|
||||
+ <para><citerefentry><refentrytitle>su</refentrytitle>
|
||||
+ <manvolnum>1</manvolnum>
|
||||
+ </citerefentry>
|
||||
+ </para>
|
||||
+ </refsect1>
|
||||
+ <refsect1 id="examples">
|
||||
+ <title>Examples</title>
|
||||
+ <para>
|
||||
+<programlisting>
|
||||
+xdg-su -u root -c "/opt/shinythings/bin/install-GUI --install fast"
|
||||
+</programlisting>
|
||||
+ Runs the /opt/shinythings/bin/install-GUI command with root permissions.
|
||||
+ </para>
|
||||
+ </refsect1>
|
||||
+</refentry>
|
||||
--- scripts/html/xdg-su.html
|
||||
+++ scripts/html/xdg-su.html
|
||||
@@ -0,0 +1,36 @@
|
||||
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xdg-su</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="xdg-su"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xdg-su — run a GUI program as root after prompting for the root password</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xdg-su</code> [<code class="option">-u <em class="replaceable"><code>user</code></em></code>] <code class="option">-c <em class="replaceable"><code>command</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">xdg-su</code> { <code class="option">--help</code> | <code class="option">--manual</code> | <code class="option">--version</code> }</p></div></div><div class="refsect1" lang="en"><a name="description"></a><h2>Description</h2><p>
|
||||
+ xdg-su provides a graphical dialog that prompts the user for a password
|
||||
+ to run <em class="replaceable"><code>command</code></em> as <em class="replaceable"><code>user</code></em>
|
||||
+ or as root if no user was specified.
|
||||
+ </p><p>
|
||||
+ xdg-su is for use inside a desktop session only.
|
||||
+ </p><p>
|
||||
+ xdg-su discards any stdout and stderr output from
|
||||
+ <em class="replaceable"><code>command</code></em>.
|
||||
+ </p></div><div class="refsect1" lang="en"><a name="options"></a><h2>Options</h2><div class="variablelist"><dl><dt><span class="term"><code class="option">-u <em class="replaceable"><code>user</code></em></code></span></dt><dd>
|
||||
+ run <em class="replaceable"><code>command</code></em> as
|
||||
+ <em class="replaceable"><code>user</code></em>. The default is to run as root.
|
||||
+ </dd><dt><span class="term"><code class="option">--help</code></span></dt><dd>
|
||||
+ Show command synopsis.
|
||||
+ </dd><dt><span class="term"><code class="option">--manual</code></span></dt><dd>
|
||||
+ Show this manualpage.
|
||||
+ </dd><dt><span class="term"><code class="option">--version</code></span></dt><dd>
|
||||
+ Show the xdg-utils version information.
|
||||
+ </dd></dl></div></div><div class="refsect1" lang="en"><a name="exitcodes"></a><h2>Exit Codes</h2><p>
|
||||
+ An exit code of 0 indicates success while a non-zero exit code
|
||||
+ indicates failure. The following failure codes can be returned:
|
||||
+ </p><div class="variablelist"><dl><dt><span class="term"><code class="option">1</code></span></dt><dd>
|
||||
+ Error in command line syntax.
|
||||
+ </dd><dt><span class="term"><code class="option">2</code></span></dt><dd>
|
||||
+ One of the files passed on the command line did not exist.
|
||||
+ </dd><dt><span class="term"><code class="option">3</code></span></dt><dd>
|
||||
+ A required tool could not be found.
|
||||
+ </dd><dt><span class="term"><code class="option">4</code></span></dt><dd>
|
||||
+ The action failed.
|
||||
+ </dd></dl></div></div><div class="refsect1" lang="en"><a name="seealso"></a><h2>See Also</h2><p><span class="citerefentry"><span class="refentrytitle">su</span>(1)</span>
|
||||
+ </p></div><div class="refsect1" lang="en"><a name="examples"></a><h2>Examples</h2><p>
|
||||
+</p><pre class="programlisting">
|
||||
+xdg-su -u root -c "/opt/shinythings/bin/install-GUI --install fast"
|
||||
+</pre><p>
|
||||
+ Runs the /opt/shinythings/bin/install-GUI command with root permissions.
|
||||
+ </p></div></div></body></html>
|
||||
--- scripts/man/xdg-su.1
|
||||
+++ scripts/man/xdg-su.1
|
||||
@@ -0,0 +1,75 @@
|
||||
+.\" ** You probably do not want to edit this file directly **
|
||||
+.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
|
||||
+.\" Instead of manually editing it, you probably should edit the DocBook XML
|
||||
+.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
|
||||
+.TH "XDG\-SU" "1" "07/31/2006" "This is release 0.5 of the xdg\-su Manual" ""
|
||||
+.\" disable hyphenation
|
||||
+.nh
|
||||
+.\" disable justification (adjust text to left margin only)
|
||||
+.ad l
|
||||
+.SH "NAME"
|
||||
+xdg\-su \- run a GUI program as root after prompting for the root password
|
||||
+.SH "SYNOPSIS"
|
||||
+.HP 7
|
||||
+\fBxdg\-su\fR [\fB\-u\ \fR\fB\fIuser\fR\fR] \fB\-c\ \fR\fB\fIcommand\fR\fR
|
||||
+.HP 7
|
||||
+\fBxdg\-su\fR {\fB\-\-help\fR \fB\-\-manual\fR \fB\-\-version\fR}
|
||||
+.SH "DESCRIPTION"
|
||||
+.PP
|
||||
+xdg\-su provides a graphical dialog that prompts the user for a password to run
|
||||
+\fIcommand\fR
|
||||
+as
|
||||
+\fIuser\fR
|
||||
+or as root if no user was specified.
|
||||
+.PP
|
||||
+xdg\-su is for use inside a desktop session only.
|
||||
+.PP
|
||||
+xdg\-su discards any stdout and stderr output from
|
||||
+\fIcommand\fR.
|
||||
+.SH "OPTIONS"
|
||||
+.TP
|
||||
+\fB\-u \fR\fB\fIuser\fR\fR
|
||||
+run
|
||||
+\fIcommand\fR
|
||||
+as
|
||||
+\fIuser\fR. The default is to run as root.
|
||||
+.TP
|
||||
+\fB\-\-help\fR
|
||||
+Show command synopsis.
|
||||
+.TP
|
||||
+\fB\-\-manual\fR
|
||||
+Show this manualpage.
|
||||
+.TP
|
||||
+\fB\-\-version\fR
|
||||
+Show the xdg\-utils version information.
|
||||
+.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:
|
||||
+.TP
|
||||
+\fB1\fR
|
||||
+Error in command line syntax.
|
||||
+.TP
|
||||
+\fB2\fR
|
||||
+One of the files passed on the command line did not exist.
|
||||
+.TP
|
||||
+\fB3\fR
|
||||
+A required tool could not be found.
|
||||
+.TP
|
||||
+\fB4\fR
|
||||
+The action failed.
|
||||
+.SH "SEE ALSO"
|
||||
+.PP
|
||||
+\fBsu\fR(1)
|
||||
+.SH "EXAMPLES"
|
||||
+.PP
|
||||
+.nf
|
||||
+xdg\-su \-u root \-c "/opt/shinythings/bin/install\-GUI \-\-install fast"
|
||||
+.fi
|
||||
+.sp
|
||||
+Runs the /opt/shinythings/bin/install\-GUI command with root permissions.
|
||||
+.SH "AUTHOR"
|
||||
+Kevin Krammer, Jeremy White.
|
||||
+.br
|
||||
+<kevin.krammer@gmx.at>
|
||||
+.br
|
||||
+<jwhite@codeweavers.com>
|
||||
--- scripts/xdg-su
|
||||
+++ scripts/xdg-su
|
||||
@@ -0,0 +1,434 @@
|
||||
+#!/bin/sh
|
||||
+#---------------------------------------------
|
||||
+# xdg-su
|
||||
+#
|
||||
+# Utility script to run a command as an alternate user, generally
|
||||
+# the root user, with a graphical prompt for the root
|
||||
+# password if needed
|
||||
+#
|
||||
+# Refer to the usage() function below for usage.
|
||||
+#
|
||||
+# Copyright 2006, Jeremy White <jwhite@codeweavers.com>
|
||||
+# Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
|
||||
+#
|
||||
+# 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-su - run a GUI program as root after prompting for the root password
|
||||
+
|
||||
+Synopsis
|
||||
+
|
||||
+xdg-su [-u user] -c command
|
||||
+
|
||||
+xdg-su { --help | --manual | --version }
|
||||
+
|
||||
+Description
|
||||
+
|
||||
+xdg-su provides a graphical dialog that prompts the user for a password to run
|
||||
+command as user or as root if no user was specified.
|
||||
+
|
||||
+xdg-su is for use inside a desktop session only.
|
||||
+
|
||||
+xdg-su discards any stdout and stderr output from command.
|
||||
+
|
||||
+Options
|
||||
+
|
||||
+-u user
|
||||
+ run command as user. The default is to run as root.
|
||||
+--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.
|
||||
+
|
||||
+See Also
|
||||
+
|
||||
+su(1)
|
||||
+
|
||||
+Examples
|
||||
+
|
||||
+xdg-su -u root -c "/opt/shinythings/bin/install-GUI --install fast"
|
||||
+
|
||||
+Runs the /opt/shinythings/bin/install-GUI command with root permissions.
|
||||
+
|
||||
+_MANUALPAGE
|
||||
+}
|
||||
+
|
||||
+usage()
|
||||
+{
|
||||
+cat << _USAGE
|
||||
+xdg-su - run a GUI program as root after prompting for the root password
|
||||
+
|
||||
+Synopsis
|
||||
+
|
||||
+xdg-su [-u user] -c command
|
||||
+
|
||||
+xdg-su { --help | --manual | --version }
|
||||
+
|
||||
+_USAGE
|
||||
+}
|
||||
+
|
||||
+#@xdg-utils-common@
|
||||
+
|
||||
+#----------------------------------------------------------------------------
|
||||
+# Common utility functions included in all XDG wrapper scripts
|
||||
+#----------------------------------------------------------------------------
|
||||
+
|
||||
+DEBUG()
|
||||
+{
|
||||
+ [ ${XDG_UTILS_DEBUG_LEVEL-0} -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-su: $@" >&2
|
||||
+ echo "Try 'xdg-su --help' for more information." >&2
|
||||
+ else
|
||||
+ usage
|
||||
+ echo "Use 'man xdg-su' or 'xdg-su --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-su: $@" >&2
|
||||
+ fi
|
||||
+
|
||||
+ exit 2
|
||||
+}
|
||||
+
|
||||
+#-------------------------------------------------------------
|
||||
+# Exit script on failure to locate necessary tool applications
|
||||
+
|
||||
+exit_failure_operation_impossible()
|
||||
+{
|
||||
+ if [ $# -gt 0 ]; then
|
||||
+ echo "xdg-su: $@" >&2
|
||||
+ fi
|
||||
+
|
||||
+ exit 3
|
||||
+}
|
||||
+
|
||||
+#-------------------------------------------------------------
|
||||
+# Exit script on failure returned by a tool application
|
||||
+
|
||||
+exit_failure_operation_failed()
|
||||
+{
|
||||
+ if [ $# -gt 0 ]; then
|
||||
+ echo "xdg-su: $@" >&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-su: $@" >&2
|
||||
+ fi
|
||||
+
|
||||
+ exit 5
|
||||
+}
|
||||
+
|
||||
+#------------------------------------------------------------
|
||||
+# Exit script on insufficient permission to read a specified file
|
||||
+
|
||||
+exit_failure_file_permission_write()
|
||||
+{
|
||||
+ if [ $# -gt 0 ]; then
|
||||
+ echo "xdg-su: $@" >&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=`basename "$1"`
|
||||
+ case "$file" in
|
||||
+ [a-zA-Z]*-*)
|
||||
+ return
|
||||
+ ;;
|
||||
+ esac
|
||||
+
|
||||
+ echo "xdg-su: filename '$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 filename is '"'example-$file'" >&2
|
||||
+ echo "Use --novendor to override or 'xdg-su --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-su' or 'xdg-su --manual' for additional info."
|
||||
+ exit_success
|
||||
+ ;;
|
||||
+
|
||||
+ --manual)
|
||||
+ manualpage
|
||||
+ exit_success
|
||||
+ ;;
|
||||
+
|
||||
+ --version)
|
||||
+ echo "xdg-su 1.0beta2"
|
||||
+ exit_success
|
||||
+ ;;
|
||||
+ esac
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
+check_common_commands "$@"
|
||||
+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 xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+#----------------------------------------------------------------------------
|
||||
+
|
||||
+
|
||||
+
|
||||
+su_kde()
|
||||
+{
|
||||
+ KDESU=`which kdesu 2>/dev/null`
|
||||
+ if [ $? -eq 0 ] ; then
|
||||
+ if [ -z "$user" ] ; then
|
||||
+ $KDESU -c "$cmd"
|
||||
+ else
|
||||
+ $KDESU -u "$user" -c "$cmd"
|
||||
+ fi
|
||||
+
|
||||
+ if [ $? -eq 0 ]; then
|
||||
+ exit_success
|
||||
+ else
|
||||
+ exit_failure_operation_failed
|
||||
+ fi
|
||||
+ else
|
||||
+ su_generic
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+su_gnome()
|
||||
+{
|
||||
+ GSU=`which gnomesu 2>/dev/null`
|
||||
+ if [ $? -ne 0 ] ; then
|
||||
+ GSU=`which xsu 2>/dev/null`
|
||||
+ fi
|
||||
+ if [ $? -eq 0 ] ; then
|
||||
+ if [ -z "$user" ] ; then
|
||||
+ $GSU -c "$cmd"
|
||||
+ else
|
||||
+ $GSU -u "$user" -c "$cmd"
|
||||
+ fi
|
||||
+
|
||||
+ if [ $? -eq 0 ]; then
|
||||
+ exit_success
|
||||
+ else
|
||||
+ exit_failure_operation_failed
|
||||
+ fi
|
||||
+ else
|
||||
+ su_generic
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+su_generic()
|
||||
+{
|
||||
+ if [ -z "$user" ] ; then
|
||||
+ xterm -geom 60x5 -T "xdg-su: $cmd" -e su -c "$cmd"
|
||||
+ else
|
||||
+ xterm -geom 60x5 -T "xdg-su: $cmd" -e su -u "$user" -c "$cmd"
|
||||
+ fi
|
||||
+
|
||||
+ if [ $? -eq 0 ]; then
|
||||
+ exit_success
|
||||
+ else
|
||||
+ exit_failure_operation_failed
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+[ x"$1" != x"" ] || exit_failure_syntax
|
||||
+
|
||||
+user=
|
||||
+cmd=
|
||||
+while [ $# -gt 0 ] ; do
|
||||
+ parm="$1"
|
||||
+ shift
|
||||
+
|
||||
+ case "$parm" in
|
||||
+ -u)
|
||||
+ if [ -z "$1" ] ; then
|
||||
+ exit_failure_syntax "user argument missing for -u"
|
||||
+ fi
|
||||
+ user="$1"
|
||||
+ shift
|
||||
+ ;;
|
||||
+
|
||||
+ -c)
|
||||
+ if [ -z "$1" ] ; then
|
||||
+ exit_failure_syntax "command argument missing for -c"
|
||||
+ fi
|
||||
+ cmd="$1"
|
||||
+ shift
|
||||
+ ;;
|
||||
+
|
||||
+ -*)
|
||||
+ exit_failure_syntax "unexpected option '$parm'"
|
||||
+ ;;
|
||||
+
|
||||
+ *)
|
||||
+ exit_failure_syntax "unexpected argument '$parm'"
|
||||
+ ;;
|
||||
+ esac
|
||||
+done
|
||||
+
|
||||
+if [ -z "${cmd}" ] ; then
|
||||
+ exit_failure_syntax "command missing"
|
||||
+fi
|
||||
+
|
||||
+detectDE
|
||||
+
|
||||
+if [ x"$DE" = x"" ]; then
|
||||
+ which xterm 2>/dev/null >&2
|
||||
+ if [ $? -eq 0 -a -n "$DISPLAY" ] ; then
|
||||
+ DE=generic
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+case "$DE" in
|
||||
+ kde)
|
||||
+ su_kde
|
||||
+ ;;
|
||||
+
|
||||
+ gnome)
|
||||
+ su_gnome
|
||||
+ ;;
|
||||
+
|
||||
+ generic)
|
||||
+ su_generic
|
||||
+ ;;
|
||||
+
|
||||
+ *)
|
||||
+ [ x"$user" = x"" ] && user=root
|
||||
+ exit_failure_operation_impossible "no graphical method available for invoking '$cmd' as '$user'"
|
||||
+ ;;
|
||||
+esac
|
484
xdg-terminal
484
xdg-terminal
@ -1,484 +0,0 @@
|
||||
#!/bin/sh
|
||||
#---------------------------------------------
|
||||
# xdg-terminal
|
||||
#
|
||||
# Utility script to open the registered terminal emulator
|
||||
#
|
||||
# Refer to the usage() function below for usage.
|
||||
#
|
||||
# Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>
|
||||
# Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>
|
||||
# Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
|
||||
#
|
||||
# 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-terminal - opens the user's preferred terminal emulator application
|
||||
|
||||
Synopsis
|
||||
|
||||
xdg-terminal [command]
|
||||
|
||||
xdg-terminal { --help | --manual | --version }
|
||||
|
||||
Description
|
||||
|
||||
xdg-terminal opens the user's preferred terminal emulator application. If a
|
||||
command is provided the command will be executed by the shell within the newly
|
||||
opened terminal window.
|
||||
|
||||
xdg-terminal is for use inside a desktop session only. It is not recommended to
|
||||
use xdg-terminal 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.
|
||||
3
|
||||
A required tool could not be found.
|
||||
4
|
||||
The action failed.
|
||||
|
||||
Examples
|
||||
|
||||
xdg-terminal
|
||||
|
||||
Opens the user's default terminal emulator, just starting an interactive shell.
|
||||
|
||||
xdg-terminal top
|
||||
|
||||
Opens the user's default terminal emulator and lets it run the top executable.
|
||||
|
||||
_MANUALPAGE
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
cat << _USAGE
|
||||
xdg-terminal - opens the user's preferred terminal emulator application
|
||||
|
||||
Synopsis
|
||||
|
||||
xdg-terminal [command]
|
||||
|
||||
xdg-terminal { --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-terminal: $@" >&2
|
||||
echo "Try 'xdg-terminal --help' for more information." >&2
|
||||
else
|
||||
usage
|
||||
echo "Use 'man xdg-terminal' or 'xdg-terminal --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-terminal: $@" >&2
|
||||
fi
|
||||
|
||||
exit 2
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# Exit script on failure to locate necessary tool applications
|
||||
|
||||
exit_failure_operation_impossible()
|
||||
{
|
||||
if [ $# -gt 0 ]; then
|
||||
echo "xdg-terminal: $@" >&2
|
||||
fi
|
||||
|
||||
exit 3
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# Exit script on failure returned by a tool application
|
||||
|
||||
exit_failure_operation_failed()
|
||||
{
|
||||
if [ $# -gt 0 ]; then
|
||||
echo "xdg-terminal: $@" >&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-terminal: $@" >&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-terminal: $@" >&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-terminal: $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-terminal --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-terminal' or 'xdg-terminal --manual' for additional info."
|
||||
exit_success
|
||||
;;
|
||||
|
||||
--manual)
|
||||
manualpage
|
||||
exit_success
|
||||
;;
|
||||
|
||||
--version)
|
||||
echo "xdg-terminal 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
|
||||
}
|
||||
|
||||
terminal_kde()
|
||||
{
|
||||
terminal=`kreadconfig --file kdeglobals --group General --key TerminalApplication --default konsole`
|
||||
|
||||
terminal_exec=`which $terminal 2>/dev/null`
|
||||
|
||||
if [ -x "$terminal_exec" ]; then
|
||||
if [ x"$1" == x"" ]; then
|
||||
$terminal_exec
|
||||
else
|
||||
$terminal_exec -e "$1"
|
||||
fi
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
exit_success
|
||||
else
|
||||
exit_failure_operation_failed
|
||||
fi
|
||||
else
|
||||
exit_failure_operation_impossible "configured terminal program '$terminal' not found or not executable"
|
||||
fi
|
||||
}
|
||||
|
||||
terminal_gnome()
|
||||
{
|
||||
term_exec_key="/desktop/gnome/applications/terminal/exec"
|
||||
term_exec_arg_key="/desktop/gnome/applications/terminal/exec_arg"
|
||||
|
||||
term_exec=`gconftool-2 --get ${term_exec_key}`
|
||||
term_exec_arg=`gconftool-2 --get ${term_exec_arg_key}`
|
||||
|
||||
terminal_exec=`which $term_exec 2>/dev/null`
|
||||
|
||||
if [ -x "$terminal_exec" ]; then
|
||||
if [ x"$1" == x"" ]; then
|
||||
$terminal_exec
|
||||
else
|
||||
if [ x"$term_exec_arg" == x"" ]; then
|
||||
$terminal_exec "$1"
|
||||
else
|
||||
$terminal_exec "$term_exec_arg" "$1"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
exit_success
|
||||
else
|
||||
exit_failure_operation_failed
|
||||
fi
|
||||
else
|
||||
exit_failure_operation_impossible "configured terminal program '$term_exec' not found or not executable"
|
||||
fi
|
||||
}
|
||||
|
||||
terminal_xfce()
|
||||
{
|
||||
if [ x"$1" == x"" ]; then
|
||||
exo-open --launch TerminalEmulator
|
||||
else
|
||||
exo-open --launch TerminalEmulator "$1"
|
||||
fi
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
exit_success
|
||||
else
|
||||
exit_failure_operation_failed
|
||||
fi
|
||||
}
|
||||
|
||||
terminal_generic()
|
||||
{
|
||||
# if $TERM is not set, try xterm
|
||||
if [ x"$TERM" == x"" ]; then
|
||||
TERM=xterm
|
||||
fi
|
||||
|
||||
terminal_exec=`which $TERM >/dev/null 2>/dev/null`
|
||||
|
||||
if [ -x "$terminal_exec" ]; then
|
||||
if [ $? -eq 0 ]; then
|
||||
exit_success
|
||||
else
|
||||
exit_failure_operation_failed
|
||||
fi
|
||||
else
|
||||
exit_failure_operation_impossible "configured terminal program '$TERM' not found or not executable"
|
||||
fi
|
||||
}
|
||||
|
||||
terminal_lxde()
|
||||
{
|
||||
if which lxterminal &>/dev/null; then
|
||||
if [ x"$1" == x"" ]; then
|
||||
lxterminal
|
||||
else
|
||||
lxterminal -e "$1"
|
||||
fi
|
||||
else
|
||||
terminal_generic "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
#[ x"$1" != x"" ] || exit_failure_syntax
|
||||
|
||||
command=
|
||||
while [ $# -gt 0 ] ; do
|
||||
parm="$1"
|
||||
shift
|
||||
|
||||
case "$parm" in
|
||||
-*)
|
||||
exit_failure_syntax "unexpected option '$parm'"
|
||||
;;
|
||||
|
||||
*)
|
||||
if [ -n "$command" ] ; then
|
||||
exit_failure_syntax "unexpected argument '$parm'"
|
||||
fi
|
||||
command="$parm"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
detectDE
|
||||
|
||||
if [ x"$DE" = x"" ]; then
|
||||
# if TERM variable is not set, try xterm
|
||||
if [ x"$TERM" = x"" ]; then
|
||||
TERM=xterm
|
||||
fi
|
||||
DE=generic
|
||||
fi
|
||||
|
||||
case "$DE" in
|
||||
kde)
|
||||
terminal_kde "$command"
|
||||
;;
|
||||
|
||||
gnome)
|
||||
terminal_gnome "$command"
|
||||
;;
|
||||
|
||||
xfce)
|
||||
terminal_xfce "$command"
|
||||
;;
|
||||
|
||||
lxde)
|
||||
terminal_lxde "$command"
|
||||
;;
|
||||
|
||||
generic)
|
||||
terminal_generic "$command"
|
||||
;;
|
||||
|
||||
*)
|
||||
exit_failure_operation_impossible "no terminal emulator available"
|
||||
;;
|
||||
esac
|
@ -1,43 +0,0 @@
|
||||
diff -uNr old-xdg-utils-1.0.2//scripts/xdg-email xdg-utils-1.0.2/scripts/xdg-email
|
||||
--- old-xdg-utils-1.0.2//scripts/xdg-email 2010-04-02 16:58:27.281598288 +0200
|
||||
+++ xdg-utils-1.0.2/scripts/xdg-email 2010-04-02 17:00:27.931347778 +0200
|
||||
@@ -617,11 +617,12 @@
|
||||
detectDE
|
||||
|
||||
if [ x"$DE" = x"" ]; then
|
||||
- # if BROWSER variable is not set, check some well known browsers instead
|
||||
- if [ x"$BROWSER" = x"" ]; then
|
||||
- BROWSER=firefox:mozilla:netscape
|
||||
- fi
|
||||
- DE=generic
|
||||
+ DE=generic
|
||||
+fi
|
||||
+
|
||||
+# if BROWSER variable is not set, check some well known browsers instead
|
||||
+if [ x"$BROWSER" = x"" ]; then
|
||||
+ BROWSER=firefox:mozilla:netscape
|
||||
fi
|
||||
|
||||
case "$DE" in
|
||||
diff -uNr old-xdg-utils-1.0.2//scripts/xdg-open xdg-utils-1.0.2/scripts/xdg-open
|
||||
--- old-xdg-utils-1.0.2//scripts/xdg-open 2010-04-02 16:58:27.290596083 +0200
|
||||
+++ xdg-utils-1.0.2/scripts/xdg-open 2010-04-02 16:59:40.015352868 +0200
|
||||
@@ -408,13 +408,14 @@
|
||||
detectDE
|
||||
|
||||
if [ x"$DE" = x"" ]; then
|
||||
- # if BROWSER variable is not set, check some well known browsers instead
|
||||
- if [ x"$BROWSER" = x"" ]; then
|
||||
- BROWSER=firefox:mozilla:netscape
|
||||
- fi
|
||||
DE=generic
|
||||
fi
|
||||
|
||||
+# if BROWSER variable is not set, check some well known browsers instead
|
||||
+if [ x"$BROWSER" = x"" ]; then
|
||||
+ BROWSER=firefox:mozilla:netscape
|
||||
+fi
|
||||
+
|
||||
case "$DE" in
|
||||
kde)
|
||||
open_kde "$url"
|
@ -1,138 +0,0 @@
|
||||
diff -uNr xdg-utils-1.0.2/scripts/xdg-desktop-icon newxdg-utils-1.0.2//scripts/xdg-desktop-icon
|
||||
--- xdg-utils-1.0.2/scripts/xdg-desktop-icon 2007-06-24 21:57:55.000000000 +0200
|
||||
+++ newxdg-utils-1.0.2//scripts/xdg-desktop-icon 2010-01-15 09:43:28.426802335 +0100
|
||||
@@ -405,6 +405,7 @@
|
||||
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
|
||||
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
|
||||
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
|
||||
+ elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
|
||||
fi
|
||||
}
|
||||
|
||||
diff -uNr xdg-utils-1.0.2/scripts/xdg-desktop-menu newxdg-utils-1.0.2//scripts/xdg-desktop-menu
|
||||
--- xdg-utils-1.0.2/scripts/xdg-desktop-menu 2007-06-24 21:57:53.000000000 +0200
|
||||
+++ newxdg-utils-1.0.2//scripts/xdg-desktop-menu 2010-01-15 09:43:50.089551069 +0100
|
||||
@@ -601,6 +601,7 @@
|
||||
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
|
||||
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
|
||||
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
|
||||
+ elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
|
||||
fi
|
||||
}
|
||||
|
||||
diff -uNr xdg-utils-1.0.2/scripts/xdg-email newxdg-utils-1.0.2//scripts/xdg-email
|
||||
--- xdg-utils-1.0.2/scripts/xdg-email 2010-01-15 09:48:49.339576494 +0100
|
||||
+++ newxdg-utils-1.0.2//scripts/xdg-email 2010-01-15 09:45:06.868551938 +0100
|
||||
@@ -357,6 +357,7 @@
|
||||
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
|
||||
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
|
||||
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
|
||||
+ elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -636,6 +637,10 @@
|
||||
open_xfce "${mailto}"
|
||||
;;
|
||||
|
||||
+ lxde)
|
||||
+ open_generic "${mailto}"
|
||||
+ ;;
|
||||
+
|
||||
generic)
|
||||
open_generic "${mailto}"
|
||||
;;
|
||||
diff -uNr xdg-utils-1.0.2/scripts/xdg-icon-resource newxdg-utils-1.0.2//scripts/xdg-icon-resource
|
||||
--- xdg-utils-1.0.2/scripts/xdg-icon-resource 2007-06-24 21:57:59.000000000 +0200
|
||||
+++ newxdg-utils-1.0.2//scripts/xdg-icon-resource 2010-01-15 09:41:58.299551265 +0100
|
||||
@@ -397,6 +397,7 @@
|
||||
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
|
||||
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
|
||||
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
|
||||
+ elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
|
||||
fi
|
||||
}
|
||||
|
||||
diff -uNr xdg-utils-1.0.2/scripts/xdg-mime newxdg-utils-1.0.2//scripts/xdg-mime
|
||||
--- xdg-utils-1.0.2/scripts/xdg-mime 2010-01-15 09:48:49.340574736 +0100
|
||||
+++ newxdg-utils-1.0.2//scripts/xdg-mime 2010-01-15 09:45:30.882550232 +0100
|
||||
@@ -426,6 +426,7 @@
|
||||
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
|
||||
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
|
||||
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
|
||||
+ elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
|
||||
fi
|
||||
}
|
||||
|
||||
diff -uNr xdg-utils-1.0.2/scripts/xdg-open newxdg-utils-1.0.2//scripts/xdg-open
|
||||
--- xdg-utils-1.0.2/scripts/xdg-open 2010-01-15 09:48:42.104831802 +0100
|
||||
+++ newxdg-utils-1.0.2//scripts/xdg-open 2010-01-15 09:46:51.860550227 +0100
|
||||
@@ -304,6 +304,7 @@
|
||||
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
|
||||
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
|
||||
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
|
||||
+ elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -427,6 +428,10 @@
|
||||
open_xfce "$url"
|
||||
;;
|
||||
|
||||
+ lxde)
|
||||
+ open_generic "$url"
|
||||
+ ;;
|
||||
+
|
||||
generic)
|
||||
open_generic "$url"
|
||||
;;
|
||||
diff -uNr xdg-utils-1.0.2/scripts/xdg-screensaver newxdg-utils-1.0.2//scripts/xdg-screensaver
|
||||
--- xdg-utils-1.0.2/scripts/xdg-screensaver 2007-06-24 21:58:06.000000000 +0200
|
||||
+++ newxdg-utils-1.0.2//scripts/xdg-screensaver 2010-01-15 09:47:04.734550060 +0100
|
||||
@@ -334,6 +334,7 @@
|
||||
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
|
||||
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
|
||||
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
|
||||
+ elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
|
||||
fi
|
||||
}
|
||||
|
||||
diff -uNr xdg-utils-1.0.2/scripts/xdg-su newxdg-utils-1.0.2//scripts/xdg-su
|
||||
--- xdg-utils-1.0.2/scripts/xdg-su 2010-01-15 09:50:47.725800172 +0100
|
||||
+++ newxdg-utils-1.0.2//scripts/xdg-su 2010-01-15 09:26:22.031552239 +0100
|
||||
@@ -301,6 +301,7 @@
|
||||
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
|
||||
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
|
||||
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
|
||||
+ elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -376,6 +377,15 @@
|
||||
fi
|
||||
}
|
||||
|
||||
+su_lxde()
|
||||
+{
|
||||
+ if which gnomesu &>/dev/null ; then
|
||||
+ su_gnome
|
||||
+ else
|
||||
+ su_generic
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
[ x"$1" != x"" ] || exit_failure_syntax
|
||||
|
||||
user=
|
||||
@@ -441,6 +451,10 @@
|
||||
su_xfce
|
||||
;;
|
||||
|
||||
+ lxde)
|
||||
+ su_lxde
|
||||
+ ;;
|
||||
+
|
||||
*)
|
||||
[ x"$user" = x"" ] && user=root
|
||||
exit_failure_operation_impossible "no graphical method available for invoking '$cmd' as '$user'"
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d018571df357c9d41eea1cd60ee85b464d505c9606d4c1055016979c0b4cf5e0
|
||||
size 267214
|
3
xdg-utils-20120310.tar.xz
Normal file
3
xdg-utils-20120310.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:974f500adc492db1a45f647c4ca44ee9e5d315376b74521c1fd7a82b9f79ca6b
|
||||
size 271840
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 29 00:27:04 CEST 2012 - jslaby@suse.de
|
||||
|
||||
- update to snapshot from 20120310
|
||||
* many local patches are gone, since they were merged
|
||||
* fixes many issues (see bnc#749612, bnc#703396, bnc#752977)
|
||||
* see ChangeLog for updates
|
||||
- clean the specfile a bit
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 21 10:16:02 UTC 2012 - vargusz@fazekas.hu
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package xdg-utils
|
||||
#
|
||||
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -15,36 +15,29 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
|
||||
Name: xdg-utils
|
||||
BuildRequires: make
|
||||
BuildRequires: xmlto
|
||||
BuildRequires: xz
|
||||
# for xmlto to be able to generate text from html
|
||||
BuildRequires: w3m
|
||||
Summary: Utilities to uniformly interface desktop environments
|
||||
License: MIT
|
||||
Group: System/GUI/Other
|
||||
Summary: Utilities to uniformly interface desktop environments
|
||||
Version: 1.0.2
|
||||
Release: 96
|
||||
Version: 20120310
|
||||
Release: 0
|
||||
BuildArch: noarch
|
||||
Url: http://portland.freedesktop.org/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
# http://portland.freedesktop.org/download/xdg-utils-%{version}.tgz
|
||||
Source0: xdg-utils-%{version}.tar.bz2
|
||||
Source1: http://cgit.freedesktop.org/xdg/xdg-utils/plain/scripts/xdg-terminal
|
||||
Patch0: xdg-su.diff
|
||||
# http://portland.freedesktop.org/download/xdg-utils-%%{version}.tgz
|
||||
Source0: xdg-utils-%{version}.tar.xz
|
||||
Patch0: install-some-more-scripts.diff
|
||||
Patch1: xfce-su.diff
|
||||
Patch2: CVE-2008-0386.diff
|
||||
Patch3: xdg-kde4-upstream.patch
|
||||
# PATCH-FEATURE-UPSTREAM xdg-utils-1.0.2-lxde-support.patch fdo#26058 andrea@opensuse.org
|
||||
# this patch add lxde support to xdg-su and other scripts
|
||||
Patch4: %name-1.0.2-lxde-support.patch
|
||||
# PATCH-FIX-UPSTREAM xdg-utils-1.0.2-bnc591714.patch fdo#27551 andrea@opensuse.org
|
||||
# this patch fix bnc#591714
|
||||
Patch5: %name-1.0.2-bnc591714.patch
|
||||
Patch6: xdg-screensaver-sleep.diff
|
||||
Patch7: xdg-screensaver-gnome-dbus.diff
|
||||
Patch8: xdg-screensaver-gnome-perl.diff
|
||||
Requires: perl, perl-Net-DBus, perl-X11-Protocol
|
||||
Requires: perl
|
||||
Requires: perl-Net-DBus
|
||||
Requires: perl-X11-Protocol
|
||||
|
||||
%description
|
||||
The xdg-utils package is a set of simple scripts that provide basic
|
||||
@ -65,52 +58,41 @@ these utilities work properly in their environment.
|
||||
|
||||
%prep
|
||||
%setup -q -n %name-%{version}
|
||||
%patch0
|
||||
%patch1
|
||||
%patch2
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6
|
||||
%patch7
|
||||
%patch8
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch8 -p1
|
||||
|
||||
%build
|
||||
%configure
|
||||
(cd scripts; make scripts)
|
||||
make %{?_smp_flags}
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
%__install -D -m0755 "%{SOURCE1}" "%{buildroot}%{_bindir}/xdg-terminal"
|
||||
|
||||
%clean
|
||||
%{?buildroot:%__rm -rf "%{buildroot}"}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc LICENSE README TODO ChangeLog
|
||||
%{_bindir}/xdg-desktop-icon
|
||||
%{_bindir}/xdg-desktop-menu
|
||||
%{_bindir}/xdg-email
|
||||
%{_bindir}/xdg-icon-resource
|
||||
%{_bindir}/xdg-mime
|
||||
%{_bindir}/xdg-open
|
||||
%{_bindir}/xdg-su
|
||||
%{_bindir}/xdg-screensaver
|
||||
%{_bindir}/xdg-settings
|
||||
%{_bindir}/xdg-terminal
|
||||
#/usr/bin/xdg-copy
|
||||
/usr/bin/xdg-desktop-icon
|
||||
/usr/bin/xdg-desktop-menu
|
||||
/usr/bin/xdg-email
|
||||
/usr/bin/xdg-icon-resource
|
||||
#/usr/bin/xdg-menu
|
||||
/usr/bin/xdg-mime
|
||||
/usr/bin/xdg-open
|
||||
/usr/bin/xdg-su
|
||||
/usr/bin/xdg-screensaver
|
||||
#%{_mandir}/man1/xdg-copy.1*
|
||||
#%{_mandir}/man1/xdg-desktop.1*
|
||||
%{_mandir}/man1/xdg-desktop-icon.1*
|
||||
%{_mandir}/man1/xdg-desktop-menu.1*
|
||||
%{_mandir}/man1/xdg-email.1*
|
||||
%{_mandir}/man1/xdg-icon-resource.1*
|
||||
#%{_mandir}/man1/xdg-menu.1*
|
||||
%{_mandir}/man1/xdg-mime.1*
|
||||
%{_mandir}/man1/xdg-open.1*
|
||||
%{_mandir}/man1/xdg-su.1*
|
||||
%{_mandir}/man1/xdg-screensaver.1*
|
||||
%{_mandir}/man1/xdg-settings.1*
|
||||
|
||||
%changelog
|
||||
|
12
xfce-su.diff
12
xfce-su.diff
@ -1,6 +1,10 @@
|
||||
--- scripts/xdg-su
|
||||
+++ scripts/xdg-su
|
||||
@@ -366,6 +366,16 @@
|
||||
---
|
||||
scripts/xdg-su.in | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
--- a/scripts/xdg-su.in
|
||||
+++ b/scripts/xdg-su.in
|
||||
@@ -93,6 +93,16 @@ su_generic()
|
||||
fi
|
||||
}
|
||||
|
||||
@ -17,7 +21,7 @@
|
||||
[ x"$1" != x"" ] || exit_failure_syntax
|
||||
|
||||
user=
|
||||
@@ -427,6 +437,10 @@
|
||||
@@ -154,6 +164,10 @@ case "$DE" in
|
||||
su_generic
|
||||
;;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user