Compare commits

..

34 Commits

Author SHA1 Message Date
Aaron Rainbolt
682b13003e
Refresh DPMS revert patch 2025-07-30 16:08:15 -05:00
Aaron Rainbolt
70b91e587f
Update build deps 2025-07-30 16:04:47 -05:00
Aaron Rainbolt
14cd289ddf
Bump standards-version 2025-07-30 16:01:37 -05:00
Aaron Rainbolt
be9b5be51a
Update copyright file 2025-07-30 16:00:56 -05:00
Aaron Rainbolt
69e7d78e3e
Bump version for new upstream release 2025-07-30 15:46:23 -05:00
c0a5d21319 Update Standards-Version to 4.7.1, no changes needed. 2025-02-21 16:48:55 -06:00
a657e0710d No-change rebuild for lxqt-build-tools C++17 -> C++20. 2025-02-21 16:37:48 -06:00
bde7f42127 Upload to Plucky 2024-11-15 15:34:45 -06:00
c67bc6f5cb Make Lintian happy 2024-11-05 16:26:43 -06:00
b6ae6f489c Bump build dependencies. 2024-11-05 16:20:35 -06:00
23d9b31362 New upstream release. 2024-11-05 16:17:27 -06:00
Aaron Rainbolt
2055e287ba Release to Oracular 2024-08-15 16:29:14 -05:00
Aaron Rainbolt
baf98df0e0 PPA upload 2024-06-26 17:09:16 -05:00
Aaron Rainbolt
37bf2b91f3 Bump Standards-Version 2024-06-26 17:08:52 -05:00
Aaron Rainbolt
c99c3fec0d Fix battery notification patch 2024-06-26 17:05:18 -05:00
Aaron Rainbolt
d0a41a3683 Adjusted build dependencies 2024-06-26 17:05:18 -05:00
Aaron Rainbolt
e2d1b8be25 Update copyright file 2024-06-26 17:05:18 -05:00
Aaron Rainbolt
8b201d80e3 Fix revert-dpms-changes.patch 2024-06-26 17:05:08 -05:00
Aaron Rainbolt
8b15c826fd Bump version for new upstream release. 2024-06-26 15:44:19 -05:00
235a550c36 Repository-Browse, not Repository-Browser 2023-11-14 19:23:06 -06:00
928e094586 DPMS related code must go! 2023-11-14 19:20:06 -06:00
dd5c5e0199 Upload to Noble. 2023-11-13 11:49:16 -06:00
e281b2507f Add some missing build dependencies. 2023-11-13 11:45:36 -06:00
5a6a3e97c9 Wraaaaaaaaaaaaaaaaaaaaap. 2023-11-13 11:45:01 -06:00
55f23453c6 Show a notification when the battery is present, not absent. 2023-11-13 11:42:11 -06:00
5409596e89 Bump build dependencies. 2023-11-13 11:40:39 -06:00
e3b40ebf98 New upstream release. 2023-11-13 11:40:03 -06:00
06c44daa1b Upload to Mantic. 2023-08-11 12:50:14 -05:00
7c2c8e8386 Update copyright years. 2023-08-11 12:48:38 -05:00
1ee36eab58 I guess we don't require root to build, do we? 2023-08-11 12:47:04 -05:00
56bcc84401 Bump Standards-Version to 4.6.2, no changes needed. 2023-08-11 11:48:02 -05:00
b9cb6b9902 Remove redundant hardening rule. 2023-08-11 11:47:22 -05:00
1b0426f686 Bump build dependencies. 2023-08-11 11:35:16 -05:00
945833658f New upstream release. 2023-08-11 11:33:19 -05:00
16 changed files with 451 additions and 127 deletions

