Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Create a flag to allow multiple instances of the tray icon. #2095

Open
1 task done
aarondill opened this issue Jun 25, 2023 · 20 comments
Open
1 task done
Labels

Comments

@aarondill
Copy link

Version Info

blueman:

> dpkg-query --showformat='Version: ${Version}' --show blueman
Version: 2.2.4-1

BlueZ:

> dpkg-query --showformat='Version: ${Version}' --show bluez
Version: 5.64-0ubuntu1

Distribution:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

Desktop environment: No DE, awesome window manager v4.3

I occasionally run multiple instances of my window manager (in seperate ttys) and would appreciate having full access to my system tray. This could be remedied by adding a flag (--multiple-instances/-m ?) to permit multiple instances of (at least) the tray icon, though, as blueman-applet is what's run, it would also likely be needed to permit multiple instances of the full applet.

This could be implemented by passing Gio.ApplicationFlags.NON_UNIQUE to super().__init__ in the tray as well as in the Main applet.

@aarondill
Copy link
Author

This could look something like this (example for the tray) and would work because the flags are represented as a single integer which are bitwise OR'ed together (and FLAGS_NONE is 0)

class BluemanTray(Gio.Application):
    def __init__(self) -> None:
        app_flags=Gio.ApplicationFlags.FLAGS_NONE
        if (ARGS_HAS_MULTIPLE_INSTANCES) # This needs implementation
            app_flags=app_flags | Gio.ApplicationFlags.NON_UNIQUE
        super().__init__(application_id="org.blueman.Tray", flags=app_flags)
        # ...

@aarondill
Copy link
Author

aarondill commented Jun 25, 2023

One additional note slightly unrelated to this PR, the Gio docs state that FLAGS_NONE is depreciated in favor of DEFAULT_FLAGS in version 2.74. Gio.ApplicationFlags.FLAGS_NONE

According to Dependencies.md, Gio >= 2.32 is still supported, so this change can't be made unless a conditional is put in place (ie, FLAGS_NONE or DEFAULT_FLAGS), but for future reference, I'll put this here.

@cschramm
Copy link
Member

If I get it right, you do have a single D-Bus session bus for multiple desktops, right? Why do you think we need multiple applet processes? One issue that immediately comes to my mind is that only one of them can register the default agent with BlueZ so that only one of the desktops would receive authorization requests and the like.

I absolutely can imagine multiple tray instances with a single applet instance, though.

Being curious: What's your experience with other "tray applications" and multiple window manager instances?

@aarondill
Copy link
Author

I don't particularly need (or want) multiple applet processes, however I figured it might take slightly more processing to launch several trays vs just brute force another applet.

Honestly, D-Bus is a mystery to me. I'm running dbus-launch --exit-with-session -- startx /usr/bin/awesome (automatically 😄) to start each instance, so maybe i'm running separate D-Bus sessions? Idek 🤷‍♂️ \

My experience is exactly half and half funnily enough. diodon, nm-applet, and blueman-applet all only allow one instance, while pasystray, udiskie, and ibus-daemon all permit multiple instances.

@aarondill
Copy link
Author

A few other applications (albeit daemons) that allow multiple instances that I use are: polkit-gnome-authentication-agent-1, picom, notification_daemon, xss-lock.

While it's not super common that I run multiple instances, as I usually just use workspaces (like a sane person 😄), it is useful for debugging my WM, and when I'm struggling with Awesome, It's helpful to have full access to the remainder of my system controls in my system bar.

@infirit
Copy link
Contributor

infirit commented Jun 26, 2023

The current design is that the applet (re)starts the tray. It's not trivial to change this.

@cschramm
Copy link
Member

Yes, I absolutely would not expect it to work out of the box either, e.g. I don't think the communication between one applet instance and multiple tray instances would work as intended.

Anyway, you do seem to have one session bus per desktop. so it's obvious that we'd need one applet per desktop and applet <-> tray would still be 1:1. NON_UNIQUE should not be necessary either, as things are still unique within one session bus then. I'd actually expect it to pretty much work. The only problem you'll definitely see is that only one of the applets can be registered as the default agent to bluetoothd. The newer one wins, so that you'll not get requests on the older desktop as long as you do not restart blueman there.

