Compare commits
No commits in common. "d043f862693638bb96dc4de307aa85980b2b4855" and "aa943a44b6701e91886210db3dfa9de465c0940e" have entirely different histories.
d043f86269
...
aa943a44b6
6 changed files with 4 additions and 80 deletions
|
|
@ -2,12 +2,9 @@ import qs.config
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
|
||||||
color: Theme.palette.basecontent
|
color: Theme.palette.basecontent
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
font.family: Theme.lucide.font.family
|
font.family: Theme.lucide.font.family
|
||||||
font.pixelSize: Dimensions.gpu.iconSize
|
font.pixelSize: Dimensions.gpu.iconSize
|
||||||
font.bold: true
|
font.bold: true
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ pragma Singleton
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
property string batteryCharging: "\u{E058}"
|
|
||||||
property string batteryFull: "\u{E059}"
|
property string batteryFull: "\u{E059}"
|
||||||
property string batteryMedium: "\u{E05b}"
|
property string batteryMedium: "\u{E05b}"
|
||||||
property string batteryLow: "\u{E05a}"
|
property string batteryLow: "\u{E05a}"
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,6 @@ PanelWindow {
|
||||||
|
|
||||||
Gpu {}
|
Gpu {}
|
||||||
|
|
||||||
Power {}
|
|
||||||
|
|
||||||
Clock {}
|
Clock {}
|
||||||
|
|
||||||
Notifications {}
|
Notifications {}
|
||||||
|
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
import qs.components
|
|
||||||
import qs.config
|
|
||||||
import qs.constants
|
|
||||||
import qs.widgets
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import Quickshell.Services.UPower
|
|
||||||
|
|
||||||
StyledButton {
|
|
||||||
id: root
|
|
||||||
property UPowerDevice laptopBattery: UPower.devices.values.find(device => device.isLaptopBattery)
|
|
||||||
property bool isCritical: laptopBattery.percentage < 0.10
|
|
||||||
|
|
||||||
contentItem: RowLayout {
|
|
||||||
spacing: 4
|
|
||||||
LucideIcon {
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
color: {
|
|
||||||
if (root.isCritical) {
|
|
||||||
return Theme.palette.error;
|
|
||||||
}
|
|
||||||
if (root.hovered) {
|
|
||||||
return Theme.palette.primarycontent;
|
|
||||||
}
|
|
||||||
return Theme.palette.basecontent;
|
|
||||||
}
|
|
||||||
font.pixelSize: 16
|
|
||||||
text: {
|
|
||||||
if (root.laptopBattery.state == UPowerDeviceState.Charging) {
|
|
||||||
return Icons.batteryCharging;
|
|
||||||
}
|
|
||||||
if (root.isCritical) {
|
|
||||||
return Icons.batteryWarning;
|
|
||||||
}
|
|
||||||
if (root.laptopBattery.percentage < 0.33) {
|
|
||||||
return Icons.batteryLow;
|
|
||||||
}
|
|
||||||
if (root.laptopBattery.percentage < 0.66) {
|
|
||||||
return Icons.batteryMedium;
|
|
||||||
}
|
|
||||||
return Icons.batteryFull;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
color: {
|
|
||||||
if (root.isCritical) {
|
|
||||||
return Theme.palette.error;
|
|
||||||
}
|
|
||||||
if (root.hovered) {
|
|
||||||
return Theme.palette.primarycontent;
|
|
||||||
}
|
|
||||||
return Theme.palette.basecontent;
|
|
||||||
}
|
|
||||||
text: `${root.laptopBattery.percentage * 100}%`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
visible: laptopBattery
|
|
||||||
}
|
|
||||||
|
|
@ -2,8 +2,10 @@ pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import "services"
|
import "services"
|
||||||
import qs.components
|
import qs.components
|
||||||
|
import qs.config
|
||||||
import qs.constants
|
import qs.constants
|
||||||
import qs.services
|
import qs.services
|
||||||
|
import qs.widgets
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
pragma Singleton
|
|
||||||
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Services.UPower
|
|
||||||
|
|
||||||
Singleton {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool onBattery: UPower.onBattery
|
|
||||||
property UPowerDevice laptopBattery: UPower.devices.values.find(device => device.isLaptopBattery)
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue