added contextmenu and hide tray icon

This commit is contained in:
2024-06-08 18:41:43 +02:00
parent 3a1a5588d4
commit 83aa943fd9
3 changed files with 61 additions and 7 deletions

View File

@ -1,12 +1,14 @@
const batteryLevel = (batteryStatus, batteryPercent) => ({
"BATTERY_UNAVAILABLE": "not connected",
"BATTERY_CHARGING": "charging (" + batteryPercent + "%)"
"BATTERY_CHARGING": "charging (" + batteryPercent + "%)",
"HEADSET_UNAVAILABLE": "no headset connected"
})[batteryStatus] ?? batteryPercent + "%";
const batteryIcon = batteryStatus => ({
"BATTERY_UNAVAILABLE": "action-unavailable",
"BATTERY_AVAILABLE": "audio-headphones-symbolic",
"BATTERY_CHARGING": "reload"
"BATTERY_CHARGING": "freon-voltage-symbolic",
"HEADSET_UNAVAILABLE": "dialog-error"
})[batteryStatus] ?? "audio-headphones-symbolic";
const hex2rgb = (hex, h = hex.replace('#', '0x')) => ({ r: h >> 16 & 255, g: h >> 8 & 255, b: h & 255 });