Add optoon to get audio sinks and the default audio sink.
This commit is contained in:
parent
6ddd91e339
commit
d00cc46aaf
1 changed files with 11 additions and 3 deletions
14
main.py
14
main.py
|
@ -24,8 +24,6 @@ def bluetooth_connect(args):
|
||||||
print("%s",process.stderr)
|
print("%s",process.stderr)
|
||||||
|
|
||||||
def pipewire_list(args):
|
def pipewire_list(args):
|
||||||
print(args)
|
|
||||||
|
|
||||||
print("ID | Description")
|
print("ID | Description")
|
||||||
print("----------------")
|
print("----------------")
|
||||||
|
|
||||||
|
@ -33,6 +31,13 @@ def pipewire_list(args):
|
||||||
for sink in sinks:
|
for sink in sinks:
|
||||||
print(str(sink['id']) + " | " + sink['info']['props']['node.description'])
|
print(str(sink['id']) + " | " + sink['info']['props']['node.description'])
|
||||||
|
|
||||||
|
def pipewire_get_default_sink(args):
|
||||||
|
print("ID | Description")
|
||||||
|
print("----------------")
|
||||||
|
|
||||||
|
sink = Pipewire.get_default_audio_sink()
|
||||||
|
print(str(sink['id']) + " | " + sink['info']['props']['node.description'])
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
argparser = argparse.ArgumentParser(description='CarPI CLI.')
|
argparser = argparse.ArgumentParser(description='CarPI CLI.')
|
||||||
|
|
||||||
|
@ -44,11 +49,14 @@ def main():
|
||||||
|
|
||||||
action_bt_connect = actions.add_parser('bluetooth-connect', help='connect to a bluetooth device')
|
action_bt_connect = actions.add_parser('bluetooth-connect', help='connect to a bluetooth device')
|
||||||
action_bt_connect.set_defaults(func=bluetooth_connect)
|
action_bt_connect.set_defaults(func=bluetooth_connect)
|
||||||
action_bt_connect.add_argument('address', help='The bluetooth address of the device to connect to.')
|
action_bt_connect.add_argument('address', help='the bluetooth address of the device to connect to.')
|
||||||
|
|
||||||
action_pw_list = actions.add_parser('pipewire-list', help='list pipewire objects')
|
action_pw_list = actions.add_parser('pipewire-list', help='list pipewire objects')
|
||||||
action_pw_list.set_defaults(func=pipewire_list)
|
action_pw_list.set_defaults(func=pipewire_list)
|
||||||
|
|
||||||
|
action_pw_get_default_sink = actions.add_parser('pipewire-get-default-sink', help='show the default audio sink')
|
||||||
|
action_pw_get_default_sink.set_defaults(func=pipewire_get_default_sink)
|
||||||
|
|
||||||
args = argparser.parse_args()
|
args = argparser.parse_args()
|
||||||
args.func(args)
|
args.func(args)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue