emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d537e4c102 3/7: Fix desktop environment check on Ubuntu


From: Stefan Kangas
Subject: master d537e4c102 3/7: Fix desktop environment check on Ubuntu
Date: Wed, 14 Sep 2022 05:19:42 -0400 (EDT)

branch: master
commit d537e4c102c4b37cdbccc9517f569c685fec48d4
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    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 19741a20f1..97789fe3f5 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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]