1 |
commit: e4d3f8da14ece852be3a05d8ac0984e3c46905f5 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 15 14:29:24 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 23 14:59:15 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4d3f8da |
7 |
|
8 |
kde-plasma/powerdevil: Always dismiss critical battery notification |
9 |
|
10 |
Upstream commit d8c5490c99bae9f979f6483dc7b0381121a4f997 |
11 |
|
12 |
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=445171 |
13 |
Package-Manager: Portage-3.0.28, Repoman-3.0.3 |
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
|
16 |
...evil-5.23.3-dismiss-battery-notifications.patch | 71 ++++++++++++++++++++++ |
17 |
kde-plasma/powerdevil/powerdevil-5.23.3-r1.ebuild | 71 ++++++++++++++++++++++ |
18 |
2 files changed, 142 insertions(+) |
19 |
|
20 |
diff --git a/kde-plasma/powerdevil/files/powerdevil-5.23.3-dismiss-battery-notifications.patch b/kde-plasma/powerdevil/files/powerdevil-5.23.3-dismiss-battery-notifications.patch |
21 |
new file mode 100644 |
22 |
index 000000000000..997807a2214a |
23 |
--- /dev/null |
24 |
+++ b/kde-plasma/powerdevil/files/powerdevil-5.23.3-dismiss-battery-notifications.patch |
25 |
@@ -0,0 +1,71 @@ |
26 |
+From d8c5490c99bae9f979f6483dc7b0381121a4f997 Mon Sep 17 00:00:00 2001 |
27 |
+From: Kai Uwe Broulik <kde@××××××××××××××.de> |
28 |
+Date: Mon, 8 Nov 2021 20:02:33 +0100 |
29 |
+Subject: [PATCH] Always dismiss critical battery notification |
30 |
+ |
31 |
+The timer isn't running when user chose "Do nothing" on critical battery |
32 |
+ |
33 |
+BUG: 445171 |
34 |
+FIXED-IN: 5.23.4 |
35 |
+ |
36 |
+ |
37 |
+(cherry picked from commit 5668ded34f928ffce43ebe1defb775e70bbbb3b7) |
38 |
+--- |
39 |
+ daemon/powerdevilcore.cpp | 22 +++++++++++++--------- |
40 |
+ 1 file changed, 13 insertions(+), 9 deletions(-) |
41 |
+ |
42 |
+diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp |
43 |
+index 040dd6b6..c5ba3e54 100644 |
44 |
+--- a/daemon/powerdevilcore.cpp |
45 |
++++ b/daemon/powerdevilcore.cpp |
46 |
+@@ -259,7 +259,7 @@ void Core::reparseConfiguration() |
47 |
+ Q_EMIT configurationReloaded(); |
48 |
+ |
49 |
+ // Check if critical threshold might have changed and cancel the timer if necessary. |
50 |
+- if (m_criticalBatteryTimer->isActive() && currentChargePercent() > PowerDevilSettings::batteryCriticalLevel()) { |
51 |
++ if (currentChargePercent() > PowerDevilSettings::batteryCriticalLevel()) { |
52 |
+ m_criticalBatteryTimer->stop(); |
53 |
+ if (m_criticalBatteryNotification) { |
54 |
+ m_criticalBatteryNotification->close(); |
55 |
+@@ -494,14 +494,17 @@ void Core::onDeviceAdded(const QString &udi) |
56 |
+ m_lowBatteryNotification->close(); |
57 |
+ } |
58 |
+ |
59 |
+- if (m_criticalBatteryTimer->isActive() && currentChargePercent() > PowerDevilSettings::batteryCriticalLevel()) { |
60 |
+- m_criticalBatteryTimer->stop(); |
61 |
++ if (currentChargePercent() > PowerDevilSettings::batteryCriticalLevel()) { |
62 |
+ if (m_criticalBatteryNotification) { |
63 |
+ m_criticalBatteryNotification->close(); |
64 |
+ } |
65 |
+- emitRichNotification(QStringLiteral("pluggedin"), |
66 |
+- i18n("Extra Battery Added"), |
67 |
+- i18n("The computer will no longer go to sleep.")); |
68 |
++ |
69 |
++ if (m_criticalBatteryTimer->isActive()) { |
70 |
++ m_criticalBatteryTimer->stop(); |
71 |
++ emitRichNotification(QStringLiteral("pluggedin"), |
72 |
++ i18n("Extra Battery Added"), |
73 |
++ i18n("The computer will no longer go to sleep.")); |
74 |
++ } |
75 |
+ } |
76 |
+ } |
77 |
+ |
78 |
+@@ -692,11 +695,12 @@ void Core::onAcAdapterStateChanged(PowerDevil::BackendInterface::AcAdapterState |
79 |
+ m_lowBatteryNotification->close(); |
80 |
+ } |
81 |
+ |
82 |
++ if (m_criticalBatteryNotification) { |
83 |
++ m_criticalBatteryNotification->close(); |
84 |
++ } |
85 |
++ |
86 |
+ if (m_criticalBatteryTimer->isActive()) { |
87 |
+ m_criticalBatteryTimer->stop(); |
88 |
+- if (m_criticalBatteryNotification) { |
89 |
+- m_criticalBatteryNotification->close(); |
90 |
+- } |
91 |
+ emitRichNotification(QStringLiteral("pluggedin"), |
92 |
+ i18n("AC Adapter Plugged In"), |
93 |
+ i18n("The computer will no longer go to sleep.")); |
94 |
+-- |
95 |
+GitLab |
96 |
+ |
97 |
|
98 |
diff --git a/kde-plasma/powerdevil/powerdevil-5.23.3-r1.ebuild b/kde-plasma/powerdevil/powerdevil-5.23.3-r1.ebuild |
99 |
new file mode 100644 |
100 |
index 000000000000..a6c9f5612a36 |
101 |
--- /dev/null |
102 |
+++ b/kde-plasma/powerdevil/powerdevil-5.23.3-r1.ebuild |
103 |
@@ -0,0 +1,71 @@ |
104 |
+# Copyright 1999-2021 Gentoo Authors |
105 |
+# Distributed under the terms of the GNU General Public License v2 |
106 |
+ |
107 |
+EAPI=8 |
108 |
+ |
109 |
+ECM_HANDBOOK="forceoptional" |
110 |
+KFMIN=5.86.0 |
111 |
+PVCUT=$(ver_cut 1-3) |
112 |
+QTMIN=5.15.2 |
113 |
+inherit ecm kde.org |
114 |
+ |
115 |
+DESCRIPTION="Power management for KDE Plasma Shell" |
116 |
+HOMEPAGE="https://invent.kde.org/plasma/powerdevil" |
117 |
+ |
118 |
+LICENSE="GPL-2" # TODO: CHECK |
119 |
+SLOT="5" |
120 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" |
121 |
+IUSE="brightness-control caps +wireless" |
122 |
+ |
123 |
+DEPEND=" |
124 |
+ >=dev-qt/qtdbus-${QTMIN}:5 |
125 |
+ >=dev-qt/qtgui-${QTMIN}:5 |
126 |
+ >=dev-qt/qtwidgets-${QTMIN}:5 |
127 |
+ >=dev-qt/qtx11extras-${QTMIN}:5 |
128 |
+ >=kde-frameworks/kactivities-${KFMIN}:5 |
129 |
+ >=kde-frameworks/kauth-${KFMIN}:5[policykit] |
130 |
+ >=kde-frameworks/kcompletion-${KFMIN}:5 |
131 |
+ >=kde-frameworks/kconfig-${KFMIN}:5 |
132 |
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5 |
133 |
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5 |
134 |
+ >=kde-frameworks/kcrash-${KFMIN}:5 |
135 |
+ >=kde-frameworks/kdbusaddons-${KFMIN}:5 |
136 |
+ >=kde-frameworks/kglobalaccel-${KFMIN}:5 |
137 |
+ >=kde-frameworks/ki18n-${KFMIN}:5 |
138 |
+ >=kde-frameworks/kidletime-${KFMIN}:5 |
139 |
+ >=kde-frameworks/kio-${KFMIN}:5 |
140 |
+ >=kde-frameworks/knotifications-${KFMIN}:5 |
141 |
+ >=kde-frameworks/knotifyconfig-${KFMIN}:5 |
142 |
+ >=kde-frameworks/kservice-${KFMIN}:5 |
143 |
+ >=kde-frameworks/kwayland-${KFMIN}:5 |
144 |
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5 |
145 |
+ >=kde-frameworks/kxmlgui-${KFMIN}:5 |
146 |
+ >=kde-frameworks/solid-${KFMIN}:5 |
147 |
+ >=kde-plasma/libkscreen-${PVCUT}:5 |
148 |
+ >=kde-plasma/libkworkspace-${PVCUT}:5 |
149 |
+ virtual/libudev:= |
150 |
+ x11-libs/libxcb |
151 |
+ brightness-control? ( app-misc/ddcutil ) |
152 |
+ caps? ( sys-libs/libcap ) |
153 |
+ wireless? ( |
154 |
+ >=kde-frameworks/bluez-qt-${KFMIN}:5 |
155 |
+ >=kde-frameworks/networkmanager-qt-${KFMIN}:5 |
156 |
+ ) |
157 |
+" |
158 |
+RDEPEND="${DEPEND} |
159 |
+ >=kde-plasma/kde-cli-tools-${PVCUT}:5 |
160 |
+ >=sys-power/upower-0.9.23 |
161 |
+" |
162 |
+ |
163 |
+PATCHES=( "${FILESDIR}"/${P}-dismiss-battery-notifications.patch ) |
164 |
+ |
165 |
+src_configure() { |
166 |
+ local mycmakeargs=( |
167 |
+ -DHAVE_DDCUTIL=$(usex brightness-control) |
168 |
+ $(cmake_use_find_package caps Libcap) |
169 |
+ $(cmake_use_find_package wireless KF5BluezQt) |
170 |
+ $(cmake_use_find_package wireless KF5NetworkManagerQt) |
171 |
+ ) |
172 |
+ |
173 |
+ ecm_src_configure |
174 |
+} |