cleaned up the script to check for xdotool and irxevent