File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 2323gi .require_version ("Adw" , "1" )
2424from gi .repository import Gtk , Adw
2525
26+ from loguru import logger as log
27+
2628class Soundboard (PluginBase ):
2729 def __init__ (self ):
2830 super ().__init__ ()
@@ -43,6 +45,14 @@ def __init__(self):
4345 selected_device = settings .get (Consts .SETTING_DEVICE )
4446 if selected_device is not None :
4547 self .backend .set_device (selected_device )
48+ else :
49+ # Assume this is first time, set the first device found
50+ devices = get_devices (DeviceFilter .SINK )
51+ if len (devices ) > 0 :
52+ settings [Consts .SETTING_DEVICE ] = devices [0 ]
53+ self .set_settings (settings )
54+ else :
55+ log .error ("Failed to find a sound device!" )
4656
4757 ## Register actions
4858 self .play_action_holder = ActionHolder (
You can’t perform that action at this time.
0 commit comments