diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index 204a5acd66f544..ac6695ea269f0c 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -266,6 +266,17 @@ run_merge_cmd () { fi } +is_desktop () { + case ":$XDG_CURRENT_DESKTOP:" in + *:$1:*) + return 0 + ;; + *) + return 1 + ;; + esac +} + list_merge_tool_candidates () { if merge_mode then @@ -275,9 +286,12 @@ list_merge_tool_candidates () { fi if test -n "$DISPLAY" then - if test -n "$GNOME_DESKTOP_SESSION_ID" + if is_desktop "GNOME" || test -n "$GNOME_DESKTOP_SESSION_ID" then tools="meld opendiff kdiff3 tkdiff xxdiff $tools" + elif is_desktop "KDE" || test x"$KDE_FULL_SESSION" = x"true" + then + tools="kdiff3 opendiff tkdiff xxdiff meld $tools" else tools="opendiff kdiff3 tkdiff xxdiff meld $tools" fi