Skip to content

Commit

Permalink
fix: arm64: linux battery info
Browse files Browse the repository at this point in the history
  • Loading branch information
alexVinarskis committed Oct 15, 2024
1 parent 4994bff commit 3905de7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/classes/api_battery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ApiBattery {
static Future<bool> _query() async {
// get response
if (Platform.isLinux) {
ProcessResult pr = (await _shell.run(Battery.batteryInfoLinux.cmd))[0];
ProcessResult pr = (await _shell.run('''bash -c "${Battery.batteryInfoLinux.cmd}"'''))[0];
if (!_processReponseLinux(pr)) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/battery.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Battery {
static const batteryInfoLinux = (
cmd: 'cat /sys/class/power_supply/AC/uevent /sys/class/power_supply/BAT0/uevent',
cmd: 'cat /sys/class/power_supply/*/uevent',
args: (
// parameters linux variable names sample values for XPS 9530
powerSupplyPresent: 'POWER_SUPPLY_ONLINE', // 1/0, whether AC is connected
Expand Down

0 comments on commit 3905de7

Please sign in to comment.