forked from ChimeraOS/chimeraos
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
honjow
committed
Mar 5, 2025
1 parent
a2e24e3
commit 7d7497f
Showing
3 changed files
with
45 additions
and
18 deletions.
There are no files selected for viewing
26 changes: 10 additions & 16 deletions
26
pkgs/mangohud-git/0001-feat-display-battery-charging-power.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,28 @@ | ||
From 5c309efafdc2cf499e9ff8ea2d6681e20de30762 Mon Sep 17 00:00:00 2001 | ||
From dd5e64613b61dd6959e11f0cb6cad4dfe629952d Mon Sep 17 00:00:00 2001 | ||
From: honjow <[email protected]> | ||
Date: Wed, 5 Mar 2025 19:39:39 +0800 | ||
Subject: [PATCH] feat: display battery charging power | ||
Date: Wed, 5 Mar 2025 20:50:35 +0800 | ||
Subject: [PATCH 1/2] feat: display battery charging power | ||
|
||
- Remove special handling for charging state in getPower() function | ||
- Display actual power value during battery charging | ||
- Add +/- prefix to power value to indicate charging/discharging status | ||
--- | ||
src/battery.cpp | 7 ++++--- | ||
src/battery.cpp | 2 +- | ||
src/hud_elements.cpp | 8 +++++++- | ||
2 files changed, 11 insertions(+), 4 deletions(-) | ||
2 files changed, 8 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/battery.cpp b/src/battery.cpp | ||
index e5d311b..297217b 100644 | ||
index e5d311b..f4ff2d9 100644 | ||
--- a/src/battery.cpp | ||
+++ b/src/battery.cpp | ||
@@ -104,9 +104,10 @@ float BatteryStats::getPower() { | ||
@@ -104,7 +104,7 @@ float BatteryStats::getPower() { | ||
state[i]=current_status; | ||
} | ||
|
||
- if (state[i] == "Charging" || state[i] == "Unknown" || state[i] == "Full") { | ||
- return 0; | ||
- } | ||
+ // 移除对充电状态的特殊处理,让充电功率也能显示 | ||
+ // if (state[i] == "Charging" || state[i] == "Unknown" || state[i] == "Full") { | ||
+ // return 0; | ||
+ // } | ||
+ if (state[i] != "Charging" && state[i] != "Discharging") { | ||
return 0; | ||
} | ||
|
||
if (fs::exists(current_power)) { | ||
std::ifstream input(current_power); | ||
diff --git a/src/hud_elements.cpp b/src/hud_elements.cpp | ||
index e820908..90790fc 100644 | ||
--- a/src/hud_elements.cpp | ||
|
31 changes: 31 additions & 0 deletions
31
pkgs/mangohud-git/0002-Add-support-for-more-handheld-devices-to-fan-detecti.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 6a1a3ffce34406f53a470362956d7f96c75b645f Mon Sep 17 00:00:00 2001 | ||
From: honjow <[email protected]> | ||
Date: Wed, 5 Mar 2025 22:01:18 +0800 | ||
Subject: [PATCH 2/2] Add support for more handheld devices to fan detection | ||
|
||
--- | ||
src/overlay.cpp | 8 +++++++- | ||
1 file changed, 7 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/src/overlay.cpp b/src/overlay.cpp | ||
index 80ebac5..8d9a86b 100644 | ||
--- a/src/overlay.cpp | ||
+++ b/src/overlay.cpp | ||
@@ -866,7 +866,13 @@ void update_fan(){ | ||
auto dirs = ls(path.c_str(), "hwmon", LS_DIRS); | ||
for (auto& dir : dirs) { | ||
string full_path = (path + dir + "/name").c_str(); | ||
- if (read_line(full_path).find("steamdeck_hwmon") != string::npos){ | ||
+ string name = read_line(full_path); | ||
+ if (name.find("steamdeck_hwmon") != string::npos || | ||
+ name.find("asus") != string::npos || | ||
+ name.find("aynec") != string::npos || | ||
+ name.find("gpdfan") != string::npos || | ||
+ name.find("oxp_ec") != string::npos || | ||
+ name.find("oxpec") != string::npos){ | ||
hwmon_path = path + dir + "/fan1_input"; | ||
break; | ||
} | ||
-- | ||
2.48.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters