mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-01 18:51:04 +02: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
1 changed files with 4 additions and 1 deletions
|
@ -11,6 +11,7 @@ use stray::StatusNotifierWatcher;
|
||||||
use tokio::spawn;
|
use tokio::spawn;
|
||||||
use tokio::sync::{broadcast, mpsc};
|
use tokio::sync::{broadcast, mpsc};
|
||||||
use tracing::{debug, error, trace};
|
use tracing::{debug, error, trace};
|
||||||
|
use crate::unique_id::get_unique_usize;
|
||||||
|
|
||||||
type Tray = BTreeMap<String, (Box<StatusNotifierItem>, Option<TrayMenu>)>;
|
type Tray = BTreeMap<String, (Box<StatusNotifierItem>, Option<TrayMenu>)>;
|
||||||
|
|
||||||
|
@ -24,11 +25,13 @@ pub struct TrayEventReceiver {
|
||||||
|
|
||||||
impl TrayEventReceiver {
|
impl TrayEventReceiver {
|
||||||
async fn new() -> stray::error::Result<Self> {
|
async fn new() -> stray::error::Result<Self> {
|
||||||
|
let id = format!("ironbar-{}", get_unique_usize());
|
||||||
|
|
||||||
let (tx, rx) = mpsc::channel(16);
|
let (tx, rx) = mpsc::channel(16);
|
||||||
let (b_tx, b_rx) = broadcast::channel(16);
|
let (b_tx, b_rx) = broadcast::channel(16);
|
||||||
|
|
||||||
let tray = StatusNotifierWatcher::new(rx).await?;
|
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()));
|
let tray = Arc::new(Mutex::new(BTreeMap::new()));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue