Icons: Brightness and battery

This commit is contained in:
LemmyCook 2025-09-08 15:53:50 -04:00
parent 404a1d3e8b
commit ea6b8e0c02
18 changed files with 36 additions and 66 deletions

View file

@ -2,6 +2,7 @@ pragma Singleton
import Quickshell
import Quickshell.Services.UPower
import qs.Services
Singleton {
id: root
@ -9,41 +10,18 @@ Singleton {
// Choose icon based on charge and charging state
function getIcon(percent, charging, isReady) {
if (!isReady) {
return "battery_error"
return FontService.icons["battery_empty"] // FIXME: find battery error ?
}
if (charging) {
if (percent >= 95)
return "battery_full"
if (percent >= 85)
return "battery_charging_90"
if (percent >= 65)
return "battery_charging_80"
if (percent >= 55)
return "battery_charging_60"
if (percent >= 45)
return "battery_charging_50"
if (percent >= 25)
return "battery_charging_30"
if (percent >= 0)
return "battery_charging_20"
return FontService.icons["battery_charging"]
} else {
if (percent >= 95)
return "battery_full"
if (percent >= 85)
return "battery_6_bar"
if (percent >= 70)
return "battery_5_bar"
if (percent >= 55)
return "battery_4_bar"
if (percent >= 40)
return "battery_3_bar"
return FontService.icons["battery_full"]
if (percent >= 25)
return "battery_2_bar"
if (percent >= 10)
return "battery_1_bar"
return FontService.icons["battery_low"]
if (percent >= 0)
return "battery_0_bar"
return FontService.icons["battery_empty"]
}
}
}

View file

@ -29,13 +29,14 @@ Singleton {
"volume_off": "\uF026",
"volume_half": "\uF027",
"volume_full": "\uF028",
"brightness_low": "\uF1CF",
"brightness_high": "\uF1CD",
"power": "\uf011",
"gear": "\ue615",
"close": "\uf00D",
"check": "\uf00C",
"panel": "\uF28C",
"memory": "\uF2D6",
"trash": "\uF014",
"image": "\uF03E",
"refresh": "\uF021",
@ -57,17 +58,22 @@ Singleton {
"stop": "\uEFFB",
"next": "\uF051",
"prev": "\uF048",
"paint_drop": "\uF043",
"paint_drop": "\uF30C",
"lightning": "\uF0E7",
"brightness": "\uF0A3",
"arrow_drop_down": "\uF0D7",
"warning": "\uF334",
"info": "\uF26A",
"upload": "\uF01B",
"download": "\uF01A",
"vinyl": "\uEFBD",
"link": "\uF0C1",
"add": "\uF055", // FIXME UGLY
"bell": "\uF189",
"bell_striked": "\uEE15", // FIXME
"drive": "\uEE15", // FIXME
"upload": "\uEE15", // FIXME
"download": "\uEE15", // FIXME
"person": "\uEE15", // FIXME
}