wsmithril / wslock

An X screen lock, similiar to slock and i3lock
MIT License
2 stars 1 forks source link

Avoid multiple instances of wslock running #4

Open vaygr opened 5 years ago

vaygr commented 5 years ago

This would be useful when you already have wslock running, and your ACPI script makes sure you always run wslock before putting computer into sleep.

For now I use this workaround:

…
pgrep -x wslock || … wslock &
…
vaygr commented 5 years ago

Also one important note: when another instance is launched by mistake, wslock locks up in an infinite loop causing X server 100% CPU usage.

vaygr commented 5 years ago

The right solution here could be to check whether we can grab the pointer/keyboard or not and abort in case of failure.

My PR mentioned above tries to address that.