#!/usr/bin/env bash set -e SECONDS=0 if systemctl status keyd.service; then DEV_JS='/dev/input/js1' else DEV_JS='/dev/input/js0' fi if [[ ! -c "${DEV_JS}" ]]; then hyprctl notify 2 5000 0 'Connect joystick to continue.' sleep 1.5 until [[ -c "${DEV_JS}" ]]; do if (( SECONDS > 30 )); then hyprctl notify 3 5000 0 'No joystick detected.' exit 1 fi sleep 0.5 done sleep 1.5 fi exec "$@"