Function: xdg-current-desktop

xdg-current-desktop is a byte-compiled function defined in xdg.el.gz.

Signature

(xdg-current-desktop)

Documentation

Return a list of strings identifying the current desktop environment.

According to the XDG Desktop Entry Specification version 0.5:

    If $XDG_CURRENT_DESKTOP is set then it contains a
    colon-separated list of strings ... $XDG_CURRENT_DESKTOP
    should have been set by the login manager, according to the
    value of the DesktopNames found in the session file.

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/xdg.el.gz
(defun xdg-current-desktop ()
  "Return a list of strings identifying the current desktop environment.

According to the XDG Desktop Entry Specification version 0.5:

    If $XDG_CURRENT_DESKTOP is set then it contains a
    colon-separated list of strings ... $XDG_CURRENT_DESKTOP
    should have been set by the login manager, according to the
    value of the DesktopNames found in the session file."
  (when-let* ((ret (getenv "XDG_CURRENT_DESKTOP")))
    (string-split ret ":")))