Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Command Lights

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.

Dev loop

make install                                            # symlinks into ~/.local/share/gnome-shell/extensions/
gnome-extensions enable command-lights@addedbytes.dev

Reload 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 errors

Packaging

make pack   # produces command-lights@addedbytes.dev/command-lights@addedbytes.dev.shell-extension.zip

How stop works

Commands 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.

Diagnosing an unexpected stop

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>.log

Every 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, check journalctl --user -u gnome-shell / coredumpctl list gnome-shell around 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. A terminated by signal 9 is worth checking journalctl -k / dmesg for an OOM-kill around that time.

About

A gnome extension for running commands and seeing if they're still running. AI-coded, use entirely at your own risk.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages