Replaced "systemctl suspend" with "loginctl suspend" #402
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.
Changed "systemctl suspend" to "loginctl suspend" in order to make it work on non-systemd distributions (such as Artix, Devuan etc.). As far as my knowledge goes, this should keep working normally on systemd distros and non-systemd distros by installing the elogind dependency
If this isn't an acceptable solution I understand, but support for other init systems is important.
Note: The betterlockscreen.service file will not run on systemd-free distros anyway, since it requires systemd in the first place.
Description
Please include a summary of the changes and if applicable which issue it fixes. Please also include relevant motivation and context. If there are changes to the dependencies/min. version-constraints please mention them.
Fixes # (issue)
systemd-free linux distributions can now run this program to suspend the system.
How Has This Been Tested?
I modified the /usr/bin/betterlockscreen file on Artix (kernel version 6.1.6-artix1-1), afterwards I also ran the "betterlockscreen -l" command several times to confirm.
I also ran a ShellCheck test.
Please describe the tests that you ran to verify your changes.
I ran the "betterlockscreen -l" command.
Checklist: