Commit ef6bda28 authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Update 'xdg-utils' scripts to version 1.1.3+.

[GB.DESKTOP]
* NEW: Update 'xdg-utils' scripts to version 1.1.3+.
parent a2a04eeb
Pipeline #349819735 passed with stage
in 26 minutes and 49 seconds
......@@ -479,7 +479,7 @@ check_common_commands()
;;
--version)
echo "xdg-desktop-icon 1.1.3"
echo "xdg-desktop-icon 1.1.3+"
exit_success
;;
esac
......@@ -522,9 +522,8 @@ detectDE()
KDE)
DE=kde;
;;
# Deepin Desktop Environments
DEEPIN|Deepin|deepin)
DE=dde;
DE=deepin;
;;
LXDE)
DE=lxde;
......
......@@ -698,7 +698,7 @@ check_common_commands()
;;
--version)
echo "xdg-desktop-menu 1.1.3"
echo "xdg-desktop-menu 1.1.3+"
exit_success
;;
esac
......@@ -741,9 +741,8 @@ detectDE()
KDE)
DE=kde;
;;
# Deepin Desktop Environments
DEEPIN|Deepin|deepin)
DE=dde;
DE=deepin;
;;
LXDE)
DE=lxde;
......
......@@ -425,7 +425,7 @@ check_common_commands()
;;
--version)
echo "xdg-email 1.1.3"
echo "xdg-email 1.1.3+"
exit_success
;;
esac
......@@ -468,9 +468,8 @@ detectDE()
KDE)
DE=kde;
;;
# Deepin Desktop Environments
DEEPIN|Deepin|deepin)
DE=dde;
DE=deepin;
;;
LXDE)
DE=lxde;
......@@ -1015,7 +1014,7 @@ case "$DE" in
open_gnome "${mailto}"
;;
gnome3|cinnamon|lxde|mate)
gnome3|cinnamon|lxde|mate|deepin)
open_gnome3 "${mailto}"
;;
......
......@@ -483,7 +483,7 @@ check_common_commands()
;;
--version)
echo "xdg-icon-resource 1.1.3"
echo "xdg-icon-resource 1.1.3+"
exit_success
;;
esac
......@@ -526,9 +526,8 @@ detectDE()
KDE)
DE=kde;
;;
# Deepin Desktop Environments
DEEPIN|Deepin|deepin)
DE=dde;
DE=deepin;
;;
LXDE)
DE=lxde;
......
......@@ -503,7 +503,7 @@ check_common_commands()
;;
--version)
echo "xdg-mime 1.1.3"
echo "xdg-mime 1.1.3+"
exit_success
;;
esac
......@@ -546,9 +546,8 @@ detectDE()
KDE)
DE=kde;
;;
# Deepin Desktop Environments
DEEPIN|Deepin|deepin)
DE=dde;
DE=deepin;
;;
LXDE)
DE=lxde;
......@@ -705,6 +704,8 @@ info_gnome()
elif gnomevfs-info --help 2>/dev/null 1>&2; then
DEBUG 1 "Running gnomevfs-info \"$1\""
gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "//
else
exit_failure_operation_impossible "no method available for querying MIME type of '$filename'"
fi
if [ $? -eq 0 ]; then
......@@ -926,7 +927,7 @@ search_desktop_file()
grep -l "$MIME;" "$dir/"*.desktop 2>/dev/null
for f in $dir/*/; do
for f in "$dir/"*/; do
[ -d "$f" ] && search_desktop_file "$MIME" "$f"
done
}
......
......@@ -7,7 +7,7 @@
# 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 2009-2016, Rex Dieter <rdieter@fedoraproject.org>
# Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
# Copyright 2006, Jeremy White <jwhite@codeweavers.com>
#
......@@ -369,7 +369,7 @@ check_common_commands()
;;
--version)
echo "xdg-open 1.1.3"
echo "xdg-open 1.1.3+"
exit_success
;;
esac
......@@ -412,9 +412,8 @@ detectDE()
KDE)
DE=kde;
;;
# Deepin Desktop Environments
DEEPIN|Deepin|deepin)
DE=dde;
DE=deepin;
;;
LXDE)
DE=lxde;
......@@ -560,7 +559,7 @@ get_key()
is_file_url_or_path()
{
if echo "$1" | grep -q '^file://' \
|| ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'; then
|| ! echo "$1" | egrep -q '^[[:alpha:]][[:alpha:][:digit:]+\.\-]*:'; then
return 0
else
return 1
......@@ -572,7 +571,8 @@ is_file_url_or_path()
file_url_to_path()
{
local file="$1"
if echo "$file" | grep -q '^file:///'; then
if echo "$file" | grep -q '^file://\(localhost\)\?/'; then
file=${file#file://localhost}
file=${file#file://}
file=${file%%#*}
file=$(echo "$file" | sed -r 's/\?.*$//')
......@@ -630,7 +630,7 @@ open_kde()
fi
}
open_dde()
open_deepin()
{
if dde-open -version >/dev/null 2>&1; then
dde-open "$1"
......@@ -815,7 +815,7 @@ search_desktop_file()
fi
fi
for d in $dir/*/; do
for d in "$dir/"*/; do
[ -d "$d" ] && search_desktop_file "$default" "$d" "$target"
done
}
......@@ -939,7 +939,7 @@ open_lxde()
{
# pcmanfm only knows how to handle file:// urls and filepaths, it seems.
if pcmanfm --help >/dev/null 2>&1 -a is_file_url_or_path "$1"; then
if pcmanfm --help >/dev/null 2>&1 && is_file_url_or_path "$1"; then
local file="$(file_url_to_path "$1")"
# handle relative paths
......@@ -997,7 +997,7 @@ fi
DEBUG 2 "Selected DE $DE"
# sanitize BROWSER (avoid caling ourselves in particular)
# sanitize BROWSER (avoid calling ourselves in particular)
case "${BROWSER}" in
*:"xdg-open"|"xdg-open":*)
BROWSER=$(echo $BROWSER | sed -e 's|:xdg-open||g' -e 's|xdg-open:||g')
......@@ -1012,8 +1012,8 @@ case "$DE" in
open_kde "$url"
;;
dde)
open_dde "$url"
deepin)
open_deepin "$url"
;;
gnome3|cinnamon)
......
......@@ -397,7 +397,7 @@ check_common_commands()
;;
--version)
echo "xdg-screensaver 1.1.3"
echo "xdg-screensaver 1.1.3+"
exit_success
;;
esac
......@@ -440,9 +440,8 @@ detectDE()
KDE)
DE=kde;
;;
# Deepin Desktop Environments
DEEPIN|Deepin|deepin)
DE=dde;
DE=deepin;
;;
LXDE)
DE=lxde;
......@@ -987,6 +986,7 @@ screensaver_gnome_screensaver()
perl -e '
use strict;
use warnings;
use Encode qw(decode);
use IO::File;
use Net::DBus;
use X11::Protocol;
......@@ -1008,6 +1008,10 @@ while (1) {
}
}
# Replace any invalid unicode characters with U+FFFD, so we dont crash when we
# pass them over to D-Bus
$window_name = decode("utf8", $window_name, Encode::FB_DEFAULT);
# Inhibit idle detection (flags = 8) with window name and ID.
# We have no reason so just send the window name again.
my $bus = Net::DBus->session();
......@@ -1406,6 +1410,8 @@ xscreensaver-command -version 2> /dev/null | grep XScreenSaver > /dev/null && DE
dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.ScreenSaver > /dev/null 2>&1 && DE="gnome_screensaver"
# Consider "mate-screensaver" a separate DE
dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.mate.ScreenSaver > /dev/null 2>&1 && DE="mate_screensaver"
# Consider "cinnamon-screensaver" a separate DE
dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.cinnamon.ScreenSaver > /dev/null 2>&1 && DE="cinnamon"
# Consider "xautolock" a separate DE
xautolock -enable > /dev/null 2>&1 && DE="xautolock_screensaver"
......
......@@ -391,7 +391,7 @@ check_common_commands()
;;
--version)
echo "xdg-settings 1.1.3"
echo "xdg-settings 1.1.3+"
exit_success
;;
esac
......@@ -434,9 +434,8 @@ detectDE()
KDE)
DE=kde;
;;
# Deepin Desktop Environments
DEEPIN|Deepin|deepin)
DE=dde;
DE=deepin;
;;
LXDE)
DE=lxde;
......@@ -643,7 +642,7 @@ set_browser_mime()
fix_local_desktop_file "$1" "$MIME" || return
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/applications"
xdg-mime default "$1" "$MIME" || return
if [ x"`get_browser_mime`" != x"$1" ]; then
if [ x"`get_browser_mime $MIME`" != x"$1" ]; then
# Put back the original value
xdg-mime default "$orig" "$MIME"
exit_failure_operation_failed
......@@ -716,7 +715,13 @@ resolve_kde_browser_desktop()
read_kde_browser()
{
read_kde_config kdeglobals General BrowserApplication
ret=`read_kde_config kdeglobals General BrowserApplication`
if [ -z "$ret" ]; then
# since Plasma >= 5.19
ret=`get_browser_mime "x-scheme-handler/http"`
fi
echo $ret
}
get_browser_kde()
......@@ -765,7 +770,13 @@ check_browser_kde()
set_browser_kde()
{
set_browser_mime "$1" || return
# Set the default browser.
for protocol in http https; do
set_browser_mime "$1" "x-scheme-handler/$protocol" || return
done
# Plasma < 5.19
set_browser_mime "$1" "text/html" || return
if [ x"${KDE_SESSION_VERSION}" = x"5" ]; then
kwriteconfig5 --file kdeglobals --group General --key BrowserApplication "$1"
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment