#!/usr/bin/env bash
set -euo pipefail

systemctl --user daemon-reload

shopt -s nullglob
for xml in "$HOME"/.config/libvirt/qemu/*.xml; do
  virsh -c qemu:///session define "$xml" >/dev/null
done

if command -v update-desktop-database >/dev/null 2>&1; then
  update-desktop-database "$HOME/.local/share/applications"
fi

printf 'priority policy loaded; restart Discord, FreeTube, virt-manager, and active VMs\n'
