Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit 6467d83

Browse files
committed
refactor: remove battery components
1 parent 1ec08d3 commit 6467d83

File tree

10 files changed

+17
-442
lines changed

10 files changed

+17
-442
lines changed

README.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -255,30 +255,6 @@ default, you must create it manually.
255255
"playback": ["mpv"],
256256
"explorer": ["thunar"]
257257
},
258-
"battery": {
259-
"warnLevels": [
260-
{
261-
"level": 20,
262-
"title": "Low battery",
263-
"message": "You might want to plug in a charger",
264-
"icon": "battery_android_frame_2"
265-
},
266-
{
267-
"level": 10,
268-
"title": "Did you see the previous message?",
269-
"message": "You should probably plug in a charger <b>now</b>",
270-
"icon": "battery_android_frame_1"
271-
},
272-
{
273-
"level": 5,
274-
"title": "Critical battery level",
275-
"message": "PLUG THE CHARGER RIGHT NOW!!",
276-
"icon": "battery_android_alert",
277-
"critical": true
278-
}
279-
],
280-
"criticalLevel": 3
281-
},
282258
"idle": {
283259
"lockBeforeSleep": true,
284260
"inhibitWhenAudio": true,
@@ -363,7 +339,6 @@ default, you must create it manually.
363339
"showOnHover": true,
364340
"status": {
365341
"showAudio": false,
366-
"showBattery": true,
367342
"showBluetooth": true,
368343
"showKbLayout": false,
369344
"showMicrophone": false,
@@ -530,7 +505,9 @@ default, you must create it manually.
530505
"clearThreshold": 0.3,
531506
"defaultExpireTimeout": 5000,
532507
"expandThreshold": 20,
533-
"expire": false
508+
"expire": false,
509+
"timeoutBar": false,
510+
"timeoutCircle": false,
534511
},
535512
"osd": {
536513
"enabled": true,
@@ -603,9 +580,6 @@ programs.caelestia = {
603580
environment = [];
604581
};
605582
settings = {
606-
bar.status = {
607-
showBattery = false;
608-
};
609583
paths.wallpaperDir = "~/Images";
610584
};
611585
cli = {

config/BarConfig.qml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ JsonObject {
8383
property bool showKbLayout: false
8484
property bool showNetwork: true
8585
property bool showBluetooth: true
86-
property bool showBattery: true
8786
property bool showLockStatus: true
8887
}
8988

@@ -92,10 +91,9 @@ JsonObject {
9291
}
9392

9493
component Sizes: JsonObject {
95-
property int innerWidth: 40
94+
property int innerHeight: 40
9695
property int windowPreviewSize: 400
9796
property int trayMenuWidth: 300
98-
property int batteryWidth: 250
9997
property int networkWidth: 320
10098
}
10199
}

config/GeneralConfig.qml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Quickshell.Io
33
JsonObject {
44
property Apps apps: Apps {}
55
property Idle idle: Idle {}
6-
property Battery battery: Battery {}
76

87
component Apps: JsonObject {
98
property list<string> terminal: ["foot"]
@@ -31,29 +30,4 @@ JsonObject {
3130
}
3231
]
3332
}
34-
35-
component Battery: JsonObject {
36-
property list<var> warnLevels: [
37-
{
38-
level: 20,
39-
title: qsTr("Low battery"),
40-
message: qsTr("You might want to plug in a charger"),
41-
icon: "battery_android_frame_2"
42-
},
43-
{
44-
level: 10,
45-
title: qsTr("Did you see the previous message?"),
46-
message: qsTr("You should probably plug in a charger <b>now</b>"),
47-
icon: "battery_android_frame_1"
48-
},
49-
{
50-
level: 5,
51-
title: qsTr("Critical battery level"),
52-
message: qsTr("PLUG THE CHARGER RIGHT NOW!!"),
53-
icon: "battery_android_alert",
54-
critical: true
55-
},
56-
]
57-
property int criticalLevel: 3
58-
}
5933
}

modules/BatteryMonitor.qml

Lines changed: 0 additions & 56 deletions
This file was deleted.

modules/bar/components/StatusIcons.qml

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import qs.utils
66
import qs.config
77
import Quickshell
88
import Quickshell.Bluetooth
9-
import Quickshell.Services.UPower
109
import QtQuick
1110
import QtQuick.Layouts
1211

@@ -20,16 +19,16 @@ StyledRect {
2019
radius: Appearance.rounding.full
2120

2221
clip: true
23-
implicitWidth: Config.bar.sizes.innerWidth
24-
implicitHeight: iconColumn.implicitHeight + Appearance.padding.normal * 2 - (Config.bar.status.showLockStatus && !Hypr.capsLock && !Hypr.numLock ? iconColumn.spacing : 0)
22+
implicitWidth: iconColumn.implicitWidth + Appearance.padding.normal * 2 - (Config.bar.status.showLockStatus && !Hypr.capsLock && !Hypr.numLock ? iconColumn.spacing : 0)
23+
implicitHeight: Config.bar.sizes.innerHeight
2524

26-
ColumnLayout {
25+
RowLayout {
2726
id: iconColumn
2827

29-
anchors.left: parent.left
30-
anchors.right: parent.right
28+
anchors.top: parent.top
3129
anchors.bottom: parent.bottom
32-
anchors.bottomMargin: Appearance.padding.normal
30+
anchors.right: parent.right
31+
anchors.rightMargin: Appearance.padding.normal
3332

3433
spacing: Appearance.spacing.smaller / 2
3534

@@ -137,6 +136,7 @@ StyledRect {
137136
text: Hypr.kbLayout
138137
color: root.colour
139138
font.family: Appearance.font.family.mono
139+
font.capitalization: Font.AllUppercase
140140
}
141141
}
142142

@@ -159,7 +159,7 @@ StyledRect {
159159
name: "bluetooth"
160160
active: Config.bar.status.showBluetooth
161161

162-
sourceComponent: ColumnLayout {
162+
sourceComponent: RowLayout {
163163
spacing: Appearance.spacing.smaller / 2
164164

165165
// Bluetooth icon
@@ -217,36 +217,6 @@ StyledRect {
217217
Anim {}
218218
}
219219
}
220-
221-
// Battery icon
222-
WrappedLoader {
223-
name: "battery"
224-
active: Config.bar.status.showBattery
225-
226-
sourceComponent: MaterialIcon {
227-
animate: true
228-
text: {
229-
if (!UPower.displayDevice.isLaptopBattery) {
230-
if (PowerProfiles.profile === PowerProfile.PowerSaver)
231-
return "energy_savings_leaf";
232-
if (PowerProfiles.profile === PowerProfile.Performance)
233-
return "rocket_launch";
234-
return "balance";
235-
}
236-
237-
const perc = UPower.displayDevice.percentage;
238-
const charging = !UPower.onBattery;
239-
if (perc === 1)
240-
return charging ? "battery_charging_full" : "battery_full";
241-
let level = Math.floor(perc * 7);
242-
if (charging && (level === 4 || level === 1))
243-
level--;
244-
return charging ? `battery_charging_${(level + 3) * 10}` : `battery_${level}_bar`;
245-
}
246-
color: !UPower.onBattery || UPower.displayDevice.percentage > 0.2 ? root.colour : Colours.palette.m3error
247-
fill: 1
248-
}
249-
}
250220
}
251221

252222
component WrappedLoader: Loader {

0 commit comments

Comments
 (0)