dotfiles/config/shared/bin/vm-switch-daemon
2025-10-20 19:17:11 +02:00

12 lines
230 B
Bash
Executable File

#!/usr/bin/env bash
file=/tmp/vm-switch.txt
# Ensure the file exists
touch "$file"
echo "Listening on $file ..."
tail -n0 -F "$file" | while read vm; do
[ -n "$vm" ] && echo "Switch requested: $vm" && ~/bin/work "$vm" &
done