User:Alydev/virsh pipewire autostart

From ArchWiki

I didn't want to change Pipewire to running as a system daemon. This is my workaround. After booting with my PCI Passthrough boot option (User:Alydev/vfio grub toggle), I press ctrl+alt+f3, this takes me to the autologin shell, in which bashrc detects that vfio is loaded and starts the win10 VM if not already running. Obvious caveat is the security issue of autologin. But anyone with physical access to the VT already has access what's the difference.

/etc/systemd/system/getty@tty3.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin aly %I $TERM
$HOME/.bashrc
export LIBVIRT_DEFAULT_URI=qemu:///system
[ "$(tty)" == "/dev/tty3" ] && [ -e "/sys/bus/pci/drivers/vfio-pci/0000:01:00.0" ] && [ "$(virsh list | grep win10 | awk '{print $NF}')" != "running" ] && virsh start win10
if [ -n "$SSH_CONNECTION" ] && [ -n "$DISPLAY" ]; then
        export SSH_GUEST=$(awk '{print $1}' <<< "$SSH_CONNECTION")
        export DISPLAY=$SSH_GUEST:0
fi