I just tried and actually dbus-launch blueman-applet --loglevel debug works for me to start additional applet and tray instances (on the same desktop). As expected they do steal and become the default agent and I do see an error when they try to re-register a network server (org.bluez.Error.AlreadyExists).

What issue do you run into?

@aarondill
Copy link
Author

prefixing blueman-applet with dbus-launch does create a second instance, however, I currently run my WM under dbus-launch, and when running blueman-applet --loglevel debug there (without a further dbus-launch) it returns the same output as if run in the older wm, without starting a second instance.

Desktop 1: `> blueman-applet --loglevel debug`
blueman-applet 04.57.32 INFO     PluginManager:85 load_plugin: ['NMPANSupport', 'KillSwitch', 'StatusIcon', 'PPPSupport', 'Menu', 'ExitItem', 'TransferService', 'ShowConnected', 'DBusService', 'SerialManager', 'Battery', 'ConnectionNotifier', 'NMDUNSupport', 'DiscvManager', 'AppIndicator', 'DhcpClient', 'NetUsage', 'RecentConns', 'StandardItems', 'AuthAgent', 'GameControllerWakelock', 'DisconnectItems', 'PowerManager', 'AutoConnect', 'Networking']
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Menu.Menu'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.StatusIcon.StatusIcon'>
blueman-applet 04.57.32 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0 {'Address': 'F0:A6:54:01:D6:A6', 'AddressType': 'public', 'Name': 'aaron-HP-Laptop-15-dy2xxx', 'Alias': 'aaron-HP-Laptop-15-dy2xxx', 'Class': 8126732, 'Powered': True, 'Discoverable': False, 'DiscoverableTimeout': 180, 'Pairable': True, 'PairableTimeout': 0, 'Discovering': False, 'UUIDs': ['0000110e-0000-1000-8000-00805f9b34fb', '0000110a-0000-1000-8000-00805f9b34fb', '00001200-0000-1000-8000-00805f9b34fb', '0000110b-0000-1000-8000-00805f9b34fb', '00001108-0000-1000-8000-00805f9b34fb', '00001133-0000-1000-8000-00805f9b34fb', '0000110c-0000-1000-8000-00805f9b34fb', '0000111f-0000-1000-8000-00805f9b34fb', '00001132-0000-1000-8000-00805f9b34fb', '00001106-0000-1000-8000-00805f9b34fb', '0000112f-0000-1000-8000-00805f9b34fb', '00001104-0000-1000-8000-00805f9b34fb', '00001105-0000-1000-8000-00805f9b34fb', '00005005-0000-1000-8000-0002ee000001'], 'Modalias': 'usb:v1D6Bp0246d0540', 'Roles': ['central', 'peripheral']}
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DBusService.DBusService'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.NMPANSupport.NMPANSupport'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.PowerManager.PowerManager'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.KillSwitch.KillSwitch'>
blueman-applet 04.57.32 WARNING  PluginManager:147 __load_plugin: Not loading PPPSupport because its conflict has higher priority
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ExitItem.ExitItem'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.TransferService.TransferService'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ShowConnected.ShowConnected'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.SerialManager.SerialManager'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Battery.Battery'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ConnectionNotifier.ConnectionNotifier'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.NMDUNSupport.NMDUNSupport'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DiscvManager.DiscvManager'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AppIndicator.AppIndicator'>
blueman-applet 04.57.32 WARNING  PluginManager:147 __load_plugin: Not loading DhcpClient because its conflict has higher priority
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.RecentConns.RecentConns'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.StandardItems.StandardItems'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AuthAgent.AuthAgent'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.GameControllerWakelock.GameControllerWakelock'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DisconnectItems.DisconnectItems'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AutoConnect.AutoConnect'>
blueman-applet 04.57.32 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Networking.Networking'>
blueman-applet 04.57.32 INFO     Networking:35 load_nap_settings: Loading NAP settings
blueman-applet 04.57.33 INFO     KillSwitch:106 io_event  : killswitch registered 1
blueman-applet 04.57.33 INFO     KillSwitch:122 io_event  : State: True
blueman-applet 04.57.33 INFO     PowerManager:178 update_power_state: off False | foff False | on True | current state True | new state True
blueman-applet 04.57.33 INFO     KillSwitch:85 _on_connman_vanished: net.connman vanished
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.Networking.Networking object at 0x7f6691d65f00>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.AutoConnect.AutoConnect object at 0x7f6691d65e10>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.DisconnectItems.DisconnectItems object at 0x7f6691d65db0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.GameControllerWakelock.GameControllerWakelock object at 0x7f6691d65de0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.AuthAgent.AuthAgent object at 0x7f6691d65ea0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.StandardItems.StandardItems object at 0x7f6691d65750>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.RecentConns.RecentConns object at 0x7f6691d65810>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.AppIndicator.AppIndicator object at 0x7f6691d652a0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.DiscvManager.DiscvManager object at 0x7f6691d652d0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.NMDUNSupport.NMDUNSupport object at 0x7f6691d65660>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.ConnectionNotifier.ConnectionNotifier object at 0x7f6691d656c0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.Battery.Battery object at 0x7f6691d65540>
blueman-applet 04.57.33 DEBUG    SerialManager:50 on_delete : Terminating any running scripts
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.SerialManager.SerialManager object at 0x7f6691d655d0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.ShowConnected.ShowConnected object at 0x7f6691d655a0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.TransferService.TransferService object at 0x7f6691d65600>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.ExitItem.ExitItem object at 0x7f6691d653c0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.KillSwitch.KillSwitch object at 0x7f6691d65240>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.PowerManager.PowerManager object at 0x7f6691d651e0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.NMPANSupport.NMPANSupport object at 0x7f6691d65150>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.DBusService.DBusService object at 0x7f66949b66e0>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <StatusIcon.StatusIcon object at 0x7f66926e0f00 (blueman+plugins+applet+StatusIcon+StatusIcon at 0x55d4f89b3040)>
blueman-applet 04.57.33 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.Menu.Menu object at 0x7f66949b66b0>

