Skip to content

[idle detection] wayland check might not be accurate #168

@amjadorfali

Description

@amjadorfali

Hey! Lovely work on your app! I am personally building my own Breaktimer app using rust, and i needed a user idle feature. I realized there's a user-idle crate but it's missing wayland support so i tried to build my own, but then I stumbled upon your implementation, which was superb! Sorry for yanking it 😄

TLDR; While testing your logic for the is_wayland fn, I realized there is a bug in it.

Please correct me if I'm wrong, but I believe the logic on here should be:

    if let Ok(true) = env::var("XDG_SESSION_TYPE").map(|v| v == "wayland") {

instead of:

    if let Ok(_) = env::var("XDG_SESSION_TYPE").map(|v| v == "wayland") {

To basically check the boolean, as the 2nd approach simply ignores any returned value. I am new to rust and this is my first project so I may be drastically wrong.

On the off chance that I'm right, I'm happy to open a PR to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions