diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-18 17:04:57 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-18 17:04:57 +0100 |
| commit | e55c1f32b383c53d12dc7c2b3c5e2e6ccb146cdc (patch) | |
| tree | fee3f3ced727f01c7bc630418a6e0b47d347df40 /desktop/modules/services/README.md | |
| parent | 44f947c642fe842fae80c7407399265aa47e9909 (diff) | |
| download | quickshell-e55c1f32b383c53d12dc7c2b3c5e2e6ccb146cdc.tar.gz quickshell-e55c1f32b383c53d12dc7c2b3c5e2e6ccb146cdc.zip | |
feat(services): one drawer page to start, stop and restart services
Running things is a runtime operation, so it belongs in the drawer, not
the settings window. The drawer's deck-it tile and keystone's Shells page
become one Services tile: every quickshell shell, deck-it, and the
desktop's long-running daemons (desktop-assistant, cal-notif, tv-mpris,
mail-watcher, mail-notify, hypridle, hyprsunset, the polkit agent,
notifyd, playerctld, conky and cliphist's watcher), each with Start,
Stop and Restart.
A daemon's start command is its enabled autostart.lua line, run through
hyprctl dispatch hl.dsp.exec_cmd as Autostart's Try does, so conky keeps
its workspace rule and no command is copied out of autostart.lua.
Services.js holds only the label, the piece of the line that finds it
and the pgrep/pkill arguments. Stop waits up to 5s for the process to
exit, which hyprsunset needs to free Hyprland's CTM manager. -f patterns
bracket a letter so pgrep and pkill never match the sh that runs them.
Checked: test_services.js; the pgrep list reports all twelve daemons
running; a playerctld restart through the same command came back under
a new pid. QML's JS engine has no Array.flatMap, hence the concat.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/services/README.md')
| -rw-r--r-- | desktop/modules/services/README.md | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/desktop/modules/services/README.md b/desktop/modules/services/README.md new file mode 100644 index 0000000..982a6b8 --- /dev/null +++ b/desktop/modules/services/README.md @@ -0,0 +1,41 @@ +# services + +The drawer's Services tile: every quickshell shell, deck-it and the desktop's +daemons, one row each, with Start when stopped and Stop and Restart when +running. Their state is read every 2s while the page is open. Runtime only: +what starts at login is the settings window's Autostart page, deck-it's +settings are its four pages there. + +Shells are the directories in the repo holding a `shell.qml`, running when +`qs list --all` shows an instance on one. Start, Restart and Restart all run +`reload.sh`, wrapped by `restart.sh`, which then sends one notification +naming the shells that came back, or a critical one naming those that did +not. Back means a `qs` instance on the shell's config path under a pid it did +not have before, within 5s: the old instance can linger in the list for a +moment after `qs kill`. It is the process, not the config: a shell that starts +with a broken component counts as back. Stop is `qs kill -p <dir>`. The +desktop row has no Stop, since that shell draws the drawer; its Restart works +because every action is started with `Quickshell.execDetached`, outside the +desktop shell's process, so the script carries on and starts the new one. A +hung desktop shell cannot be restarted from here; `./reload.sh` from a +terminal remains the way out. + +deck-it's row goes through `DeckIt.control()` (`modules/deckit`): Start runs +the login command, Stop `deck-it stop`, Restart both. Its detail line is +`deck-it status`, and the buttons wait until it shows the result or 30s pass. + +The daemons are listed in `Services.js`: a label, a piece of the daemon's +`autostart.lua` line and its `pgrep`/`pkill` arguments. Start runs that +enabled line through `hyprctl dispatch hl.dsp.exec_cmd(...)`, as the Autostart +page's Try does, so a `[workspace]` rule applies as at login and the command +lives only in `autostart.lua`; with no enabled line the row says "not in +autostart" and offers no Start. Stop is `pkill`, then up to 5s for the +process to exit, which hyprsunset needs: it holds Hyprland's CTM manager until +it is gone, and a second one dies. Restart is Stop then Start. A `-f` pattern +brackets one letter (`[t]v-mpris\.py`) so it never matches the `sh -c` that +passes it to pgrep or pkill. + +The Hypridle and Hyprsunset settings pages restart their daemon to apply a +save; that is theirs, not a duplicate of these rows. + +Check: `node desktop/modules/services/test_services.js`. |
