Skip to content

Improve support for systemd-homed - #456

Open
naritanara wants to merge 4 commits into
pop-os:masterfrom
naritanara:systemd-homed
Open

Improve support for systemd-homed#456
naritanara wants to merge 4 commits into
pop-os:masterfrom
naritanara:systemd-homed

Conversation

@naritanara

Copy link
Copy Markdown
Contributor
  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

This is somewhat crude but it seems to work. I have tested by running the get_user_data() method as root, but not by installing the modified greeter. Is there any predefined environment / guide for this kind of testing?

@mmstick
mmstick requested review from a team May 12, 2026 15:04
Comment thread daemon/src/lib.rs Outdated
@naritanara

Copy link
Copy Markdown
Contributor Author

updated to use the Dbus API

mmstick
mmstick previously approved these changes May 15, 2026
Comment thread daemon/Cargo.toml Outdated
#TODO: reduce features
tokio = { workspace = true, features = ["full"] }
xdg = "3.0"
zbus_systemd = { version = "0.26000.0", features = ["home1"] }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be optional, and cosmic-greeter should compile and run without that option enabled.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree I maintain Slackware packages.

Comment thread daemon/src/lib.rs Outdated
Self {

let connection = Connection::system().await?;
let homed = ManagerProxy::new(&connection).await?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cause cosmic-greeter to fail if home manager is not available?

@jackpot51 jackpot51 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before approving it must be demonstrated that cosmic-greeter with this change can still run without systemd.

@naritanara

Copy link
Copy Markdown
Contributor Author

Moved dependency to 'systemd' feature and properly handled errors. Tested the daemon with and without the 'systemd' feature, both compile and work as expected.

I left the systemd-homed cache paths for icons and backgrounds without feature-gating, please let me know if it would be better to feature-gate even if no dependencies are added.

@naritanara

Copy link
Copy Markdown
Contributor Author

Additional testing: I have installed the new daemon on my system and verified that systemd-homed users appear on the greeter screen. Also tested the daemon without the 'systemd' feature, which works as before, without showing the homed users.

OS: Fedora COSMIC Atomic 44.20260519
Installation method: Enabled usroverlay and replaced the daemon, then stopped cosmic-greeter-daemon.service and restarted cosmic-greeter.service
Obtained result: With the systemd feature enabled, homed users show up. If user icons or wallpapers have been cached by systemd, they are used by the greeter as expected. Otherwise, the default values are used as before.

@jackpot51

Copy link
Copy Markdown
Member

Thanks, that looks good to me. Just to make sure, I have asked for someone maintaining cosmic-greeter on a non-systemd distribution to test this.

@nater1983

nater1983 commented May 23, 2026

Copy link
Copy Markdown
   Compiling clap_lex v1.1.0
warning: unused import: `tracing::warn`
 --> daemon/src/main.rs:8:5
  |
8 | use tracing::warn;
  |     ^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

warning: unused import: `tracing::warn`
  --> src/greeter.rs:47:5
   |
47 | use tracing::warn;
   |     ^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

error[E0599]: `impl futures_util::Future<Output = UserFilter>` is not an iterator
  --> src/greeter.rs:86:40
   |
86 |             .filter(|user| user_filter.filter(user))
   |                                        ^^^^^^ `impl futures_util::Future<Output = UserFilter>` is not an iterator
   |
   = note: the following trait bounds were not satisfied:
           `impl futures_util::Future<Output = UserFilter>: Iterator`
           which is required by `&mut impl futures_util::Future<Output = UserFilter>: Iterator`
help: consider `await`ing on the `Future` and calling the method on its `Output`
   |
86 |             .filter(|user| user_filter.await.filter(user))
   |                                        ++++++

For more information about this error, try `rustc --explain E0599`.
warning: `cosmic-greeter` (lib) generated 1 warning
error: could not compile `cosmic-greeter` (lib) due to 1 previous error; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
warning: `cosmic-greeter-daemon` (bin "cosmic-greeter-daemon") generated 1 warning (run `cargo fix --bin "cosmic-greeter-daemon" -p cosmic-greeter-daemon` to apply 1 suggestion)
error: recipe `build-debug` failed on line 47 with exit code 101

I compiled this on Slackware Current with rust-1.95. My Cosmic setup is up to date with version 1.0.13

@naritanara

Copy link
Copy Markdown
Contributor Author
   Compiling clap_lex v1.1.0
warning: unused import: `tracing::warn`
 --> daemon/src/main.rs:8:5
  |
8 | use tracing::warn;
  |     ^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

warning: unused import: `tracing::warn`
  --> src/greeter.rs:47:5
   |
47 | use tracing::warn;
   |     ^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

error[E0599]: `impl futures_util::Future<Output = UserFilter>` is not an iterator
  --> src/greeter.rs:86:40
   |
86 |             .filter(|user| user_filter.filter(user))
   |                                        ^^^^^^ `impl futures_util::Future<Output = UserFilter>` is not an iterator
   |
   = note: the following trait bounds were not satisfied:
           `impl futures_util::Future<Output = UserFilter>: Iterator`
           which is required by `&mut impl futures_util::Future<Output = UserFilter>: Iterator`
help: consider `await`ing on the `Future` and calling the method on its `Output`
   |
86 |             .filter(|user| user_filter.await.filter(user))
   |                                        ++++++

For more information about this error, try `rustc --explain E0599`.
warning: `cosmic-greeter` (lib) generated 1 warning
error: could not compile `cosmic-greeter` (lib) due to 1 previous error; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
warning: `cosmic-greeter-daemon` (bin "cosmic-greeter-daemon") generated 1 warning (run `cargo fix --bin "cosmic-greeter-daemon" -p cosmic-greeter-daemon` to apply 1 suggestion)
error: recipe `build-debug` failed on line 47 with exit code 101

I compiled this on Slackware Current with rust-1.95. My Cosmic setup is up to date with version 1.0.13

Oh, my bad, I did not realize that the greeter directly links with the daemon library (I was directly compiling the daemon, not the whole workspace). I will push a fix shortly.

@naritanara

Copy link
Copy Markdown
Contributor Author

Hey @nater1983 could you check again with my latest commit? :)

@nater1983

Copy link
Copy Markdown

Hey @nater1983 could you check again with my latest commit? :)

Work's perfectly. Thank you so much.

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.

4 participants