Giter VIP home page Giter VIP logo

Comments (3)

ironss avatar ironss commented on September 21, 2024

I cannot attach a one-line patch file, so here it is

diff --git a/volctl/slider_win.py b/volctl/slider_win.py
index dfb360a..01f0ecd 100644
--- a/volctl/slider_win.py
+++ b/volctl/slider_win.py
@@ -137,6 +137,8 @@ class VolumeSliders(Gtk.Window):
                 sinks = []
                 sink_inputs = []
 
+            sinks = [ sink for sink in sinks if 'alsa.card_name' in sink.proplist ]
+

from volctl.

ironss avatar ironss commented on September 21, 2024

A better idea is to replace property 'alsa.card_name' with property 'device.description' is the ALSA card name does not exist. Then we do get a volume slider for both sink 'Simultaneous output...' and sink-input 'Simultaneous output...' -- I did not realise that these are two different things.

So, instead of the previous patch, try

diff --git a/volctl/slider_win.py b/volctl/slider_win.py
index dfb360a..ffde03e 100644
--- a/volctl/slider_win.py
+++ b/volctl/slider_win.py
@@ -139,8 +139,13 @@ class VolumeSliders(Gtk.Window):
 
         # Sinks
         for sink in sinks:
+            try:
+                card_name = sink.proplist["alsa.card_name"]
+            except KeyError:
+                card_name = sink.proplist["device.description"]
+
             props = (
-                sink.proplist["alsa.card_name"],
+                card_name,
                 "audio-card",
                 sink.volume.value_flat,
                 sink.mute,

and hope that 'device.description' is always available.

Edit: I see you do something similar (with nested exceptions) in function _name_icon_name_from_sink_input(), when trying to find the name and icon_name for a sink-input.

from volctl.

buzz avatar buzz commented on September 21, 2024

Fixed in 8cd4ef4

from volctl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.