Need to get script into /lib/systemd/system-sleep

Need to move a script to /lib/systemd/system-sleep to ask OpenRGB to apply profile after wake from sleep. Seems the only options I have found are to build an .rpm to do so, or build my own fork of bazzite to include the script in said path. Or is there any easier way?
8 Replies
asen23
asen235d ago
you should use a systemd service instead
No description
Lttlwing16
Lttlwing16OP5d ago
Thanks, I tried multiple systemd services, all to no avail. Seems if the script isn't in lib/systemd/system-sleep my services wouldn't work. I want to say I tried /usr/lib/systemd/system-sleep, but need to revisit. I was unaware of Inhibitor Locks until your post. I'll explore and if you have a link to more info on it's use, I'd appreciate it.
asen23
asen235d ago
Unix & Linux Stack Exchange
how to run a user script after systemd wakeup?
When my debian jessie desktop box wakes up from sleep (via the new shiny systemd) my mouse settings are returned to their defaults, having reset my customisation xinput set-prop 12 'Device Accel Co...
Lttlwing16
Lttlwing16OP5d ago
Thanks again, curious where did you source the screenshot in your first response?
Lttlwing16
Lttlwing16OP5d ago
Will explore this some more this evening. I have only tried After=sleep.target and After=suspend.target in my services so far. Not exactly sure what Bazzite is using for "sleep" . Can test with calling the different modes with systemctl.
asen23
asen235d ago
what bazzite use should be exactly what fedora use
Lttlwing16
Lttlwing16OP4d ago
Was able to get this working last night with the systemd service outlined here: https://unix.stackexchange.com/questions/124212/writing-a-systemd-service-to-be-executed-at-resume Running as User=root I think was what I was missing. Simplified my script as well.
Unix & Linux Stack Exchange
Writing a systemd service to be executed at resume
my Dell laptop is subject to this bug with kernel 3.14. As a workaround I wrote a simple script /usr/bin/brightness-fix: #!/bin/bash echo 0 > /sys/class/backlight/intel_backlight/brightnes (...

Did you find this page helpful?