clean up
is_usb_hid
add has_bat
use awk
synced with upstream