2018-12-02 23:43:08 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
volume = subprocess.check_output([
|
|
|
|
'pulsemixer', '--get-volume',
|
|
|
|
]).decode('utf-8').strip().split(' ')
|
|
|
|
minvol = min([int(i) for i in volume])
|
|
|
|
|
|
|
|
mute = int(subprocess.check_output([
|
|
|
|
'pulsemixer', '--get-mute',
|
|
|
|
]).decode('utf-8').strip()) == 1
|
|
|
|
|
2022-09-02 13:53:43 +00:00
|
|
|
icon = '\uf6a9' if mute else '\uf6a8'
|
2018-12-02 23:43:08 +00:00
|
|
|
text = '{} {}%'.format(icon, minvol)
|
2022-09-02 13:53:43 +00:00
|
|
|
color = '#7f7f7f' if mute else '#ffffff'
|
2018-12-02 23:43:08 +00:00
|
|
|
|
|
|
|
print('\n'.join([
|
|
|
|
text,
|
|
|
|
text,
|
|
|
|
color,
|
|
|
|
]))
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|