Skip to content

Don't assume ps to be /bin/ps (NixOS compatibility) #60

Description

@bittner

The implementation of this GNOME shell plugin assumes that the process list binary ps is located at /bin/ps.

const cmdResult = await execCommand(["/bin/ps", "cax"]);

Unfortunately, this is only the case on FHS compliant Linux distributions. Other distros, such as the popular NixOS have the executable somewhere else, e.g.

$ which ps
/run/current-system/sw/bin/ps

Symptoms

On NixOS, the widget displays the error message instead of container details. (Hightlighting added by me.)

Image

Suggested Solution Approaches

One of:

  • Simply refer to the executable as ps (if possible, e.g. by spawning a shell)
  • Try to resolve the full path (if there is a utility function that searches the PATH environment variable)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions