summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlatian <baschdel@disroot.org>2023-12-04 00:12:59 +0000
committerSimon Lees <simon@simotek.net>2023-12-04 00:12:59 +0000
commit0f49cf5d7956076fccd599d82b85946e5e49d473 (patch)
tree5b054f23900534e29ac5600a1d66e6a517fa0b95
parent94e9d7b4c4c2c0c945de6936fad846f323a4fd40 (diff)
Add support for deeping-desktop browser setting in xdg-settings.
Original patch by ssk-wh Rebased and shellchecked (quoting)
-rwxr-xr-xscripts/xdg-settings.in42
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/xdg-settings.in b/scripts/xdg-settings.in
index 59e97cb..a62eedd 100755
--- a/scripts/xdg-settings.in
+++ b/scripts/xdg-settings.in
@@ -278,6 +278,44 @@ set_browser_kde()
}
# }}} KDE
+# {{{ Deepin
+
+read_deepin_browser()
+{
+ dbus-send --print-reply=literal --dest=com.deepin.daemon.Mime /com/deepin/daemon/Mime com.deepin.daemon.Mime.GetDefaultApp string:"x-scheme-handler/http" | jq -r '.Id'
+}
+
+get_browser_deepin()
+{
+ browser="$(read_deepin_browser)"
+ if [ -n "$browser" ]; then
+ echo "$browser"
+ exit_success
+ else
+ exit_failure_operation_failed
+ fi
+}
+
+check_browser_deepin()
+{
+ if [ "$(read_deepin_browser)" = "$1" ]; then
+ exit_success
+ else
+ exit_failure_operation_failed
+ fi
+}
+
+set_browser_deepin()
+{
+ xdg-mime default "$1" x-scheme-handler/http x-scheme-handler/ftp x-scheme-handler/https text/html text/xml text/xhtml_xml text/xhtml+xml
+ if [ $? -ne 0 ]; then
+ exit_failure_operation_failed
+ else
+ exit_success
+ fi
+}
+
+# }}} Deepin
# {{{ GNOME
get_browser_gnome()
@@ -958,6 +996,10 @@ case "$DE" in
dispatch_specific kde "$@"
;;
+ deepin)
+ dispatch_specific deepin "$@"
+ ;;
+
gnome)
dispatch_specific gnome "$@"
;;