New module to view and toggle systemd user services#642
Open
fdev31 wants to merge 5 commits intoMalpenZibo:mainfrom
Open
New module to view and toggle systemd user services#642fdev31 wants to merge 5 commits intoMalpenZibo:mainfrom
fdev31 wants to merge 5 commits intoMalpenZibo:mainfrom
Conversation
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.
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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