Skip to content

[FEATURE] Use PolKit to prompt for sudoer password instead of requesting to re-run with sudo #54

@idanarye

Description

@idanarye

Trying to operate a system service when systemd-manager-tui was started without sudo yields:

┌Error───────────────────────────────────────────────────────────────┐                      
│                                ERROR                               │                      
│                                                                    │                      
│ You do not have the permission to do that. Try running the program │                      
│                             with sudo.                             │                      
│                                                                    │                      
│                      Press any key to dismiss                      │                      
│                                                                    │                      
│                                                                    │                      
└────────────────────────────────────────────────────────────────────┘                      

But when you do the same with systemctl it doesn't do that - it prompts you for a sudoer password.

Is it possible to implement that behavior here as well?

I've did some research (asked ChatGPT) and systemctl does that via PolKit. You are using zbus, and I found a crate that connects the two: https://crates.io/crates/zbus_polkit. Maybe you can utilize it here?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions