From d537e4c102c4b37cdbccc9517f569c685fec48d4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 14 Sep 2022 10:26:07 +0200 Subject: [PATCH] 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". --- lisp/image/wallpaper.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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") -- 2.39.2