Desktop 2: `> blueman-applet --loglevel debug`
blueman-applet 04.54.40 INFO     PluginManager:85 load_plugin: ['NMPANSupport', 'KillSwitch', 'StatusIcon', 'PPPSupport', 'Menu', 'ExitItem', 'TransferService', 'ShowConnected', 'DBusService', 'SerialManager', 'Battery', 'ConnectionNotifier', 'NMDUNSupport', 'DiscvManager', 'AppIndicator', 'DhcpClient', 'NetUsage', 'RecentConns', 'StandardItems', 'AuthAgent', 'GameControllerWakelock', 'DisconnectItems', 'PowerManager', 'AutoConnect', 'Networking']
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Menu.Menu'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.StatusIcon.StatusIcon'>
blueman-applet 04.54.40 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0 {'Address': 'F0:A6:54:01:D6:A6', 'AddressType': 'public', 'Name': 'aaron-HP-Laptop-15-dy2xxx', 'Alias': 'aaron-HP-Laptop-15-dy2xxx', 'Class': 8126732, 'Powered': True, 'Discoverable': False, 'DiscoverableTimeout': 180, 'Pairable': True, 'PairableTimeout': 0, 'Discovering': False, 'UUIDs': ['0000110e-0000-1000-8000-00805f9b34fb', '0000110a-0000-1000-8000-00805f9b34fb', '00001200-0000-1000-8000-00805f9b34fb', '0000110b-0000-1000-8000-00805f9b34fb', '00001108-0000-1000-8000-00805f9b34fb', '00001133-0000-1000-8000-00805f9b34fb', '0000110c-0000-1000-8000-00805f9b34fb', '0000111f-0000-1000-8000-00805f9b34fb', '00001132-0000-1000-8000-00805f9b34fb', '00001106-0000-1000-8000-00805f9b34fb', '0000112f-0000-1000-8000-00805f9b34fb', '00001104-0000-1000-8000-00805f9b34fb', '00001105-0000-1000-8000-00805f9b34fb', '00005005-0000-1000-8000-0002ee000001'], 'Modalias': 'usb:v1D6Bp0246d0540', 'Roles': ['central', 'peripheral']}
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DBusService.DBusService'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.NMPANSupport.NMPANSupport'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.PowerManager.PowerManager'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.KillSwitch.KillSwitch'>
blueman-applet 04.54.40 WARNING  PluginManager:147 __load_plugin: Not loading PPPSupport because its conflict has higher priority
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ExitItem.ExitItem'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.TransferService.TransferService'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ShowConnected.ShowConnected'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.SerialManager.SerialManager'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Battery.Battery'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ConnectionNotifier.ConnectionNotifier'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.NMDUNSupport.NMDUNSupport'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DiscvManager.DiscvManager'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AppIndicator.AppIndicator'>
blueman-applet 04.54.40 WARNING  PluginManager:147 __load_plugin: Not loading DhcpClient because its conflict has higher priority
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.RecentConns.RecentConns'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.StandardItems.StandardItems'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AuthAgent.AuthAgent'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.GameControllerWakelock.GameControllerWakelock'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DisconnectItems.DisconnectItems'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AutoConnect.AutoConnect'>
blueman-applet 04.54.40 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Networking.Networking'>
blueman-applet 04.54.40 INFO     Networking:35 load_nap_settings: Loading NAP settings
blueman-applet 04.54.40 INFO     KillSwitch:106 io_event  : killswitch registered 1
blueman-applet 04.54.40 INFO     KillSwitch:122 io_event  : State: True
blueman-applet 04.54.40 INFO     PowerManager:178 update_power_state: off False | foff False | on True | current state True | new state True
blueman-applet 04.54.40 INFO     KillSwitch:85 _on_connman_vanished: net.connman vanished
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.Networking.Networking object at 0x7fbe26fd1f30>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.AutoConnect.AutoConnect object at 0x7fbe26fd1e40>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.DisconnectItems.DisconnectItems object at 0x7fbe26fd1de0>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.GameControllerWakelock.GameControllerWakelock object at 0x7fbe26fd1e10>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.AuthAgent.AuthAgent object at 0x7fbe26fd1ed0>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.StandardItems.StandardItems object at 0x7fbe26fd1780>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.RecentConns.RecentConns object at 0x7fbe26fd1840>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.AppIndicator.AppIndicator object at 0x7fbe26fd12d0>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.DiscvManager.DiscvManager object at 0x7fbe26fd1300>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.NMDUNSupport.NMDUNSupport object at 0x7fbe26fd1690>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.ConnectionNotifier.ConnectionNotifier object at 0x7fbe26fd16f0>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.Battery.Battery object at 0x7fbe26fd1570>
blueman-applet 04.54.40 DEBUG    SerialManager:50 on_delete : Terminating any running scripts
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.SerialManager.SerialManager object at 0x7fbe26fd1600>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.ShowConnected.ShowConnected object at 0x7fbe26fd15d0>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.TransferService.TransferService object at 0x7fbe26fd1630>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.ExitItem.ExitItem object at 0x7fbe26fd13f0>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.KillSwitch.KillSwitch object at 0x7fbe26fd1270>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.PowerManager.PowerManager object at 0x7fbe26fd1210>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.NMPANSupport.NMPANSupport object at 0x7fbe26fd1180>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.DBusService.DBusService object at 0x7fbe35c1a710>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <StatusIcon.StatusIcon object at 0x7fbe3708cdc0 (blueman+plugins+applet+StatusIcon+StatusIcon at 0x561e0f496da0)>
blueman-applet 04.54.40 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.applet.Menu.Menu object at 0x7fbe35c1a6e0>

