]> git.eshelyaron.com Git - emacs.git/commitdiff
Support several new DEs in wallpaper.el
authorStefan Kangas <stefankangas@gmail.com>
Fri, 23 Sep 2022 01:24:13 +0000 (03:24 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Fri, 23 Sep 2022 01:27:34 +0000 (03:27 +0200)
* lisp/image/wallpaper.el (wallpaper--default-commands)
(wallpaper--check-command, wallpaper-command): Add support for Unity,
Pantheon, Budgie, LXQt, and LXDE.  Also add support for Lubuntu,
Xubuntu, and Pop!_OS.

lisp/image/wallpaper.el

index ff47d37e3a65fa53a31d8c1c260f6380a1e4c712..effa25b18042cf314660efc9ef2c51636393e2e3 100644 (file)
     ;; XFCE
     ("xfconf-query" "-c" "xfce4-desktop" "-p"
      "/backdrop/screen0/monitoreDP/workspace0/last-image" "-s" "%f")
+    ;; LXDE
+    ("pcmanfm" "--set-wallpaper=%f")
+    ;; LXQt
+    ("pcmanfm-qt" "--set-wallpaper=%f") ; "--wallpaper-mode=MODE"
+    ;; ;; Mate
+    ;; ("gsettings" "set" "org.mate.background" "picture-filename" "%f")
+    ;; ;; Cinnamon
+    ;; ("gsettings" "set" "org.cinnamon.desktop.background" "picture-uri" "file://%f")
+    ;; ;; Deepin
+    ;; ("gsettings" "set" "com.deepin.wrap.gnome.desktop.background" "picture-uri" "file://%f")
     ;; Sway (Wayland)
     ("swaybg" "-o" "*" "-i" "%f" "-m" "fill")
     ;; Wayland General
@@ -95,13 +105,40 @@ In each of the command line arguments, \"%f\", \"%h\" and \"%w\"
 will be replaced as described in `wallpaper-command-args'.")
 
 (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings)))
-  (member "GNOME" (xdg-current-desktop)))
+  (or (member (downcase (env "DESKTOP_SESSION"))
+              '("gnome" "gnome" "gnome-wayland" "gnome-xorg"
+                "unity" "ubuntu" "pantheon" "budgie-desktop"
+                "pop"))
+      (member "GNOME" (xdg-current-desktop))
+      (member "Budgie" (xdg-current-desktop))
+      (member "GNOME-Classic" (xdg-current-desktop))))
 
 (cl-defmethod wallpaper--check-command ((_type (eql 'plasma-apply-wallpaperimage)))
   (member "KDE" (xdg-current-desktop)))
 
 (cl-defmethod wallpaper--check-command ((_type (eql 'xfconf-query)))
-  (member "XFCE" (xdg-current-desktop)))
+  (or (member (lowercase (env "DESKTOP_SESSION"))
+              '("xubuntu" "ubuntustudio"))
+      (member "XFCE" (xdg-current-desktop))))
+
+(cl-defmethod wallpaper--check-command ((_type (eql 'pcmanf)))
+  (member "LXDE" (xdg-current-desktop)))
+
+(cl-defmethod wallpaper--check-command ((_type (eql 'pcmanf-qt)))
+  (or (member (lowercase (env "DESKTOP_SESSION"))
+              '("lubuntu" "lxqt"))
+      (member "LXQt" (xdg-current-desktop))))
+
+;; (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings)))
+;;   (or (equal "mate" (lowercase (env "DESKTOP_SESSION")))
+;;       (member "MATE" (xdg-current-desktop))))
+
+;; (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings)))
+;;   (or (equal "cinnamon" (lowercase (env "DESKTOP_SESSION")))
+;;       (member "X-Cinnamon" (xdg-current-desktop))))
+
+;; (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings)))
+;;   (member "Deepin" (xdg-current-desktop)))
 
 (cl-defmethod wallpaper--check-command ((_type (eql 'swaybg)))
   (and (getenv "WAYLAND_DISPLAY")
@@ -163,6 +200,8 @@ systems, where a native API is used instead."
      (const :tag "gsettings                   (GNOME)"            "gsettings")
      (const :tag "plasma-apply-wallpaperimage (KDE Plasma)"       "plasma-apply-wallpaperimage")
      (const :tag "xfconf-query                (XFCE)"             "xfconf-query")
+     (const :tag "pcmanf                      (LXDE)"             "pcmanf")
+     (const :tag "pcmanf-qt                   (LXQt)"             "pcmanf-qt")
      (const :tag "swaybg                      (Wayland/Sway)"     "swaybg")
      (const :tag "wbg                         (Wayland)"          "wbg")
      (const :tag "gm                          (X Window System)"  "gm")