GNOME Shell extension: define shell commands, each shown as a coloured light in the top panel. Click a light to start the command; click again to stop it. The light colour (configurable per command) reflects running/stopped state.
make install # symlinks into ~/.local/share/gnome-shell/extensions/
gnome-extensions enable command-lights@addedbytes.devReload GNOME Shell to pick up extension.js changes:
- X11: Alt+F2, type
r, Enter - Wayland: log out / log back in
prefs.js changes take effect the next time the prefs window is opened — no reload
needed.
gnome-extensions prefs command-lights@addedbytes.dev # open settings UI
journalctl -f /usr/bin/gnome-shell # watch for extension errorsmake pack # produces command-lights@addedbytes.dev/command-lights@addedbytes.dev.shell-extension.zipCommands run as /bin/sh -c '<command>'. Stopping walks /proc to find every
descendant of that shell (covering pipelines, &&, builtins like export, etc.) and
sends SIGTERM to each PID individually.
An earlier version signalled the whole process group instead (kill -TERM -<pid>,
relying on setsid to isolate a fresh group). That's a dangerous pattern: if the group
isolation ever silently failed, a negative PID could resolve to an unrelated — or even
GNOME Shell's own — process group, killing far more than intended. This did in fact
cause a full session logout during testing. Per-PID signalling has no such failure
mode: it can never target anything outside the actual descendant set, because a
negative/group PID is never constructed at all.
Each command's captured stdout/stderr and a timestamped start/stop/exit-reason log
live at ~/.cache/command-lights/<id>.log (rotated to <id>.log.1 once past 1 MiB).
Tail it with:
tail -f ~/.cache/command-lights/<id>.logEvery stop is logged as one of:
stopped (user click)— you clicked the light.stopped (extension/shell teardown)— the indicator was destroyed out from under the running command: extension disable/reload, or GNOME Shell itself restarting (including an unplanned restart from a crash/GPU hiccup/extension error). If you see this without having clicked anything, checkjournalctl --user -u gnome-shell/coredumpctl list gnome-shellaround that timestamp for what took the shell down.terminated by signal <n>/exited with code <n>— the process ended on its own, without command-lights asking it to. Aterminated by signal 9is worth checkingjournalctl -k/dmesgfor an OOM-kill around that time.