Is it possible to run a command or script pre and post suspend in Bazzite?

/lib/systemd/system-sleep/ is read only so I can't do it from there. My nzxt hue led strip doesn't turn off when I turn the computer off or when it suspends. For shutdown and startup, I can work around it by using a simple bash script to execute a liquidctl command on login and logout in the startup settings, but there are no options for suspend.
Solution:
I run a script after suspend using a systemd service with
After=suspend.target
After=suspend.target
in the Unit section and
WantedBy=suspend.target
WantedBy=suspend.target
in the Install section...
Jump to solution
2 Replies
Solution
lob19
lob192mo ago
I run a script after suspend using a systemd service with
After=suspend.target
After=suspend.target
in the Unit section and
WantedBy=suspend.target
WantedBy=suspend.target
in the Install section I suppose you can do the same with Before
biebel
biebelOP2mo ago
Thanks! Works flawlessly. I should go this route for shutdown and startup too instead of the login one.

Did you find this page helpful?