-
-
Save j6k4m8/002b3219e5a52e6873fc49b670e329bf to your computer and use it in GitHub Desktop.
Raspberry Pi Volume Control. Use with `vol 70` for 70% volume
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