add idea for an alternative volume information

This commit is contained in:
2021-04-03 23:15:05 +02:00
parent 63691dde66
commit 37358ec8d4
3 changed files with 14 additions and 2 deletions

2
README
View File

@@ -2,6 +2,8 @@ Install
pip install --user -e .
Requirements:
- For volume buttons: libpulse
Uninstall

View File

@@ -19,12 +19,20 @@ def process(args):
print(f"{e} failed!")
def volume(name):
return process(f'pamixer --get-volume --sink "{name}"')
try:
return process(f'pamixer --get-volume --sink "{name}"')
except OSError as e:
#n = process(r"pactl list sinks short | awk '{print $2}'").split()
#v = process(r"pactl list sinks | grep '^[[:space:]]Volume:' | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'").split()
#return v[n.index(name)]
print(e)
def volume_decrease(name):
#process(f'pactl set-sink-volume "{name}" -5db')
return process(f'pamixer --get-volume --sink "{name}" --decrease 5')
def volume_increase(name):
#process(f'pactl set-sink-volume "{name}" -5db')
return process(f'pamixer --get-volume --sink "{name}" --increase 5')
class Button(Div):

View File

@@ -4,7 +4,9 @@
# name = sink_name
# : N. optional group/row specification
# : NAME name of the button
# : name sink name, see name with: pamixer --list-sinks
# : name sink name, see name with either:
# pactl list sinks short
# pamixer --list-sinks
#
# [N.button.NAME]
# command = shell command