Created
June 21, 2022 16:24
-
-
Save mnakama/270eaee7fb504fe3c4767fa2234f6dcf to your computer and use it in GitHub Desktop.
Disable all Oculus Rift devices and sensors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
'''Disable all Oculus Rift devices and sensors | |
Run this script as root to disable all Rift sensors so broken websites like Google Meet won't try to use them.''' | |
import os | |
import os.path | |
def main(): | |
basedir = '/sys/bus/usb/devices' | |
devs = os.listdir(basedir) | |
for dev in devs: | |
if ':' in dev or '.' in dev: | |
continue | |
try: | |
vendor = open(os.path.join(basedir, dev, 'idVendor')).read().strip() | |
except FileNotFoundError: | |
continue | |
if vendor == '2833': | |
#print('dev enabled:', '' != open(os.path.join(basedir, dev, 'bConfigurationValue'), 'r').read().strip()) | |
with open(os.path.join(basedir, dev, 'bConfigurationValue'), 'w') as f: | |
f.write('0') | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment