XDG Default Applications specification proposal

Bruno Haible bruno at clisp.org
Fri Jul 10 08:01:30 UTC 2020


Thayne wrote:
> In particular, this specifies which terminal application should be
> used to launch applications from desktop entries with Terminal=true.

Indeed, there is a need to make this easier. I wrote this code the other day:

;; Returns the terminal emulator program for a given desktop environment.
(defun terminal-program (&optional (desktop (desktop-environment)))
  (case desktop
    ((:GNOME-2 :GNOME-3) "gnome-terminal")
    (:KDE "konsole")
    (:LXDE "lxterminal")
    (:XFCE4 "xfce4-terminal")
    (:MATE "mate-terminal")
    (:PANTHEON "io.elementary.terminal")
    (:LUMINA "qterminal")
    (:MACOS "/Applications/Utilities/Terminal.app")
    (:HAIKU "Terminal")
    (:CYGWIN "mintty")
    (:WINDOWS "cmd")
    (t (if (getenv "DISPLAY") "xterm" nil))
) )

It's pretty ugly to have to enumerate the desktop environments in this way.

Bruno



More information about the xdg mailing list