set -x

# This service appears to have issues when system sleeps - start service
systemctl -M 'cspark@' --user start mpd-discord-rpc.service

# My audio interface has issues after coming out from a suspended type state, this will reset it to fix it when necessary.
modprobe snd_usb_audio
# Rebind audio interface
echo `grep 0a73 /sys/bus/usb/devices/*/idVendor | cut -d '/' -f 6` > /sys/bus/usb/drivers/usb/bind

# Remove vfio modules
modprobe -r vfio_pci
modprobe -r vfio

# Re-add amdgpu
modprobe amdgpu

# Avoid race condition whilst re-initalising amdgpu driver
sleep 5

# Restart Display Manager
systemctl start display-manager
