Refuse to run if i3lock is already running#380
Closed
MithicSpirit wants to merge 2 commits intobetterlockscreen:nextfrom
Closed
Refuse to run if i3lock is already running#380MithicSpirit wants to merge 2 commits intobetterlockscreen:nextfrom
MithicSpirit wants to merge 2 commits intobetterlockscreen:nextfrom
Conversation
Collaborator
|
Must at least use $i3lockcolor_bin, but I'm not sure in which cases this would happen if not false usage |
SebTM
approved these changes
Aug 1, 2023
SebTM
added a commit
that referenced
this pull request
Aug 1, 2023
Collaborator
|
Couldn't re-run action so added it to my PR for 4.1.0 - thanks for the contribution 😃 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
betterlockscreennow refuses to run if a process with name includingi3lockis already running by the same user (as otherwise runningi3lockagain fails withi3lock: Cannot grab pointer/keyboard).This primarily fixes a minor gripe I had where betterlockscreen would attempt to run twice when I put computer to sleep (once from the systemd service and once from xautolock). This was particularly annoying when, for some reason (probably a sort of race condition), dpms would not be reset correctly.
It might be desirable to change how it detects whether it is already running. Maybe checking based on
$i3lockcolor_binor just checking forbetterlockscreenitself? Additionally, this will probably run into issues (untested) when running betterlockscreen on multiple$DISPLAYs at once as the same user, as any subsequent ones will fail. We could probably try to detect what$DISPLAYthei3lock(or whatever) process is on, but that sounds like a lot of hassle, so maybe just adding a config option to disable this check would be easier. I'd be fine with implementing any of these changes if so desired.How Has This Been Tested?
Checklist: