Skip to content

Instantly share code, notes, and snippets.

@Eightyplus
Last active January 9, 2019 11:30
Show Gist options
  • Save Eightyplus/0992c15b937af27745e7ad3df219ea56 to your computer and use it in GitHub Desktop.
Save Eightyplus/0992c15b937af27745e7ad3df219ea56 to your computer and use it in GitHub Desktop.
raspberry pi starting tvservice based on connected devices
#!/bin/sh
# edit /etc/rc.local
wifi_loaded=`dmesg | grep "ieee80211"`
if [ -n "$wifi_loaded" ]; then
/usr/bin/tvservice -o
fi
@Eightyplus
Copy link
Author

or something like

keyboard_present=`dmesg | grep -i "usb keyboard"`

if [ -z "$keyboard_present" ]; then
     /usr/bin/tvservice -o
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment