You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
466 B

#!/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 "$@"