Skip to content

Conversation

@paperluigis
Copy link

@paperluigis paperluigis commented Oct 30, 2025

Description

This PR makes the daemon create and lock a file next to the IPC socket (ex. "/run/user/1000/eww-server_f12a67507f690016.lock"). It also makes the program check if the daemon is running by seeing if the file is locked by another process, instead of sending a ping command to the daemon.

This will fix #255, where a timeout in sending an open command over IPC caused the program to create a new daemon, leading to "zombie windows" being left over by the existing daemon.
This will also hopefully make the daemon launch a bit quicker when started as eww open bar.

Additional Notes

i haven't tested this on platforms other than linux

is this a feature or a fix?

this uses the std::fs::File::try_lock method which is cleaner but only available in rust 1.89.0 and above; i have an alternative implementation that uses nix::fcntl::Flock instead, should i submit the alternative instead?

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
  • I used cargo fmt to automatically format all code before committing

@paperluigis paperluigis force-pushed the patch branch 2 times, most recently from 87ffbb3 to 050cabb Compare October 31, 2025 04:28
Copy link
Contributor

@w-lfchen w-lfchen left a comment

Choose a reason for hiding this comment

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

since eww has a rust-toolchain.toml file that currently is set to 1.81, this pr will break anything relying on that file to determine the rust version to compile eww with due to using newer apis.
in my opinion, the right move here would be updating said file and fixing issues that may arise in the process.
i currently don't really have time to do so for personal reasons, would love to do it otherwise.

@paperluigis
Copy link
Author

is there anything i should look out for after doing so? do i just have to make sure it still compiles?

@w-lfchen
Copy link
Contributor

there could be new warnings or lints

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.

[BUG] Eww spawns zombie windows and processes

2 participants