7
debian/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
/*.debhelper
/*.log
/*.substvars
/debhelper-build-stamp
/files
/lxqt-powermanagement/

174
debian/changelog vendored
View File

@ -1,42 +1,112 @@
lxqt-powermanagement (1.2.0-1) unstable; urgency=medium lxqt-powermanagement (2.2.1-0ubuntu1) questing; urgency=medium
* New upstream release. * New upstream release.
* Bump Standards-Version to 4.6.1. - Update build dependencies.
* Bump compat to 13. - Refresh DPMS revert patch.
* Remove unnecessary -Wl,--as-needed in d/rules. * Update Standards-Version to 4.7.2, no changes needed.
* Remove unnecessary --fail-missing in d/rules.
* Add Rules-Requires-Root: no.
* Update d/watch for GitHub.
* Fix d/lintian-overrides.
* Fix d/upstream/metadata.
-- ChangZhuo Chen (陳昌倬) <czchen@debian.org> Sat, 17 Dec 2022 01:32:56 +0800 -- Aaron Rainbolt <arraybolt3@ubuntu.com> Wed, 30 Jul 2025 15:45:36 -0500
lxqt-powermanagement (1.1.0-3) unstable; urgency=medium lxqt-powermanagement (2.1.0-0ubuntu3) plucky; urgency=medium
* Merge to unstable. * Update Standards-Version to 4.7.1, no changes needed.
-- ChangZhuo Chen (陳昌倬) <czchen@debian.org> Sun, 20 Nov 2022 19:19:07 +0800 -- Simon Quigley <tsimonq2@ubuntu.com> Fri, 21 Feb 2025 16:37:50 -0600
lxqt-powermanagement (1.1.0-2) experimental; urgency=medium lxqt-powermanagement (2.1.0-0ubuntu2) plucky; urgency=medium
* Merge to unstable. * No-change rebuild for lxqt-build-tools C++17 -> C++20.
-- ChangZhuo Chen (陳昌倬) <czchen@debian.org> Sun, 20 Nov 2022 18:34:30 +0800 -- Simon Quigley <tsimonq2@ubuntu.com> Fri, 03 Jan 2025 03:58:19 -0600
lxqt-powermanagement (1.1.0-1) experimental; urgency=medium lxqt-powermanagement (2.1.0-0ubuntu1) plucky; urgency=medium
* Add debian/salsa-ci.yml file. * New upstream release.
* Update debian/upstream/signing-key.asc. - Bump build dependencies.
* New upstream version 1.0.0
* New upstream version 1.1.0
* Build-deps on liblxqt1-dev (>= 1.1.0~).
* Build-deps on liblxqt-globalkeys1-dev (>= 1.1.0~).
* Build-deps on liblxqt-globalkeys-ui1-dev (>= 1.1.0~).
* Drop obsleted Breaks and Replaces lines.
* debian/copyright: update years.
-- Andrew Lee (李健秋) <ajqlee@debian.org> Fri, 15 Jul 2022 23:15:01 +0800 -- Simon Quigley <tsimonq2@ubuntu.com> Fri, 15 Nov 2024 15:33:02 -0600
lxqt-powermanagement (2.0.0-0ubuntu1) oracular; urgency=medium
* New upstream release.
* Fix DPMS-related patch.
* Update copyright file.
* Adjusted build dependencies.
* Fix battery notification patch.
* Bump Standards-Version to 4.7.0, no changes necessary.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Thu, 15 Aug 2024 16:29:08 -0500
lxqt-powermanagement (1.4.0-0ubuntu2) noble; urgency=medium
* Patched out DPMS-related code (it was causing constant crashes)
* Renamed the "Repository-Browser" field to "Repository-Browse" in upstream
metadata.
-- Aaron Rainbolt <arraybolt3@gmail.com> Tue, 14 Nov 2023 19:00:33 -0600
lxqt-powermanagement (1.4.0-0ubuntu1) noble; urgency=medium
* New upstream release.
* Bump build dependencies.
* Show a notification when the battery is present, not absent.
* Wraaaaaaaaaaaaaaaaaaaaap.
* Add some missing build dependencies.
-- Simon Quigley <tsimonq2@ubuntu.com> Mon, 13 Nov 2023 11:48:51 -0600
lxqt-powermanagement (1.3.0-0ubuntu1) mantic; urgency=medium
* New upstream release.
* Bump build dependencies.
* Remove redundant hardening rule.
* Bump Standards-Version to 4.6.2, no changes needed.
* I guess we don't require root to build, do we?
* Update copyright years.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 11 Aug 2023 12:50:06 -0500
lxqt-powermanagement (1.2.0-0ubuntu1) lunar; urgency=medium
* New upstream release.
* Fix the watch file, for real this time.
* Bump build dependencies in debian/control.
* Bump Standards-version to 4.6.1, no changes needed.
* Lubuntuify the package slightly, to make debhelper happy.
* Add some missing brackets in the Lintian overrides.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 18 Nov 2022 21:55:31 -0600
lxqt-powermanagement (1.1.0-0ubuntu1) kinetic; urgency=medium
* New upstream release.
* Bumped build dependencies.
* Drop old Breaks/Replaces since we're past the LTS. Update the
runtime dependencies too.
-- Simon Quigley <tsimonq2@ubuntu.com> Thu, 02 Jun 2022 12:43:41 -0500
lxqt-powermanagement (0.17.1-0ubuntu1) impish; urgency=medium
* New upstream release 0.17.1
* Update debian/control
- Bump Standards-Version to 4.5.1
- Use liblxqt0-dev 0.17.0
- Use libglobalkeys0-dev 0.17.0
- Use libglobalkeys-ui0-dev 0.17.0
- Extend lxqt-powermanagement-l10n package description
* Rename tag for lintian override
* Update debian/copyright
-- apt-ghetto <apt-ghetto@protonmail.com> Fri, 13 Aug 2021 15:31:53 +0200
lxqt-powermanagement (0.16.0-1ubuntu1) hirsute; urgency=medium
* New upstream version. Merge from debian unstable.
* Bump debhelper-compat requirement to 13.
* Update dependencies.
-- Raman Sarda <theloudspeaker@disroot.org> Mon, 22 Feb 2021 02:55:40 +0530
lxqt-powermanagement (0.16.0-1) unstable; urgency=medium lxqt-powermanagement (0.16.0-1) unstable; urgency=medium
@ -50,6 +120,31 @@ lxqt-powermanagement (0.16.0-1) unstable; urgency=medium
-- Andrew Lee (李健秋) <ajqlee@debian.org> Wed, 06 Jan 2021 17:58:35 +0800 -- Andrew Lee (李健秋) <ajqlee@debian.org> Wed, 06 Jan 2021 17:58:35 +0800
lxqt-powermanagement (0.15.0-0ubuntu1) groovy; urgency=medium
* New upstream release.
- Update upstream signing key.
- Update LXQt build dependencies.
* Bump Standards-version to 4.5.0, no changes needed.
-- Simon Quigley <tsimonq2@ubuntu.com> Thu, 04 Jun 2020 14:34:24 -0500
lxqt-powermanagement (0.14.1-1ubuntu2) focal; urgency=medium
* Updated rules to be consistent with debian unstable.
-- Raman Sarda <theloudspeaker@lubuntu.me> Sun, 16 Feb 2020 00:11:05 +0530
lxqt-powermanagement (0.14.1-1ubuntu1) focal; urgency=low
* Merge from Debian unstable. Remaining changes:
- Using debhelper-compat
- Keeping ubuntu-side tweaks of writing depends in one line.
- Updated build deps according to new minimum requirements.
- Added upstream metadata
-- Raman Sarda <theloudspeaker@lubuntu.me> Wed, 12 Feb 2020 11:13:49 +0530
lxqt-powermanagement (0.14.1-1) unstable; urgency=medium lxqt-powermanagement (0.14.1-1) unstable; urgency=medium
* Cherry-picking new upstream version 0.14.1. * Cherry-picking new upstream version 0.14.1.
@ -57,6 +152,13 @@ lxqt-powermanagement (0.14.1-1) unstable; urgency=medium
-- Alf Gaida <agaida@siduction.org> Tue, 26 Feb 2019 02:47:54 +0100 -- Alf Gaida <agaida@siduction.org> Tue, 26 Feb 2019 02:47:54 +0100
lxqt-powermanagement (0.14.1-0ubuntu1) disco; urgency=medium
* New upstream release.
* Run wrap-and-sort.
-- Simon Quigley <tsimonq2@ubuntu.com> Sat, 09 Mar 2019 13:15:31 -0600
lxqt-powermanagement (0.14.0-1) unstable; urgency=medium lxqt-powermanagement (0.14.0-1) unstable; urgency=medium
* Cherry-picking new upstream version 0.14.0. * Cherry-picking new upstream version 0.14.0.
@ -70,6 +172,16 @@ lxqt-powermanagement (0.14.0-1) unstable; urgency=medium
-- Alf Gaida <agaida@siduction.org> Sun, 27 Jan 2019 18:03:45 +0100 -- Alf Gaida <agaida@siduction.org> Sun, 27 Jan 2019 18:03:45 +0100
lxqt-powermanagement (0.14.0-0ubuntu1) disco; urgency=medium
* New upstream release.
- Bump build dependencies.
* Bump Standards-version to 4.3.0, no changes needed.
* Bump debhelper compat to 12, no changes needed.
* Add a lxqt-powermanagement-l10n package.
-- Simon Quigley <tsimonq2@ubuntu.com> Sat, 26 Jan 2019 00:39:28 -0600
lxqt-powermanagement (0.13.0-1) unstable; urgency=medium lxqt-powermanagement (0.13.0-1) unstable; urgency=medium
* Cherry-picking new upstream version 0.13.0. * Cherry-picking new upstream version 0.13.0.
@ -77,6 +189,14 @@ lxqt-powermanagement (0.13.0-1) unstable; urgency=medium
-- Alf Gaida <agaida@siduction.org> Thu, 24 May 2018 22:46:32 +0200 -- Alf Gaida <agaida@siduction.org> Thu, 24 May 2018 22:46:32 +0200
lxqt-powermanagement (0.13.0-0ubuntu1) cosmic; urgency=medium
* New upstream release.
* Update Vcs-* and Maintainer to Lubuntu values.
* Update build dependencies.
-- Simon Quigley <tsimonq2@ubuntu.com> Tue, 22 May 2018 23:47:42 -0500
lxqt-powermanagement (0.12.0-5) unstable; urgency=medium lxqt-powermanagement (0.12.0-5) unstable; urgency=medium
* Bumped compat to 11 * Bumped compat to 11

48
debian/control vendored
View File

@ -1,36 +1,35 @@
Source: lxqt-powermanagement Source: lxqt-powermanagement
Maintainer: LXQt Packaging Team <pkg-lxqt-devel@lists.alioth.debian.org> Maintainer: Lubuntu Developers <lubuntu-devel@lists.ubuntu.com>
Original-Maintainer: LXQt Packaging Team <pkg-lxqt-devel@lists.alioth.debian.org>
Uploaders: Alf Gaida <agaida@siduction.org>, Uploaders: Alf Gaida <agaida@siduction.org>,
ChangZhuo Chen (陳昌倬) <czchen@debian.org>, ChangZhuo Chen (陳昌倬) <czchen@debian.org>,
Andrew Lee (李健秋) <ajqlee@debian.org> Andrew Lee (李健秋) <ajqlee@debian.org>
Section: x11 Section: x11
Priority: optional Priority: optional
Build-Depends: debhelper-compat (= 13), Build-Depends: debhelper-compat (= 13),
libkf5idletime-dev, libkf6idletime-dev,
libkf5solid-dev, libkf6solid-dev,
libkf5windowsystem-dev, libkf6windowsystem-dev,
liblxqt1-dev (>= 1.2.0~), liblxqt-globalkeys-ui2-dev (>= 2.2.0),
liblxqt-globalkeys1-dev (>= 1.2.0~), liblxqt-globalkeys2-dev (>= 2.2.0),
liblxqt-globalkeys-ui1-dev (>= 1.2.0~), liblxqt2-dev (>= 2.2.0),
libqt5svg5-dev,
libqt5x11extras5-dev,
libx11-dev, libx11-dev,
qtbase5-private-dev libxcb-dpms0-dev,
Standards-Version: 4.6.1 libxcb-screensaver0-dev,
Vcs-Browser: https://salsa.debian.org/lxqt-team/lxqt-powermanagement qt6-base-private-dev (>= 6.6.0),
Vcs-Git: https://salsa.debian.org/lxqt-team/lxqt-powermanagement.git qt6-svg-dev (>= 6.6.0)
Homepage: https://github.com/lxqt/lxqt-powermanagement Standards-Version: 4.7.2
Vcs-Browser: https://git.lubuntu.me/Lubuntu/lxqt-powermanagement-packaging
Vcs-Git: https://git.lubuntu.me/Lubuntu/lxqt-powermanagement-packaging.git
Debian-Vcs-Browser: https://salsa.debian.org/lxqt-team/lxqt-powermanagement
Debian-Vcs-Git: https://salsa.debian.org/lxqt-team/lxqt-powermanagement.git
Rules-Requires-Root: no Rules-Requires-Root: no
Homepage: https://github.com/lxqt/lxqt-powermanagement
Package: lxqt-powermanagement Package: lxqt-powermanagement
Architecture: any Architecture: any
Depends: ${misc:Depends}, Depends: lxqt-policykit, upower, ${misc:Depends}, ${shlibs:Depends}
${shlibs:Depends}, Recommends: lxqt-powermanagement-l10n, lxqt-qtplugin, lxqt-session
lxqt-policykit,
upower
Recommends: lxqt-powermanagement-l10n,
lxqt-qtplugin,
lxqt-session
Description: power management module for LXQt Description: power management module for LXQt
The Power management module for LXQt. The Power management module for LXQt.
. .
@ -40,7 +39,8 @@ Package: lxqt-powermanagement-l10n
Architecture: all Architecture: all
Multi-Arch: foreign Multi-Arch: foreign
Section: localization Section: localization
Depends: ${misc:Depends}, Depends: qt6-translations-l10n, ${misc:Depends}
qttranslations5-l10n
Description: Language package for lxqt-powermanagement Description: Language package for lxqt-powermanagement
This package contains the l10n files needed by the lxqt-powermangement. The l10n files for lxqt-powermanagement
.
This package contains the l10n files needed by lxqt-powermanagement.

25
debian/copyright vendored
View File

@ -3,12 +3,31 @@ Upstream-Name: lxqt-powermanagement
Source: https://github.com/lxqt/lxqt-powermanagement Source: https://github.com/lxqt/lxqt-powermanagement
Files: * Files: *
Copyright: 2013-2022 LXQt team Copyright: 2013-2025, LXQt team
2011-2012, Razor team
License: LGPL-2.1+
Files: config/helpers.h
src/batteryinfodialog.cpp
src/batteryinfodialog.h
src/iconproducer.cpp
src/iconproducer.h
src/powermanagementd.h
src/watcher.h
Copyright: 2014-2015, Christian Surlykke <christian@surlykke.dk>
2014-2015, Paulo Lieuthier
License: LGPL-2.1+
Files: src/idlenesswatcher.cpp
src/idlenesswatcher.h
Copyright: 2013, Alec Moskvin <alecm@gmx.com>
License: LGPL-2.1+ License: LGPL-2.1+
Files: debian/* Files: debian/*
Copyright: 2014-2019 Alf Gaida <agaida@siduction.org> Copyright: 2021-2025, Lubuntu Developers <lubuntu-devel@lists.ubuntu.com>
2015-2022 Andrew Lee (李健秋) <ajqlee@debian.org> 2014-2019, Alf Gaida <agaida@siduction.org>
2015, Andrew Lee (李健秋) <ajqlee@debian.org>
2025, Aaron Rainbolt <arraybolt3@ubuntu.com>
License: LGPL-2.1+ License: LGPL-2.1+
License: LGPL-2.1+ License: LGPL-2.1+

View File

@ -1,5 +1,6 @@
# there will be no manpages in a foreseable future # there will be no manpages in a foreseable future
lxqt-powermanagement: no-manual-page * lxqt-powermanagement: no-manual-page [usr/bin/lxqt-config-powermanagement]
lxqt-powermanagement: no-manual-page [usr/bin/lxqt-powermanagement]
# category LXQt in not yet in freedesktop specs - no bug # category LXQt in not yet in freedesktop specs - no bug
lxqt-powermanagement: desktop-entry-invalid-category LXQt * lxqt-powermanagement: desktop-entry-invalid-category LXQt [usr/share/applications/lxqt-config-powermanagement.desktop]

View File

@ -1,3 +1,2 @@
usr/share/lxqt/translations/lxqt-config-powermanagement usr/share/lxqt/translations/lxqt-config-powermanagement
usr/share/lxqt/translations/lxqt-powermanagement usr/share/lxqt/translations/lxqt-powermanagement

View File

@ -1,5 +1,5 @@
etc/xdg/autostart/lxqt-powermanagement.desktop etc/xdg/autostart/lxqt-powermanagement.desktop
usr/share/applications/lxqt-config-powermanagement.desktop
usr/share/icons/hicolor/scalable/devices/laptop-lid.svg
usr/bin/lxqt-config-powermanagement usr/bin/lxqt-config-powermanagement
usr/bin/lxqt-powermanagement usr/bin/lxqt-powermanagement
usr/share/applications/lxqt-config-powermanagement.desktop
usr/share/icons/hicolor/scalable/devices/laptop-lid.svg

View File

@ -0,0 +1,4 @@
# This is expected
lxqt-powermanagement: desktop-entry-lacks-keywords-entry [usr/share/applications/lxqt-config-powermanagement.desktop]
lxqt-powermanagement: desktop-entry-invalid-category LXQt [usr/share/applications/lxqt-config-powermanagement.desktop]
lxqt-powermanagement: no-manual-page *

114
debian/patches/battery-ux.patch vendored Normal file
View File

@ -0,0 +1,114 @@
Description: Show a notification when the battery is present, not absent
In virtual machines especially, it is odd to see a message about the battery not being present. This commit moves that message to only display when there is a battery present.
Author: Simon Quigley <tsimonq2@lubuntu.me>
Origin: upstream
Forwarded: https://github.com/lxqt/lxqt-powermanagement/pull/382
Last-Update: 2023-10-03
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/batterywatcher.cpp
+++ b/src/batterywatcher.cpp
@@ -43,13 +43,6 @@ BatteryWatcher::BatteryWatcher(QObject *
{
const QList<Solid::Device> devices = Solid::Device::listFromType(Solid::DeviceInterface::Battery, QString());
- if (devices.isEmpty())
- {
- LXQt::Notification::notify(tr("No battery!"),
- tr("LXQt could not find data about any battery - monitoring disabled"),
- QSL("lxqt-powermanagement"));
- }
-
for (Solid::Device device : devices)
{
Solid::Battery *battery = device.as<Solid::Battery>();
@@ -57,11 +50,24 @@ BatteryWatcher::BatteryWatcher(QObject *
{
continue;
}
+
mBatteries << battery;
connect(battery, &Solid::Battery::energyChanged, this, &BatteryWatcher::batteryChanged);
connect(battery, &Solid::Battery::chargeStateChanged, this, &BatteryWatcher::batteryChanged);
}
+ bool discharging;
+ double chargeLevel;
+ chargeLevelAndStatus(discharging, chargeLevel);
+
+ if (!devices.isEmpty()) {
+ QString status = discharging ? QStringLiteral("Discharging") : QStringLiteral("Charging");
+ QString message = tr("%1 (%2%)").arg(status).arg(chargeLevel);
+ LXQt::Notification::notify(tr("Battery Present"),
+ message,
+ QSL("lxqt-powermanagement"));
+ }
+
mBatteryInfoDialog = new BatteryInfoDialog(mBatteries);
connect(&mSettings, &PowerManagementSettings::settingsChanged, this, &BatteryWatcher::settingsChanged);
@@ -85,19 +91,10 @@ void BatteryWatcher::batteryChanged()
static QTime actionTime;
static LXQt::Notification *notification = nullptr;
- double totalEnergyFull = 0;
- double totalEnergyNow = 0;
- bool discharging = true;
+ bool discharging;
double chargeLevel;
- for (const Solid::Battery *battery : std::as_const(mBatteries))
- {
- totalEnergyFull += battery->energyFull();
- totalEnergyNow += battery->energy();
- discharging &= (battery->chargeState() == Solid::Battery::Discharging);
- }
-
- chargeLevel = 100 * totalEnergyNow / totalEnergyFull;
+ chargeLevelAndStatus(discharging, chargeLevel);
qDebug() << "BatteryChanged"
<< "discharging:" << discharging
@@ -160,6 +157,31 @@ void BatteryWatcher::batteryChanged()
}
}
+void BatteryWatcher::chargeLevelAndStatus(bool &discharging, double &chargeLevel)
+{
+ double totalEnergyFull = 0;
+ double totalEnergyNow = 0;
+ bool batteries = false;
+ discharging = true;
+
+ for (const Solid::Battery *battery : std::as_const(mBatteries))
+ {
+ batteries = true;
+
+ totalEnergyFull += battery->energyFull();
+ totalEnergyNow += battery->energy();
+ discharging &= (battery->chargeState() == Solid::Battery::Discharging);
+ }
+
+ if (!batteries) {
+ discharging = false;
+ chargeLevel = 0;
+ }
+ else {
+ chargeLevel = 100 * totalEnergyNow / totalEnergyFull;
+ }
+}
+
void BatteryWatcher::settingsChanged()
{
if (!mSettings.isShowIcon())
--- a/src/batterywatcher.h
+++ b/src/batterywatcher.h
@@ -51,6 +51,8 @@ private slots:
void setPause(TrayIcon::PAUSE duration);
private:
+ void chargeLevelAndStatus(bool &discharging, double &chargeLevel);
+
QList<Solid::Battery*> mBatteries;
QList<TrayIcon*> mTrayIcons;
QTimer mPauseTimer;

115
debian/patches/revert-dpms-changes.patch vendored Normal file
View File

@ -0,0 +1,115 @@
Description: Remove DPMS-related and screensaver-suspending-related code
lxqt-powermanagement added some code that allows the power manager to mess
with DPMS stuff. However it appears that DPMS is oftentimes not available in
Lubuntu, making lxqt-powermanagement crash over and over until it finally
gets disabled by LXQt until the next login. Some screensaver-related stuff
was also thrown in which seems unrelated but is in with a function that
sets DPMS timeouts. This patch removes all of that code, fixing the crashes.
Author: Aaron Rainbolt
Origin: ubuntu
Last-Update: 2024-06-26
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,7 +29,6 @@ find_package(KF6IdleTime ${KF6_MINIMUM_V
find_package(KF6Solid ${KF6_MINIMUM_VERSION} REQUIRED)
find_package(lxqt ${LXQT_MINIMUM_VERSION} REQUIRED)
find_package(lxqt-globalkeys-ui ${LXQT_GLOBALKEYS_MINIMUM_VERSION} REQUIRED)
-find_package(XCB REQUIRED COMPONENTS DPMS SCREENSAVER)
message(STATUS "Building with Qt${Qt6Core_VERSION}")
--- a/src/idlenesswatcher.cpp
+++ b/src/idlenesswatcher.cpp
@@ -35,8 +35,6 @@
#include <QDebug>
#include <LXQt/lxqtnotification.h>
#include <QObject>
-#include <xcb/dpms.h>
-#include <xcb/screensaver.h>
IdlenessWatcher::IdlenessWatcher(QObject* parent):
Watcher(parent)
@@ -70,47 +68,14 @@ IdlenessWatcher::IdlenessWatcher(QObject
connect(&mPSettings, &LXQt::Settings::settingsChanged, this, &IdlenessWatcher::onSettingsChanged);
- // retrieve DPMS timeouts
- mDpmsStandby = mDpmsSuspend = mDpmsOff = 0;
- if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
- if (auto x11NativeInterface = qGuiApp->nativeInterface<QNativeInterface::QX11Application>()) {
- xcb_connection_t* c = x11NativeInterface->connection();
- xcb_dpms_get_timeouts_cookie_t cookie = xcb_dpms_get_timeouts(c);
- xcb_dpms_get_timeouts_reply_t* reply = xcb_dpms_get_timeouts_reply(c, cookie, nullptr);
- if (reply) {
- mDpmsStandby = reply->standby_timeout;
- mDpmsSuspend = reply->suspend_timeout;
- mDpmsOff = reply->off_timeout;
- free(reply);
- }
- }
- }
-
setup();
}
IdlenessWatcher::~IdlenessWatcher()
{
- setDpmsTimeouts(true);
KIdleTime::instance()->removeAllIdleTimeouts();
}
-void IdlenessWatcher::setDpmsTimeouts(bool restore) {
- if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
- if (auto x11NativeInterface = qGuiApp->nativeInterface<QNativeInterface::QX11Application>()) {
- xcb_connection_t* c = x11NativeInterface->connection();
- if (restore) {
- xcb_dpms_set_timeouts(c, mDpmsStandby, mDpmsSuspend, mDpmsOff);
- xcb_screensaver_suspend(c, 0); // WARNING: This is not documented but works.
- }
- else {
- xcb_dpms_set_timeouts(c, 0, 0, 0);
- xcb_screensaver_suspend(c, XCB_SCREENSAVER_SUSPEND);
- }
- }
- }
-}
-
void IdlenessWatcher::setup()
{
if(mPSettings.isIdlenessWatcherEnabled()) {
@@ -144,13 +109,6 @@ void IdlenessWatcher::setup()
milliseconds = 1000;
mIdleBacklightWatcher = KIdleTime::instance()->addIdleTimeout(milliseconds);
}
-
- // override DPMS settings
- setDpmsTimeouts(false);
- }
- else {
- // restore DPMS settings
- setDpmsTimeouts(true);
}
}
--- a/src/idlenesswatcher.h
+++ b/src/idlenesswatcher.h
@@ -45,8 +45,6 @@ private Q_SLOTS:
void onSettingsChanged();
private:
- void setDpmsTimeouts(bool restore);
-
PowerManagementSettings mPSettings;
int mIdleACWatcher;
int mIdleBatteryWatcher;
@@ -54,7 +52,6 @@ private:
LXQt::Backlight *mBacklight;
int mBacklightActualValue;
bool mDischarging;
- quint16 mDpmsStandby, mDpmsSuspend, mDpmsOff;
};
#endif // IDLENESSWATCHER_H

2
debian/patches/series vendored Normal file
View File

@ -0,0 +1,2 @@
battery-ux.patch
revert-dpms-changes.patch

6
debian/rules vendored
View File

@ -7,7 +7,11 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%: %:
dh ${@} --buildsystem cmake dh ${@} --buildsystem cmake
override_dh_missing:
dh_missing --fail-missing
override_dh_auto_configure: override_dh_auto_configure:
dh_auto_configure -- \ dh_auto_configure -- \
-DUPDATE_TRANSLATIONS=OFF \ -DPULL_TRANSLATIONS=OFF\
-DUPDATE_TRANSLATIONS=OFF\
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=RelWithDebInfo

12
debian/salsa-ci.yml vendored
View File

@ -1,12 +0,0 @@
# For more information on what jobs are run see:
# https://salsa.debian.org/salsa-ci-team/pipeline
#
# To enable the jobs, go to your repository (at salsa.debian.org)
# and click over Settings > CI/CD > Expand (in General pipelines).
# In "Custom CI config path" write debian/salsa-ci.yml and click
# in "Save Changes". The CI tests will run after the next commit.
---
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml

2
debian/source/lintian-overrides vendored Normal file
View File

@ -0,0 +1,2 @@
# We won't be forwarding this patch upstream
lxqt-powermanagement source: patch-not-forwarded-upstream [debian/patches/revert-dpms-changes.patch]

View File

@ -1,55 +1,5 @@
-----BEGIN PGP PUBLIC KEY BLOCK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zqSEyGM+UQR3X2CYpxrMakfW32Q18K ttDKN18cXV52Ssxnj0qhgf4hwnu/b0be6BzqSEyGM+UQR3X2CYpxrMakfW32Q18K
X5ec0RPR2ucBq9G0r9t6FYC8FkJ4uQUU3xxrLW3z302S0Makjgzm8BV9WrFQ7oFF X5ec0RPR2ucBq9G0r9t6FYC8FkJ4uQUU3xxrLW3z302S0Makjgzm8BV9WrFQ7oFF

9
debian/watch vendored
View File

@ -1,6 +1,5 @@
version=4 version=4
opts="searchmode=plain, \
# See https://davesteele.github.io/development/2015/05/02/debian-watch-file-format-for-signed-github-source-tars/ for GitHub workaround for releases page. pgpsigurlmangle=s/$/.asc/, \
uversionmangle=s/(\d+\.\d+\.\d+).*/$1/" \
opts="downloadurlmangle=s/archive\/refs\/tags\/@ANY_VERSION@@ARCHIVE_EXT@/releases\/download\/$1\/@PACKAGE@-$1\.tar\.xz/,filenamemangle=s/@ANY_VERSION@@ARCHIVE_EXT@/@PACKAGE@-$1\.tar\.xz/,pgpsigurlmangle=s/$/.asc/" \ https://api.github.com/repos/lxqt/@PACKAGE@/releases https:\/\/github.com\/lxqt\/@PACKAGE@\/releases\/download\/@ANY_VERSION@\/@PACKAGE@-@ANY_VERSION@.tar.xz
https://github.com/lxqt/@PACKAGE@/tags .*/@ANY_VERSION@@ARCHIVE_EXT@