-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStates.qml
More file actions
80 lines (74 loc) · 2.73 KB
/
States.qml
File metadata and controls
80 lines (74 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
pragma Singleton
import Quickshell
import Quickshell.Services.UPower
import QtQuick
Singleton {
property PanelWindow barPanel: null
property var locale: Qt.locale(Config.general.locale)
property bool barEnabled: true
property bool ecoMode: false
property bool preferencesWindowPresent: false
property bool launcherPresent: false
property bool sessionPresent: false
property bool keepAwake: false
property bool dashboardPresent: false
property bool dropdownRevealed: false
property var dropdownOwner: null
property int dropdownX: 0
property int dropdownY: 0
property int dropdownHeight: 0
property int dropdownWidth: 0
// TODO add local
property string defaultWallpaper: "https://raw.githubusercontent.com/charlesrocket/misc-files/trunk/puffy-red.png"
property var battery: QtObject {
function getIcon(batteryPercentage) {
if (isCharging || isFullyCharged) {
if (percentage == 100)
return "";
if (percentage >= 90)
return "";
if (percentage >= 80)
return "";
if (percentage >= 70)
return "";
if (percentage >= 60)
return "";
if (percentage >= 50)
return "";
if (percentage >= 40)
return "";
if (percentage >= 30)
return "";
if (percentage >= 20)
return "";
return "";
} else {
if (percentage == 100)
return "";
if (percentage >= 90)
return "";
if (percentage >= 80)
return "";
if (percentage >= 70)
return "";
if (percentage >= 60)
return "";
if (percentage >= 50)
return "";
if (percentage >= 40)
return "";
if (percentage >= 30)
return "";
if (percentage >= 20)
return "";
return "";
}
}
readonly property var device: UPower.displayDevice
readonly property int percentage: device?.ready ? Math.round(device.percentage * 100) : 0
readonly property bool isCharging: device?.state === 1
readonly property bool isDischarging: device?.state === 2
readonly property bool isEmpty: device?.state === 3
readonly property bool isFullyCharged: device?.state === 4
}
}