Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centerpiece should run as a singleton #179

Open
mweinelt opened this issue Aug 3, 2024 · 2 comments
Open

Centerpiece should run as a singleton #179

mweinelt opened this issue Aug 3, 2024 · 2 comments
Labels
enhancement New feature or request rust Pull requests that update Rust code

Comments

@mweinelt
Copy link

mweinelt commented Aug 3, 2024

When bound to a key, pressing the key multiple times should not stack multiple centerpiece instances above each other. That's just annoying when it happens and probably never intentional.

I checked rofi, and it does only ever have one instance, which makes it much nicer to use.

@a-kenji a-kenji added the enhancement New feature or request label Aug 5, 2024
@friedow
Copy link
Owner

friedow commented Aug 6, 2024

This would be a good improvement. I've ran into that problem myself a bunch of times.

What would be a good way to implement this? I've seen other applications writing text files with the current PID to the ~/.cache directory. Centerpiece would then check on startup if such a file exists, if so it would terminate the old instance and start the new one.

This would especially solve the edge case of old centerpiece instances being in places where you currently can't see them. e.g. a centerpiece instance being on a different workspace.

Any other implementation suggestions?

@friedow friedow added the rust Pull requests that update Rust code label Aug 6, 2024
@a-kenji
Copy link
Collaborator

a-kenji commented Aug 6, 2024

Usually locks will be held in /run, or /run/lock IIRC, but I am not 100% sure which solution is the most portable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rust Pull requests that update Rust code
Projects
None yet
Development

No branches or pull requests

3 participants