Skip to content

New module to view and toggle systemd user services#642

Open
fdev31 wants to merge 5 commits intoMalpenZibo:mainfrom
fdev31:main
Open

New module to view and toggle systemd user services#642
fdev31 wants to merge 5 commits intoMalpenZibo:mainfrom
fdev31:main

Conversation

@fdev31
Copy link
Copy Markdown
Contributor

@fdev31 fdev31 commented Apr 16, 2026

This module lists user units (with some filtering to keep the "interesting" ones) and allows seeing their status and toggling starting/stopping them.

Note

I am not a Rust developer (but still a seasoned software engineer...) and heavily used an LLM to create this module. I am not really able to judge on the Rust itself, but tried to stick to the project's best practices.

I tried to avoid "generic" changes, but one seemed required to control the cursor appearance in commit d98b530 fix: delegate mouse_interaction in MenuWrapper to child content

fdev31 added 5 commits April 16, 2026 18:48
Implement a new UserServices module that lets users monitor and
start/stop their systemd user service units from the bar. The module
connects to the session D-Bus, lists units from ~/.config/systemd/user/
and ~/.local/share/systemd/user/, and reacts to PropertiesChanged
signals for live state updates.
MenuWrapper was unconditionally returning mouse::Interaction::default()
(text caret) instead of delegating to the child widget. This caused all
menus to show a text cursor instead of a pointer when hovering
interactive elements like buttons.
Units with Restart=on-failure cause rapid PropertiesChanged signal
bursts when they fail, leading to excessive D-Bus reads. Fix with:

1. Track known user unit object paths in a HashSet and discard signals
   from unrelated units before any D-Bus read.
2. Batch rapid signals with ready_chunks(10) and deduplicate by object
   path within each chunk, so only one read_unit_from_path call is made
   per unique tracked unit per batch.
Wrap each unit row in a ghost_button for hover feedback, matching the
bluetooth/audio submenu pattern. The toggler is now display-only with
the button handling the toggle action.

Text color conveys unit state: green for active, yellow for transient
(activating/deactivating), red for failed, default for inactive.
@MalpenZibo
Copy link
Copy Markdown
Owner

Ok, first of all, thanks!

Now, about the PR scope. This adds a module to show and operate on systemd services. From my point of view, this is a little out of scope for a status bar. I mean, usually for this kind of stuff, there are dedicated apps that provide this functionality (eg: MissionControl)

Why do you need this kind of functionality in ashell?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants