#!/bin/bash # tests for the presence of a USB keyboard by checking the output of # the 'lsusb' command. will run hotkeys if the keyboard is plugged in. # # adapt the pattern ('Logic3') to your keyboard. # written by spirit. if [ ! -z "$(lsusb | grep Logic3)" ]; then echo "hotkey-startscript : keyboard detected, running hotkeys..." hotkeys else echo "hotkey-startscript : no keyboard detected." fi