You are not logged in.

#1 2021-11-27 07:58:26

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Switch envvar XDG_CURRENT_DESKTOP to BunsenLabs?

For some time now I've had

export XDG_CURRENT_DESKTOP=BunsenLabs

in ~/.config/bunsen/environment (and reflected in 'echo $XDG_CURRENT_DESKTOP' in terminal) in both my daily workplace Lithium desktop and Beryllium VM, with no apparent ill-effects.

We previously had that envvar set to XFCE to work round some annoyance with XFCE's exo-open, and possibly some mysterious Gnome weirdness, but it no longer seems to be needed, and exo-open is not available on Bullseye without installing more XFCE. While there's nothing exciting to be expected from setting XDG_CURRENT_DESKTOP to BunsenLabs at this point, it's at least more honest and might avoid our desktop reporting itself as XFCE in some inconvenient place.

No-one has any objections to making this switch?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#2 2021-11-27 10:38:17

nobody
The Great
Registered: 2015-08-10
Posts: 3,655

Re: Switch envvar XDG_CURRENT_DESKTOP to BunsenLabs?

Going by the current state of xdg-open on Debian 11, it should be set to X-Generic if that works.

detectDE()
{
    # see https://bugs.freedesktop.org/show_bug.cgi?id=34164
    unset GREP_OPTIONS

    if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
      case "${XDG_CURRENT_DESKTOP}" in
         # only recently added to menu-spec, pre-spec X- still in use
         Cinnamon|X-Cinnamon)
           DE=cinnamon;
           ;;
         ENLIGHTENMENT)
           DE=enlightenment;
           ;;
         # GNOME, GNOME-Classic:GNOME, or GNOME-Flashback:GNOME
         GNOME*)
           DE=gnome;
           ;;
         KDE)
           DE=kde;
           ;;
         DEEPIN|Deepin|deepin)
           DE=deepin;
           ;;
         LXDE)
           DE=lxde;
           ;;
         LXQt)
           DE=lxqt;
           ;;
         MATE)
           DE=mate;
           ;;
         XFCE)
           DE=xfce
           ;;
         X-Generic)
           DE=generic
           ;;
      esac
    fi

Offline

#3 2021-11-27 16:56:42

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,036
Website

Re: Switch envvar XDG_CURRENT_DESKTOP to BunsenLabs?

johnraff wrote:

No-one has any objections to making this switch?

None here!


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Online

#4 2021-11-28 05:14:33

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: Switch envvar XDG_CURRENT_DESKTOP to BunsenLabs?

nobody wrote:

Going by the current state of xdg-open on Debian 11, it should be set to X-Generic if that works.

detectDE()
{
    # see https://bugs.freedesktop.org/show_bug.cgi?id=34164
    unset GREP_OPTIONS

    if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
      case "${XDG_CURRENT_DESKTOP}" in
         # only recently added to menu-spec, pre-spec X- still in use
         Cinnamon|X-Cinnamon)
           DE=cinnamon;
           ;;
         ENLIGHTENMENT)
           DE=enlightenment;
           ;;
         # GNOME, GNOME-Classic:GNOME, or GNOME-Flashback:GNOME
         GNOME*)
           DE=gnome;
           ;;
         KDE)
           DE=kde;
           ;;
         DEEPIN|Deepin|deepin)
           DE=deepin;
           ;;
         LXDE)
           DE=lxde;
           ;;
         LXQt)
           DE=lxqt;
           ;;
         MATE)
           DE=mate;
           ;;
         XFCE)
           DE=xfce
           ;;
         X-Generic)
           DE=generic
           ;;
      esac
    fi

If XDG_CURRENT_DESKTOP is ' X-Generic' then detectDE() sets DE as 'generic' there, but if it fails to recognize the content of XDG_CURRENT_DESKTOP (as with 'BunsenLabs') then on line 995 DE will be set to generic anyway:

detectDE

if [ x"$DE" = x"" ]; then
    DE=generic
fi

So as far as the behaviour of xdg-open goes, I don't think it would make any difference. In either case it will fall back to the open_generic() function.

xdg-open has some deficiencies in fact, eg it would have trouble with the colon-separated list that XDG permits in XDG_CURRENT_DESKTOP, though for us that's not an issue.

But that XDG page reminded me that another potential effect is in whether certain apps appear in auto-generated menus or not, because of {Only,Not}ShowIn .desktop file keys (recognized environments). Apps marked OnlyShowIn = XFCE will cease to appear while others previously hidden by NotShowIn = XFCE (if there are any) will start to show, if XDG_CURRENT_DESKTOP is set to BunsenLabs or X-Generic. For BL those changes are pretty peripheral though, and it's hard to say in general if they are desirable or not. Any specific cases can be fixed if necessary with a user file in ~/.local/share/applications.

Another change would be in what 3rd party utilities report. Eg with neofetch: 'DE: BunsenLabs' or 'DE: Generic' appears instead of 'DE: Xfce'. I guess that's a small, if mainly cosmetic, improvement.

( XDG_CURRENT_DESKTOP was originally proposed in 2011, mail thread: https://www.mail-archive.com/xdg@lists. … 06587.html )


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#5 2021-12-19 07:36:27

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: Switch envvar XDG_CURRENT_DESKTOP to BunsenLabs?

no objections if we ship ~/.config/bunsen/environment with

export XDG_CURRENT_DESKTOP=BunsenLabs

and at least benefit from the neofetch DE entry?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

Board footer

Powered by FluxBB