Skip to content

Commit 4133500

Browse files
committed
feat(deck): Add vpower service for calculating battery stats
1 parent 834b92d commit 4133500

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

Containerfile

+2
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ RUN rpm-ostree install \
167167
jupiter-fan-control \
168168
jupiter-hw-support-btrfs \
169169
steamdeck-kde-presets \
170+
vpower \
170171
ds-inhibit \
171172
ryzenadj \
172173
gamemode \
@@ -199,6 +200,7 @@ RUN sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo
199200
mv /etc/sddm.conf /etc/sddm.conf.d/steamos.conf && \
200201
systemctl enable plasma-autologin.service && \
201202
systemctl enable jupiter-fan-control.service && \
203+
systemctl enable vpower.service && \
202204
systemctl enable ds-inhibit.service && \
203205
systemctl enable set-cfs-tweaks.service && \
204206
systemctl disable input-remapper.service && \

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Ported SteamOS and ChimeraOS packages, among others used by Bazzite, are built o
101101
|steamdeck-kde-presets|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/steamdeck-kde-presets/status_image/last_build.png?)|
102102
|steamdeck-kde-presets-desktop|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/steamdeck-kde-presets-desktop/status_image/last_build.png?)|
103103
|udisks2|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/udisks2/status_image/last_build.png?)|
104+
|vpower|![Build Status](https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/package/vpower/status_image/last_build.png?)|
104105

105106
Additionally, the following packages are used from other Copr repos:
106107
|Package|Status|

spec_files/vpower/LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2022 Valve Corporation
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

spec_files/vpower/vpower.spec

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
Name: vpower
2+
Version: 1.4.0
3+
Release: %autorelease
4+
Summary: Service that calculates battery metrics and handles critical battery scenarios
5+
6+
License: MIT
7+
URL: https://gitlab.com/evlaV/vpower/
8+
Source: %{url}-/archive/main/vpower-main.tar.gz
9+
10+
BuildRequires: rust-packaging >= 21
11+
BuildRequires: lm_sensors-devel
12+
BuildRequires: systemd-rpm-macros
13+
14+
Requires: lm_sensors
15+
Requires: lm_sensors-libs
16+
17+
%description
18+
Service that calculates battery metrics and handles critical battery scenarios
19+
20+
%prep
21+
%autosetup -n %{name}-main -p1
22+
%cargo_prep
23+
24+
%generate_buildrequires
25+
%cargo_generate_buildrequires
26+
27+
%build
28+
%cargo_build
29+
30+
%install
31+
%cargo_install
32+
mkdir -p %{buildroot}%{_unitdir}/
33+
cp -v vpower.service %{buildroot}%{_unitdir}/%{name}.service
34+
35+
%if %{with check}
36+
%check
37+
%cargo_test
38+
%endif
39+
40+
# Do post-installation
41+
%post
42+
%systemd_post %{name}.service
43+
44+
# Do before uninstallation
45+
%preun
46+
%systemd_preun %{name}.service
47+
48+
# Do after uninstallation
49+
%postun
50+
%systemd_postun_with_restart %{name}.service
51+
52+
%files
53+
%license LICENSE
54+
%{_bindir}/%{name}
55+
%{_unitdir}/%{name}.service
56+
57+
%changelog
58+
%autochangelog

0 commit comments

Comments
 (0)