Skip to content

Commit

Permalink
Merge pull request #5 from nate131/ubuntu_tray_fix
Browse files Browse the repository at this point in the history
Resolves ksni issues in Ubuntu & adding additional menu for battery
  • Loading branch information
LennardKittner authored May 29, 2024
2 parents 1f3e438 + 5944745 commit 8a1ec7b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/battery_tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,18 @@ impl BatteryTray {

impl Tray for BatteryTray {
fn icon_name(&self) -> String {
"headset".into()
"audio-headset".into()
}
fn id(&self) -> String {
env!("CARGO_PKG_NAME").into()
}
fn menu(&self) -> Vec<MenuItem<Self>> {
vec![
StandardItem {
label: format!("Battery level: {bat}% ({crg})", bat = self.battery_level,crg = (if self.charging.is_some() { "Charging" } else {"Discharging"})).into(),
..Default::default()
}
.into(),
StandardItem {
label: "Exit".into(),
icon_name: "application-exit".into(),
Expand Down Expand Up @@ -111,8 +119,8 @@ impl Tray for BatteryTray {
ToolTip {
title: "HyperX Cloud II".to_string(),
description: description,
icon_name: "".into(),
icon_name: "audio-headset".into(),
icon_pixmap: Vec::new(),
}
}
}
}

0 comments on commit 8a1ec7b

Please sign in to comment.