add idea for an alternative volume information
This commit is contained in:
2
README
2
README
@@ -2,6 +2,8 @@ Install
|
||||
|
||||
pip install --user -e .
|
||||
|
||||
Requirements:
|
||||
- For volume buttons: libpulse
|
||||
|
||||
Uninstall
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user