From 8abe281da3947541b3388940000bcb934c2c25be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E5=8D=9A=E6=96=87?= Date: Fri, 20 Apr 2018 15:46:49 +0800 Subject: [PATCH] Add Deepin Desktop Environment support. In DDE, a tools called `dde-open` is used to open preferred app. DDE use `Deepin` as a desktop name currently, but in some older version, it was `DEEPIN` or `deepin` dde-open is provide by dde-api, see [1]. [1]: https://cr.deepin.io/c/dde/dde-api/+/33751 --- scripts/xdg-open.in | 19 +++++++++++++++++++ scripts/xdg-utils-common.in | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in index 2972257..575660a 100644 --- a/scripts/xdg-open.in +++ b/scripts/xdg-open.in @@ -142,6 +142,21 @@ open_kde() fi } +open_dde() +{ + if dde-open -version >/dev/null 2>&1; then + dde-open "$1" + else + open_generic "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + open_gnome3() { if gio help open 2>/dev/null 1>&2; then @@ -500,6 +515,10 @@ case "$DE" in open_kde "$url" ;; + dde) + open_dde "$url" + ;; + gnome3|cinnamon) open_gnome3 "$url" ;; diff --git a/scripts/xdg-utils-common.in b/scripts/xdg-utils-common.in index 8b85883..7ba61e0 100644 --- a/scripts/xdg-utils-common.in +++ b/scripts/xdg-utils-common.in @@ -288,6 +288,10 @@ detectDE() KDE) DE=kde; ;; + # Deepin Desktop Environments + DEEPIN|Deepin|deepin) + DE=dde; + ;; LXDE) DE=lxde; ;; -- 2.13.3