花 - Hana | Nixos dotfiles. Contribute to mobsenpai/hana development by creating an account on GitHub.
Problem -> When doing file transfers (mtp) or running some cli commands like nixos-rebuild, when the hyprlock kicks in they are pause at that point and only resume after unlock.
One thing I am kind of noticing that it may be the systemctl suspend command that is suspending the processes. But overall I am confused with the best combination of pairing both the two programs.
There is no "maybe" here. With systemctl suspend you tell systemd to suspend the whole machine. Most of the hardware will be powered down.
Maybe you should generally separate those concerns? Depends entirely on your usecase, but maybe you want your screenlock to do only that... lock the screen. Then you do not want suspend/sleep in there at all.
I guess OP could change the if statement to check if nixos-rebuild is running, not just check for music being played.
`
music_is_playing=$(pw-cli i all 2>&1 | grep running -q)
# Only suspend if audio isn't running
if [ $music_is_playing == 1 ] && ! pidof nixos-rebuild; then
systemctl suspend
fi
`
But I guess not using the script at all is also an option if putting the PC to sleep is a no-no.