mirror of
https://github.com/JakeStanger/ironbar.git
synced 2024-11-26 09:02:26 +03:00
fix(tray): (maybe?) sometimes bus name is taken
No idea if this fix actually does anything but no harm in it I guess.
This commit is contained in:
parent
b3b96673b0
commit
de98cf3dae
@ -11,6 +11,7 @@ use stray::StatusNotifierWatcher;
|
||||
use tokio::spawn;
|
||||
use tokio::sync::{broadcast, mpsc};
|
||||
use tracing::{debug, error, trace};
|
||||
use crate::unique_id::get_unique_usize;
|
||||
|
||||
type Tray = BTreeMap<String, (Box<StatusNotifierItem>, Option<TrayMenu>)>;
|
||||
|
||||
@ -24,11 +25,13 @@ pub struct TrayEventReceiver {
|
||||
|
||||
impl TrayEventReceiver {
|
||||
async fn new() -> stray::error::Result<Self> {
|
||||
let id = format!("ironbar-{}", get_unique_usize());
|
||||
|
||||
let (tx, rx) = mpsc::channel(16);
|
||||
let (b_tx, b_rx) = broadcast::channel(16);
|
||||
|
||||
let tray = StatusNotifierWatcher::new(rx).await?;
|
||||
let mut host = tray.create_notifier_host("ironbar").await?;
|
||||
let mut host = tray.create_notifier_host(&id).await?;
|
||||
|
||||
let tray = Arc::new(Mutex::new(BTreeMap::new()));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user