dylanaraps / neofetch

🖼️ A command-line system information tool written in bash 3.2+
MIT License
21.88k stars 1.76k forks source link

Running Gnome-related services can cause Neofetch to incorrectly detect WM as Gnome/mutter #2298

Closed josteink closed 10 months ago

josteink commented 1 year ago

Description

Running neofetch when using the sway window-manager will report Mutter (Gnome) if some Gnome-services are started.

It's not uncommon to also depend on a few gnome-related tools (Gnome keyring, Gnome Control Center, Gnome Polkit, dbus, whatever).

Activating any of those may result in a gnome-shell process being launched, making this resulting process-lookup return incorrect results, because both sway and gnome-shell is present. (This may affect other tiling window-managers like i3wm as well, but I haven't tested that).

https://github.com/dylanaraps/neofetch/blob/ccd5d9f52609bbdcd5d8fa78c4fdb0f12954125f/neofetch#L1909-L1938

This can be seen from a manual shell invocation:

$ echo $(ps -e | grep -m 1 -o -F \
                               -e arcan \
                               -e asc \
                               -e clayland \
                               -e dwc \
                               -e fireplace \
                               -e gnome-shell \
                               -e greenfield \
                               -e grefsen \
                               -e hikari \
                               -e kwin \
                               -e lipstick \
                               -e maynard \
                               -e mazecompositor \
                               -e motorcar \
                               -e orbital \
                               -e orbment \
                               -e perceptia \
                               -e river \
                               -e rustland \
                               -e sway \
                               -e ulubis \
                               -e velox \
                               -e wavy \
                               -e way-cooler \
                               -e wayfire \
                               -e wayhouse \
                               -e westeros \
                               -e westford \
                               -e weston)
gnome-shell

If removing the -m 1 clause, we can see multiple processes being found, and I guess the problem is about (a lacking) handling of precedence:

$ echo $(ps -e | grep -o -F \
                               -e arcan \
                               -e asc \
                               -e clayland \
                               -e dwc \
                               -e fireplace \
                               -e gnome-shell \
                               -e greenfield \
                               -e grefsen \
                               -e hikari \
                               -e kwin \
                               -e lipstick \
                               -e maynard \
                               -e mazecompositor \
                               -e motorcar \
                               -e orbital \
                               -e orbment \
                               -e perceptia \
                               -e river \
                               -e rustland \
                               -e sway \
                               -e ulubis \
                               -e velox \
                               -e wavy \
                               -e way-cooler \
                               -e wayfire \
                               -e wayhouse \
                               -e westeros \
                               -e westford \
                               -e weston)
gnome-shell sway sway

Neofetch version

7.1.0

Screenshot

image

Config file

None

Verbose log

neofetchlog.txt

hykilpikonna commented 1 year ago

This is fixed in HyFetch 1.4.7 by PR #94.

This repo (dylanaraps/neofetch) seems no longer maintained.

HyFetch is a fork of neofetch with LGBTQ pride flags, but the repo also maintains an updated version of the original neofetch, addressing many pull requests that are not merged in the original repo.

Read the "Running Updated Original Neofetch" section for more info!

josteink commented 10 months ago

Thanks for the suggestion, @hykilpikonna , but I prefer my software to be about software, not politics 😄

As for neofetch... If it's not gonna be fixed, its not gonna be fixed. Closing.