![](/static/253f0d9/assets/icons/icon-96x96.png)
![](https://lemmy.ml/pictrs/image/q98XK4sKtw.png)
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.
Actually I want to use the wireguard tunnel regardless because right now I am tunneling VNC through SSH, which is laggy because it’s TCP. But thanks either way.