@cschramm
Copy link
Member

🤔 I'm puzzled why it quits on the second desktop. Just tried and successfully started blueman on a separate desktop without any tricks (also tried 2.2.4 but I might have done something wrong there, so no guarantees). Are you sure that there's only a single blueman-applet process from the first one?

Does Gio.ApplicationFlags.NON_UNIQUE help to get it starting on the second desktop?

@aarondill
Copy link
Author

aarondill commented Jun 27, 2023

running this to replace both instances of FLAGS_NONE with NON_UNIQUE:

> cd /usr/lib/python3/dist-packages/blueman/
> rg 'Gio.ApplicationFlags.FLAGS_NONE' -l | xargs -n1 sudo sed -i 's/Gio.ApplicationFlags.FLAGS_NONE/Gio.ApplicationFlags.NON_UNIQUE/g' 
Desktop 1: `blueman-applet` (this is normal)
blueman-applet 13.53.09 WARNING  PluginManager:147 __load_plugin: Not loading PPPSupport because its conflict has higher priority
blueman-applet 13.53.09 WARNING  PluginManager:147 __load_plugin: Not loading DhcpClient because its conflict has higher priority
Desktop 2: `blueman-applet` (Second Instance Started)
blueman-applet 13.51.43 WARNING  PluginManager:147 __load_plugin: Not loading PPPSupport because its conflict has higher priority
blueman-applet 13.51.43 WARNING  PluginManager:147 __load_plugin: Not loading DhcpClient because its conflict has higher priority
blueman-applet 13.51.43 ERROR    AgentManager:20 on_register_failed: /org/bluez/obex/agent/blueman org.bluez.obex.Error.AlreadyExists Agent already exists

