-
-
Save j6k4m8/e66c8807277615c0a3d7858b04654eda to your computer and use it in GitHub Desktop.
rpi scripts
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/env python | |
import os | |
import sys | |
import subprocess | |
if (sys.argv[1] == 'on'): | |
subprocess.check_output('/opt/vc/bin/tvservice -p', shell=True) | |
if len(sys.argv) > 2 and sys.argv[2] == "up": | |
subprocess.check_output('sudo startx /usr/bin/graphical_launcher `fgconsole`', shell=True) | |
elif (sys.argv[1] == 'off'): | |
subprocess.check_output('/opt/vc/bin/tvservice -o', shell=True) |
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/env python | |
import subprocess | |
import sys | |
if len(sys.argv) > 1: | |
subprocess.check_output("amixer sset 'PCM' {}%".format(sys.argv[1]), shell=True) | |
else: | |
print(subprocess.check_output("amixer get 'PCM' | grep | |
'%'", shell=True).split()[3].strip('[]')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment