Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support user units #8

Closed
k0ral opened this issue Nov 1, 2023 · 6 comments
Closed

Support user units #8

k0ral opened this issue Nov 1, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@k0ral
Copy link

k0ral commented Nov 1, 2023

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:

  • to switch between global & user mode using a keyboard shortcut
  • to choose between global or user mode at start-up using a commandline option (e.g. --user or -u as with systemctl tool)

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

@rgwood
Copy link
Owner

rgwood commented Nov 1, 2023

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?

@rgwood rgwood added the enhancement New feature or request label Nov 1, 2023
@k0ral
Copy link
Author

k0ral commented Nov 1, 2023

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

@rgwood
Copy link
Owner

rgwood commented Nov 1, 2023

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
Copy link
Owner

rgwood commented Nov 24, 2023

@k0ral Still have any interest in implementing this?

@k0ral
Copy link
Author

k0ral commented Nov 24, 2023

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
Copy link
Owner

rgwood commented Jan 21, 2024

I've implemented this in 7c92092, 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.

@rgwood rgwood closed this as completed Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants