From: Stefan Kangas Date: Wed, 14 Sep 2022 08:26:07 +0000 (+0200) Subject: Fix desktop environment check on Ubuntu X-Git-Tag: emacs-29.0.90~1856^2~530 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d537e4c102c4b37cdbccc9517f569c685fec48d4;p=emacs.git Fix desktop environment check on Ubuntu * lisp/image/wallpaper.el (xdg): Require. (wallpaper--check-command): Use xdg-current-desktop instead of reading XDG_CURRENT_DESKTOP directly. This fixes things on e.g. Ubuntu, where XDG_CURRENT_DESKTOP might contain a string like "ubuntu:GNOME". --- diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el index 19741a20f15..97789fe3f53 100644 --- a/lisp/image/wallpaper.el +++ b/lisp/image/wallpaper.el @@ -33,6 +33,7 @@ ;;; Code: (eval-when-compile (require 'subr-x)) +(require 'xdg) (defcustom wallpaper-commands '( @@ -85,7 +86,7 @@ You can also use \\[report-emacs-bug]." (cdr args)))) (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings))) - (equal (getenv "XDG_CURRENT_DESKTOP") "GNOME")) + (member "GNOME" (xdg-current-desktop))) (cl-defmethod wallpaper--check-command ((_type (eql 'swaybg))) (and (getenv "WAYLAND_DISPLAY")