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

xss-lock: add patch to allow setting session #78059

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

offlinehacker
Copy link
Contributor

Motivation for this change

xss-lock uses current session that cannot be overriden. This prevents starting
xss-lock as systemd user service, as described here:
https://bitbucket.org/raymonad/xss-lock/issues/13/allow-operation-as-systemd-user-unit

This change adds additional patch that adds --session parameter. I decided not to use fetchPatch, as we do not want to depend on unofficial repos.

Thanks @xdbob for initial implementation here: https://github.com/xdbob/xss-lock

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • x ] Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@offlinehacker
Copy link
Contributor Author

@uvNikita decided to make a patch to address this issue: https://github.com/rycee/home-manager/blob/master/modules/services/screen-locker.nix#L70 so we can make a systemd user service.

@ofborg ofborg bot requested a review from malyn January 20, 2020 00:13
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 labels Jan 20, 2020
Copy link
Contributor

@uvNikita uvNikita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, would be great to get a fix for it!

The patch looks small enough to me, but I'm not sure what's recommended here for custom patches like this.

Also, I don't understand where does GRAPHICAL_SESSION_ID come from? Who is supposed to set it?

@offlinehacker
Copy link
Contributor Author

Well this patch should be upstreamed anyway, but I do not know what happened with the project as last commit is from 2014. Do you know any other alternative to xss-lock? Also GRAPHICAL_SESSION_ID should be XDG_SESSION_ID, will fix that.

@xdbob
Copy link

xdbob commented Jan 20, 2020

@offlinehacker I don't want to be a d*ck but could you at least mention where the code is comming from in the commit message ? It would be greatly appreciated :)

As for GRAPHICAL_SESSION_ID it was meant not to be XDG_SESSION_ID since each session has a session id, it was meant to be the session id tied to the graphical-session.target and imported by whoever would bring the target up

@offlinehacker
Copy link
Contributor Author

Thanks for explanation @xdbob and sorry I forgot to mention you in commit. I think the best course would be to just change source to @xdbob fork. At least one other distro uses it: https://aur.archlinux.org/packages/xss-lock-session/ If for some reason it gets removed we can fix later.

xss-lock uses current session that cannot be overriden. This prevents starting
xss-lock as systemd user service, as described here:
https://bitbucket.org/raymonad/xss-lock/issues/13/allow-operation-as-systemd-user-unit

This change uses source from github.com/xdbob/xss-lock that adds `--session`
parameter.
@offlinehacker
Copy link
Contributor Author

offlinehacker commented Jan 20, 2020

Ok, i changed source to use @xdbob fork. I do not think we need two packages for that, as it's minimal change, that does not break any additional functionality and i think it would be also easier to introduce new changes to this new repo.

@ofborg ofborg bot added the 11.by: package-maintainer This PR was created by the maintainer of the package it changes label Jan 20, 2020
Copy link
Contributor

@uvNikita uvNikita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@xdbob
Copy link

xdbob commented Jan 20, 2020

And by the way, if you are interested in the feature I have a branch keeping the logind's LockedInt status up to date: https://github.com/xdbob/xss-lock/tree/locked_hint

I can also tag a release for the occasion (I used master for months without issue).

PS: I don't use xss-lock anymore (wayland <3) but if someone is willing to test the patches I am willing to keep maintaining it and reviewing the patches

@offlinehacker
Copy link
Contributor Author

offlinehacker commented Jan 23, 2020

Thanks @xdbob, for now I will just accept master branch, but I will review and test locked_hint branch and can be later merged to master. Having a tag would be also really nice(after locked_hint branch is merged), thanks again 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants