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

in the Unit section and
WantedBy=suspend.target

in the Install section

I suppose you can do the same with Before
Was this page helpful?