Interestingly, if I close the first instance (ctrl+c), I get this error on the second:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/blueman/main/Tray.py", line 27, in _on_name_appeared
    indicator_name = applet.GetStatusIconImplementation()
  File "/usr/lib/python3/dist-packages/gi/overrides/Gio.py", line 349, in __call__
    result = self.dbus_proxy.call_sync(self.method_name, arg_variant,
gi.repository.GLib.GError: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name :1.100 was not provided by any .service files (2)

@aarondill
Copy link
Author

After that error, the tray dies, but the applet seems to survive. manually running blueman-tray revives my tray icon and everything (seems) to return to working order.

@aarondill
Copy link
Author

I tested running two instances, and it seems to be able to (at least) do all the major actions (connect/disconnect) and both instances handle updating the icon and tray states fine.

@aarondill
Copy link
Author

Here is some debug output. Oddly enough, this time, I didn't get the tray exception...

Please note that the ----MESSAGE---- lines were added by me (using printf '%s\n' "MESSAGE" >>file).

Desktop 1: `blueman-applet --loglevel debug` (this is normal)
blueman-applet --loglevel debug >>file1 2>&1 & PID=$! && echo $PIDblueman-applet 14.20.23 INFO     PluginManager:85 load_plugin: ['NMPANSupport', 'KillSwitch', 'StatusIcon', 'PPPSupport', 'Menu', 'ExitItem', 'TransferService', 'ShowConnected', 'DBusService', 'SerialManager', 'Battery', 'ConnectionNotifier', 'NMDUNSupport', 'DiscvManager', 'AppIndicator', 'DhcpClient', 'NetUsage', 'RecentConns', 'StandardItems', 'AuthAgent', 'GameControllerWakelock', 'DisconnectItems', 'PowerManager', 'AutoConnect', 'Networking']
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Menu.Menu'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.StatusIcon.StatusIcon'>
blueman-applet 14.20.23 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0 {'Address': 'F0:A6:54:01:D6:A6', 'AddressType': 'public', 'Name': 'aaron-HP-Laptop-15-dy2xxx', 'Alias': 'aaron-HP-Laptop-15-dy2xxx', 'Class': 8126732, 'Powered': True, 'Discoverable': False, 'DiscoverableTimeout': 180, 'Pairable': False, 'PairableTimeout': 0, 'Discovering': False, 'UUIDs': ['0000110e-0000-1000-8000-00805f9b34fb', '0000110a-0000-1000-8000-00805f9b34fb', '00001200-0000-1000-8000-00805f9b34fb', '0000110b-0000-1000-8000-00805f9b34fb', '00001108-0000-1000-8000-00805f9b34fb', '00001133-0000-1000-8000-00805f9b34fb', '0000110c-0000-1000-8000-00805f9b34fb', '0000111f-0000-1000-8000-00805f9b34fb', '00001132-0000-1000-8000-00805f9b34fb', '00001106-0000-1000-8000-00805f9b34fb', '0000112f-0000-1000-8000-00805f9b34fb', '00001104-0000-1000-8000-00805f9b34fb', '00001105-0000-1000-8000-00805f9b34fb', '00005005-0000-1000-8000-0002ee000001'], 'Modalias': 'usb:v1D6Bp0246d0540', 'Roles': ['central', 'peripheral']}
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DBusService.DBusService'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.NMPANSupport.NMPANSupport'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.PowerManager.PowerManager'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.KillSwitch.KillSwitch'>
blueman-applet 14.20.23 WARNING  PluginManager:147 __load_plugin: Not loading PPPSupport because its conflict has higher priority
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ExitItem.ExitItem'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.TransferService.TransferService'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ShowConnected.ShowConnected'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.SerialManager.SerialManager'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Battery.Battery'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ConnectionNotifier.ConnectionNotifier'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.NMDUNSupport.NMDUNSupport'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DiscvManager.DiscvManager'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AppIndicator.AppIndicator'>
blueman-applet 14.20.23 WARNING  PluginManager:147 __load_plugin: Not loading DhcpClient because its conflict has higher priority
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.RecentConns.RecentConns'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.StandardItems.StandardItems'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AuthAgent.AuthAgent'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.GameControllerWakelock.GameControllerWakelock'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DisconnectItems.DisconnectItems'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AutoConnect.AutoConnect'>
blueman-applet 14.20.23 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Networking.Networking'>
blueman-applet 14.20.23 INFO     Networking:35 load_nap_settings: Loading NAP settings
blueman-applet 14.20.23 INFO     KillSwitch:106 io_event  : killswitch registered 1
blueman-applet 14.20.23 INFO     KillSwitch:122 io_event  : State: True
blueman-applet 14.20.23 INFO     PowerManager:178 update_power_state: off False | foff False | on True | current state True | new state True
blueman-applet 14.20.23 INFO     KillSwitch:85 _on_connman_vanished: net.connman vanished
blueman-applet 14.20.23 INFO     TransferService:234 _on_dbus_name_appeared: org.bluez.obex :1.53
blueman-applet 14.20.23 INFO     Applet:54 _on_dbus_name_appeared: org.bluez :1.32
blueman-applet 14.20.23 INFO     Functions:114 launch    : Gtk eventtime is 0, not using LaunchContext
blueman-applet 14.20.23 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_AC_1D_06_C0_03_70 {'Address': 'AC:1D:06:C0:03:70', 'AddressType': 'public', 'Name': 'Aaron’s AirPods Pro', 'Alias': 'Aaron’s AirPods Pro', 'Class': 2360344, 'Icon': 'audio-headphones', 'Paired': True, 'Trusted': True, 'Blocked': False, 'LegacyPairing': False, 'Connected': False, 'UUIDs': ['00001000-0000-1000-8000-00805f9b34fb', '0000110b-0000-1000-8000-00805f9b34fb', '0000110c-0000-1000-8000-00805f9b34fb', '0000110d-0000-1000-8000-00805f9b34fb', '0000110e-0000-1000-8000-00805f9b34fb', '0000111e-0000-1000-8000-00805f9b34fb', '00001200-0000-1000-8000-00805f9b34fb', '74ec2172-0bad-4d01-8f77-997b2be0722a'], 'Modalias': 'bluetooth:v004Cp200EdB087', 'Adapter': '/org/bluez/hci0', 'ServicesResolved': False}
blueman-applet 14.20.23 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_90_89_5F_14_3B_DA {'Address': '90:89:5F:14:3B:DA', 'AddressType': 'public', 'Name': 'Wireless Controller', 'Alias': 'Wireless Controller', 'Class': 9480, 'Icon': 'input-gaming', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'Connected': False, 'UUIDs': ['00001124-0000-1000-8000-00805f9b34fb', '00001200-0000-1000-8000-00805f9b34fb'], 'Modalias': 'usb:v054Cp09CCd0100', 'Adapter': '/org/bluez/hci0', 'ServicesResolved': False, 'WakeAllowed': True}
blueman-applet 14.20.23 INFO     RecentConns:107 initialize: rebuilding menu
blueman-applet 14.20.23 INFO     BluezAgent:56 register_agent: Register Agent
blueman-applet 14.20.23 INFO     Networking:71 set_nap   : set nap False
blueman-applet 14.20.23 INFO     AgentManager:17 on_registered: /org/bluez/obex/agent/blueman
blueman-applet 14.20.23 INFO     ShowConnected:50 enumerate_connections: Found 0 existing connections
blueman-applet 14.20.23 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0 {'Pairable': True}
blueman-applet 14.20.23 DEBUG    DiscvManager:92 on_adapter_property_changed: prop Pairable True

(blueman-tray:20868): Gdk-CRITICAL **: 14:20:24.274: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
---STARTING SECOND INSTANCE---
---KILLING FIRST INSTANCE---

Desktop 2: `blueman-applet --loglevel debug` (Second Instance)
blueman-applet --loglevel debug >>file2 2>&1 & PID=$! && echo $PIDblueman-applet 14.21.20 INFO     PluginManager:85 load_plugin: ['NMPANSupport', 'KillSwitch', 'StatusIcon', 'PPPSupport', 'Menu', 'ExitItem', 'TransferService', 'ShowConnected', 'DBusService', 'SerialManager', 'Battery', 'ConnectionNotifier', 'NMDUNSupport', 'DiscvManager', 'AppIndicator', 'DhcpClient', 'NetUsage', 'RecentConns', 'StandardItems', 'AuthAgent', 'GameControllerWakelock', 'DisconnectItems', 'PowerManager', 'AutoConnect', 'Networking']
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Menu.Menu'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.StatusIcon.StatusIcon'>
blueman-applet 14.21.20 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0 {'Address': 'F0:A6:54:01:D6:A6', 'AddressType': 'public', 'Name': 'aaron-HP-Laptop-15-dy2xxx', 'Alias': 'aaron-HP-Laptop-15-dy2xxx', 'Class': 8126732, 'Powered': True, 'Discoverable': False, 'DiscoverableTimeout': 180, 'Pairable': True, 'PairableTimeout': 0, 'Discovering': False, 'UUIDs': ['0000110e-0000-1000-8000-00805f9b34fb', '0000110a-0000-1000-8000-00805f9b34fb', '00001200-0000-1000-8000-00805f9b34fb', '0000110b-0000-1000-8000-00805f9b34fb', '00001108-0000-1000-8000-00805f9b34fb', '00001133-0000-1000-8000-00805f9b34fb', '0000110c-0000-1000-8000-00805f9b34fb', '0000111f-0000-1000-8000-00805f9b34fb', '00001132-0000-1000-8000-00805f9b34fb', '00001106-0000-1000-8000-00805f9b34fb', '0000112f-0000-1000-8000-00805f9b34fb', '00001104-0000-1000-8000-00805f9b34fb', '00001105-0000-1000-8000-00805f9b34fb', '00005005-0000-1000-8000-0002ee000001'], 'Modalias': 'usb:v1D6Bp0246d0540', 'Roles': ['central', 'peripheral']}
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DBusService.DBusService'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.NMPANSupport.NMPANSupport'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.PowerManager.PowerManager'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.KillSwitch.KillSwitch'>
blueman-applet 14.21.20 WARNING  PluginManager:147 __load_plugin: Not loading PPPSupport because its conflict has higher priority
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ExitItem.ExitItem'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.TransferService.TransferService'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ShowConnected.ShowConnected'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.SerialManager.SerialManager'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Battery.Battery'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.ConnectionNotifier.ConnectionNotifier'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.NMDUNSupport.NMDUNSupport'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DiscvManager.DiscvManager'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AppIndicator.AppIndicator'>
blueman-applet 14.21.20 WARNING  PluginManager:147 __load_plugin: Not loading DhcpClient because its conflict has higher priority
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.RecentConns.RecentConns'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.StandardItems.StandardItems'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AuthAgent.AuthAgent'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.GameControllerWakelock.GameControllerWakelock'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.DisconnectItems.DisconnectItems'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.AutoConnect.AutoConnect'>
blueman-applet 14.21.20 INFO     PluginManager:156 __load_plugin: loading <class 'blueman.plugins.applet.Networking.Networking'>
blueman-applet 14.21.20 INFO     Networking:35 load_nap_settings: Loading NAP settings
blueman-applet 14.21.20 INFO     KillSwitch:106 io_event  : killswitch registered 1
blueman-applet 14.21.20 INFO     KillSwitch:122 io_event  : State: True
blueman-applet 14.21.20 INFO     PowerManager:178 update_power_state: off False | foff False | on True | current state True | new state True
blueman-applet 14.21.20 INFO     KillSwitch:85 _on_connman_vanished: net.connman vanished
blueman-applet 14.21.20 INFO     TransferService:234 _on_dbus_name_appeared: org.bluez.obex :1.53
blueman-applet 14.21.20 INFO     Applet:54 _on_dbus_name_appeared: org.bluez :1.32
blueman-applet 14.21.20 INFO     Functions:114 launch    : Gtk eventtime is 0, not using LaunchContext
blueman-applet 14.21.20 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_AC_1D_06_C0_03_70 {'Address': 'AC:1D:06:C0:03:70', 'AddressType': 'public', 'Name': 'Aaron’s AirPods Pro', 'Alias': 'Aaron’s AirPods Pro', 'Class': 2360344, 'Icon': 'audio-headphones', 'Paired': True, 'Trusted': True, 'Blocked': False, 'LegacyPairing': False, 'Connected': False, 'UUIDs': ['00001000-0000-1000-8000-00805f9b34fb', '0000110b-0000-1000-8000-00805f9b34fb', '0000110c-0000-1000-8000-00805f9b34fb', '0000110d-0000-1000-8000-00805f9b34fb', '0000110e-0000-1000-8000-00805f9b34fb', '0000111e-0000-1000-8000-00805f9b34fb', '00001200-0000-1000-8000-00805f9b34fb', '74ec2172-0bad-4d01-8f77-997b2be0722a'], 'Modalias': 'bluetooth:v004Cp200EdB087', 'Adapter': '/org/bluez/hci0', 'ServicesResolved': False}
blueman-applet 14.21.20 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_90_89_5F_14_3B_DA {'Address': '90:89:5F:14:3B:DA', 'AddressType': 'public', 'Name': 'Wireless Controller', 'Alias': 'Wireless Controller', 'Class': 9480, 'Icon': 'input-gaming', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'Connected': False, 'UUIDs': ['00001124-0000-1000-8000-00805f9b34fb', '00001200-0000-1000-8000-00805f9b34fb'], 'Modalias': 'usb:v054Cp09CCd0100', 'Adapter': '/org/bluez/hci0', 'ServicesResolved': False, 'WakeAllowed': True}
blueman-applet 14.21.20 INFO     RecentConns:107 initialize: rebuilding menu
blueman-applet 14.21.20 INFO     BluezAgent:56 register_agent: Register Agent
blueman-applet 14.21.20 INFO     Networking:71 set_nap   : set nap False
blueman-applet 14.21.20 ERROR    AgentManager:20 on_register_failed: /org/bluez/obex/agent/blueman org.bluez.obex.Error.AlreadyExists Agent already exists
blueman-applet 14.21.20 INFO     ShowConnected:50 enumerate_connections: Found 0 existing connections

(blueman-tray:21827): Gdk-CRITICAL **: 14:21:21.272: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
---KILLING FIRST INSTANCE---
--KILLING-SECOND-INSTANCE--

@cschramm
Copy link
Member

Seems like the same session bus then. Without NON_UNIQUE a second instance fails to register the name and with non-unique instances the tray process is confused. 😄

Within a single session bus the way to go would rather be a single applet with multiple tray instances, i.e. setting NON_UNIQUE for the tray application only and starting it for each desktop. A quick test with non-unique tray instances just worked fine on my end.

However, from #2095 (comment) and my experiments with that, I'd clearly expect one session bus per desktop. 🤔

@aarondill
Copy link
Author

I really couldn't explain to you my DBus setup. Like I said, Dbus is black magic to me, and I'm not even sure why I'm running dbus-launch. I saw it in the /xsession.d/* files, so I copied it into my start script.

@cschramm
Copy link
Member

Alright, so, assuming that the target is multi-desktop, single-session-bus, I think the way to go is setting NON_UNIQUE for the tray application (but not the applet) so that GLib does not get in your way when you start blueman-tray on each desktop (with the respective $DISPLAY). I guess it should just work, but there might be some issues, of course.

I agree that NON_UNIQUE should be behind a special option as in standard cases GLib does a good job for us to avoid duplicate icons. Probably there's exactly one user for the option, but it should not hurt, so why not. 😄

@infirit
Copy link
Contributor

infirit commented Jun 28, 2023

My thoughts go to using the XDG_CURRENT_DESKTOP environment variable to spawn new tray applets instead of NON_UNIQUE. Any well behaved desktop setup should set this. Not sure how well behaved these tiling ones are though 🤔

@cschramm
Copy link
Member

awesome does not seem to set that and even if it would I'd just expect the same value for all instances. Maybe I don't get the idea yet, though. 😅

What should differ is $DISPLAY. Ideally tray would support at most one instance per $DISPLAY.

@infirit
Copy link
Contributor

infirit commented Jun 28, 2023

Ooh, I didn't pickup that it's the same desktop 😅. Yeah, then DISPLAY may be a good alternative.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 28, 2023
@cschramm cschramm added feature and removed stale labels Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants