-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
sxhkd: stop scope before creating #2086
Conversation
modules/services/sxhkd.nix
Outdated
@@ -73,6 +73,7 @@ in | |||
]; | |||
|
|||
xsession.initExtra = '' | |||
systemctl --user stop sxhkd.scope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
systemctl --user stop sxhkd.scope | |
systemctl --user stop sxhkd.scope || true |
If an error occurs, is the script evaluation aborted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, just throw an error to journal. I added check if scope is active.
3f019b6
to
fcd077b
Compare
modules/services/sxhkd.nix
Outdated
[[ $(systemctl is-active --user sxhkd.scope) == active ]] \ | ||
&& systemctl --user stop sxhkd.scope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[[ $(systemctl is-active --user sxhkd.scope) == active ]] \ | |
&& systemctl --user stop sxhkd.scope | |
systemctl --user stop sxhkd.scope 2> /dev/null || true |
This runs into a race condition where the scope is stopped between the two systemctl
calls.
Don't check, handle failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
This allows relogging into graphical session.
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Added myself as module maintainer. See example.
Added myself and the module files to
.github/CODEOWNERS
.