rgwood / systemctl-tui

A fast, simple TUI for interacting with systemd services and their logs
MIT License
235 stars 5 forks source link

Support user units #8

Closed k0ral closed 7 months ago

k0ral commented 10 months ago

It seems that systemctl-tui can only work with global units, as opposed to user units (as in: systemctl --user.) It would be nice to be able:

Would you accept a merge request to that end ? (I'm willing to try and contribute it.)

rgwood commented 10 months ago

Thanks for the issue!

I'd rather not have separate modes if we can avoid it; how do you feel about showing both global and user units at the same time?

k0ral commented 10 months ago

I suggested a modal implementation because this is somewhat what systemctl does and I figured you might want to stick to its model. But we could instead use a filter on the "scope" of the unit (for lack of a better word), with 2 possible flags (user & global) and 3 possible combinations (user / global / user | global). What do you think ?

Anyway, to answer your question: showing both global and user units at the same time is already a desirable improvement over the current situation, so I'll take it :slightly_smiling_face: .

rgwood commented 10 months ago

I suggested a modal implementation because this is somewhat what systemctl does and I figured you might want to stick to its model.

Gotcha. I'm OK diverging from systemctl's behaviour here.

we could instead use a filter on the "scope" of the unit (for lack of a better word), with 2 possible flags (user & global) and 3 possible combinations (user / global / user | global). What do you think ?

Sure, that seems useful. Maybe as a CLI flag like --scope user/--scope global/--scope all, and default to all?

rgwood commented 9 months ago

@k0ral Still have any interest in implementing this?

k0ral commented 9 months ago

I don't think I'll be able to implement this in a timely manner, I got preempted by other tasks. Feel free to implement it, if that's what you had in mind ; apologies for implying that I was actively working on it.

rgwood commented 7 months ago

I've implemented this in https://github.com/rgwood/systemctl-tui/commit/7c92092a5d8c4357f1cb9a131ca149af073ef2cf, sorry for the wait!

Version 0.3.0 now handles global+user services. By default it displays both (and mentions which is which in the details pane), but the --scope CLI flag can be used to only display one of those.