jD91mZM2 / xidlehook

GitLab: https://gitlab.com/jD91mZM2/xidlehook
MIT License
387 stars 33 forks source link

Don't run multiple instances when calling xidlehook again #36

Open Shourai opened 4 years ago

Shourai commented 4 years ago

Since it is possible to append multiple --timers. Would it be possible to add a way for it to detect if there is already an instance of xidlehook running and if it is don't run another instance?

For example, if I run picom -b twice, it detects than another instance is already running and does nothing.

Sometimes I have to reload my window manager and in the startup script of the window manager it also starts up xidlehook. To mitigate this I wrote a simple if-statement to check if it is already running. But it would preferable if the program checked it instead.

ghost commented 2 years ago

You can mitigate this easily. Let's say you run i3. Each time you re-login, xidlehook instances increase. You can fix this easily by killing xidlehook the moment you exit i3. bindsym <key> exec --no-startup-id pkill xdlehook | i3-msg exit