lahwaacz / sxlock

MIT License
41 stars 21 forks source link

Make systemd unit take user as instance identifier #22

Closed mfaerevaag closed 6 years ago

mfaerevaag commented 6 years ago

Thanks for great slock fork!

When setting up I didn't like too much to set my username in the unit file as I use my dot-files across multiple machines where the username is not necessarily the same. I therefore opted to give username as sxlock@markus.service, when using the service.

In practice:

# systemctl enable sxlock        # before
# systemctl enable sxlock@markus # after

This has one drawback, and that is that if people are on a multi-user system, for instance, they can start several instances of the unit for different users.

Anyways, I thought I would suggest the change. Feel free to close without merge if you think it's an anti-feature.

Cheers!

References

lahwaacz commented 6 years ago

Sorry for the delay, somehow I overlooked this issue...

I don't like merging this because it would mean that this is somehow more recommended than the previous way, which it isn't - the single user name will always be hardcoded no matter what. And the new way is not fundamentally different from the old one, so if you want, you could add a brief tip referencing that this is another possibility.

Also, this still does not solve your problem with the "dot files" (or rather config files, because dot files usually refer only to user configs). You still need to enable sxlock@markus on one machine and sxlock@marcus on the other :wink: