forked from Shinonome/dots-hyprland
bar: make lower-center group more compact
This commit is contained in:
@@ -3,10 +3,22 @@ pragma Singleton
|
||||
// From https://github.com/caelestia-dots/shell (GPLv3)
|
||||
|
||||
import Quickshell
|
||||
import qs.services
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
function getBatteryIcon(percentage: int): string {
|
||||
if (percentage >= 93) return "battery_android_full";
|
||||
if (percentage >= 78) return "battery_android_6";
|
||||
if (percentage >= 64) return "battery_android_5";
|
||||
if (percentage >= 50) return "battery_android_4";
|
||||
if (percentage >= 35) return "battery_android_3";
|
||||
if (percentage >= 21) return "battery_android_2";
|
||||
if (percentage >= 7) return "battery_android_1";
|
||||
return "battery_android_0";
|
||||
}
|
||||
|
||||
function getBluetoothDeviceMaterialSymbol(systemIconName: string): string {
|
||||
if (systemIconName.includes("headset") || systemIconName.includes("headphones"))
|
||||
return "headphones";
|
||||
@@ -21,6 +33,24 @@ Singleton {
|
||||
return "bluetooth";
|
||||
}
|
||||
|
||||
function getNetworkMaterialSymbol() {
|
||||
if (Network.ethernet) return "lan";
|
||||
if (Network.wifiEnabled && Network.wifiStatus === "connected") {
|
||||
const strength = Network.active?.strength ?? 0
|
||||
if (strength > 83) return "signal_wifi_4_bar";
|
||||
if (strength > 67) return "network_wifi";
|
||||
if (strength > 50) return "network_wifi_3_bar";
|
||||
if (strength > 33) return "network_wifi_2_bar";
|
||||
if (strength > 17) return "network_wifi_1_bar";
|
||||
return "signal_wifi_0_bar"
|
||||
} else {
|
||||
if (Network.wifiStatus === "connecting") return "signal_wifi_statusbar_not_connected";
|
||||
if (Network.wifiStatus === "disconnected") return "wifi_find";
|
||||
if (Network.wifiStatus === "disabled") return "signal_wifi_off";
|
||||
return "signal_wifi_bad";
|
||||
}
|
||||
}
|
||||
|
||||
readonly property var weatherIconMap: ({
|
||||
"113": "clear_day",
|
||||
"116": "partly_cloudy_day",
|
||||
|
||||
Reference in New Issue
Block a user