backgroundWhen asking for help with a software problem, it is usually good to identify not only what versions of that particular code one is running, but also characterize the application's platform. Querying hardware from CLI can be annoying, but fortunately hardware is often not part of one's etiology or is standard enough to be irrelevant. Querying the foundations of a Linux host via CLI is relatively straightforward (at least since LSB), so one can script general-purpose bash like this:#!/usr/bin/env bash### Attempt to create a high-level commandline-query for### basic host configuration information (at least, for that### part of the platform just above the hardware.# constants------------------------------------------------------------### Marker file paths for specific distros. TODO: complete the set.DEBIAN_FILE='/etc/debian_version'# code-----------------------------------------------------------------### Absolute basics: kernel, distrofor CMD in \    'date' \    'uname -rsv' \    'lsb_release -ds' \; do    echo -e \$ ${CMD}    eval ${CMD}done### Distro details via marker file. TODO: extend to all major distros.### Feel free to add stanzas for your distro's marker.if [[ -r ${DEBIAN_FILE} ]] ; then    for CMD in \        cat ${DEBIAN_FILE} \    ; do        echo -e \$ ${CMD}        eval ${CMD}    donefi### Other important non-graphical libraries, toolkits, etc.for CMD in \    'gcc --version | head -n 1' \; do    echo -e \$ ${CMD}    eval ${CMD}doneThis produces output like $ dateSat Sep 17 14:18:28 MST 2016$ uname -rsvLinux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02)$ lsb_release -dsLMDE 2 Betsy$ cat /etc/debian_version8.5$ gcc --version | head -n 1gcc (Debian 4.9.2-10) 4.9.2questionWhat I don't know is, how to similarly script queries for important information about one's desktop stack? I know I'm running X, so can do## Dunno why X:## * throws error on `--version`## * outputs version info to `stderr`## * wants to include hostname in 'Current Operating System:' line$ Xorg -version 2>&1 | grep -ve '^$\|^[[:space:]]\|Current Operating System:'X.Org X Server 1.16.4Release Date: 2014-12-20X Protocol Version 11, Revision 0Build Operating System: Linux 3.16.0-4-amd64 x86_64 DebianKernel command line: BOOT_IMAGE=/vmlinuz-3.16.0-4-amd64 root=/dev/mapper/LVM2_crypt-root ro nomodeset nouveau.modeset=0Build Date: 11 February 2015  12:32:02AMxorg-server 2:1.16.4-1 (http://www.debian.org/support) Current version of pixman: 0.32.6$ x-window-manager --version | head -1metacity 3.14.3and I (just happen to) know I'm using the Cinnamon desktop and so can do$ cinnamon --versionCinnamon 3.0.6but I have no idea about how to CLI-query for versions of things like GTK (which I know Cinnamon uses), or how to do similar high-level queries in Qt world, or what to do for Wayland, or about what other parts of the WM/DE/GUI stack are generally important for problem descriptions. What commands can I use to get this information?
How to query (from the command line) high-level desktop-environment information for system characterization
bash;command line;window manager;desktop environment;system information