From 4b7e1d7d213ead08e6308026481faf1dfb561553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Meze=CC=82ncio?= Date: Mon, 23 Dec 2024 21:20:13 +0000 Subject: [PATCH 1/6] chore: update dependencies --- extensions/system-monitor/package-lock.json | 34 ++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/extensions/system-monitor/package-lock.json b/extensions/system-monitor/package-lock.json index 8249029d4f8a1..be8b565afe094 100644 --- a/extensions/system-monitor/package-lock.json +++ b/extensions/system-monitor/package-lock.json @@ -783,12 +783,13 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -860,10 +861,11 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -1229,10 +1231,11 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1462,6 +1465,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1605,12 +1609,13 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -2079,6 +2084,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, From 47bd88663eb5650c9d95188fce5a6fa754c1eb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Meze=CC=82ncio?= Date: Mon, 23 Dec 2024 21:20:35 +0000 Subject: [PATCH 2/6] chore: change the way the battery usage is get --- extensions/system-monitor/src/Power/PowerUtils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/system-monitor/src/Power/PowerUtils.ts b/extensions/system-monitor/src/Power/PowerUtils.ts index 26711b33ba029..35d284917faf0 100644 --- a/extensions/system-monitor/src/Power/PowerUtils.ts +++ b/extensions/system-monitor/src/Power/PowerUtils.ts @@ -5,13 +5,14 @@ import { convertMsToTime, execp } from "../utils"; export const getBatteryData = async (): Promise => { const smartBatteryOutput = await execp("/usr/sbin/ioreg -arn AppleSmartBattery"); const systemProfilerOutput = await execp( - `/usr/sbin/system_profiler SPPowerDataType | grep -e 'Condition' -e 'Maximum Capacity'| awk '{print $NF}'`, + `/usr/sbin/system_profiler SPPowerDataType | /usr/bin/grep -e 'Condition' -e 'Maximum Capacity'| /usr/bin/awk '{print $NF}'`, ); const smartBattery = (plist.parse(smartBatteryOutput) as PlistArray)[0] as PlistObject; const [condition, maximumCapacity] = systemProfilerOutput.split("\n"); + const batteryLevel = await execp("/usr/bin/pmset -g batt | /usr/bin/grep -Eo '\\d+%' | /usr/bin/tr -d '%'"); return { - batteryLevel: smartBattery.CurrentCapacity.toString(), + batteryLevel, condition, cycleCount: smartBattery.CycleCount.toString(), fullyCharged: !!smartBattery.FullyCharged, From 1371f3ddafab6a606e40d98a54f7691c5e3a841e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Meze=CC=82ncio?= Date: Mon, 23 Dec 2024 21:25:08 +0000 Subject: [PATCH 3/6] chore: update CHANGELOG --- extensions/system-monitor/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/system-monitor/CHANGELOG.md b/extensions/system-monitor/CHANGELOG.md index 0af948f38b699..5f7ba4bf35c3a 100644 --- a/extensions/system-monitor/CHANGELOG.md +++ b/extensions/system-monitor/CHANGELOG.md @@ -1,5 +1,9 @@ # System Monitor Changelog +## [Fix] - 2024-12-23 + +- Fix issue when showing processes battery usage on Intel-based Macs + ## [Chore] - 2024-11-24 - Fixed wording in description From 668d1c6a163ae064612e0475164177f101d6f876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Meze=CC=82ncio?= Date: Mon, 23 Dec 2024 21:26:37 +0000 Subject: [PATCH 4/6] typo: update CHANGELOG --- extensions/system-monitor/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/system-monitor/CHANGELOG.md b/extensions/system-monitor/CHANGELOG.md index 5f7ba4bf35c3a..866d69d0f6825 100644 --- a/extensions/system-monitor/CHANGELOG.md +++ b/extensions/system-monitor/CHANGELOG.md @@ -2,7 +2,7 @@ ## [Fix] - 2024-12-23 -- Fix issue when showing processes battery usage on Intel-based Macs +- Fix issue when showing battery level on Intel-based Macs ## [Chore] - 2024-11-24 From e07ff303f68af52c655358b7a28d0483c3086f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nielsen=20Tik=C3=A6r?= Date: Thu, 2 Jan 2025 08:51:50 +0100 Subject: [PATCH 5/6] Update CHANGELOG.md --- extensions/system-monitor/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/system-monitor/CHANGELOG.md b/extensions/system-monitor/CHANGELOG.md index 866d69d0f6825..29c2478a1f012 100644 --- a/extensions/system-monitor/CHANGELOG.md +++ b/extensions/system-monitor/CHANGELOG.md @@ -1,6 +1,6 @@ # System Monitor Changelog -## [Fix] - 2024-12-23 +## [Fix] - {PR_MERGE_DATE} - Fix issue when showing battery level on Intel-based Macs From a278a32fe54ea05f0b525fa25685b1e07d8910db Mon Sep 17 00:00:00 2001 From: raycastbot Date: Thu, 2 Jan 2025 07:53:35 +0000 Subject: [PATCH 6/6] Update CHANGELOG.md and optimise images --- extensions/system-monitor/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/system-monitor/CHANGELOG.md b/extensions/system-monitor/CHANGELOG.md index 29c2478a1f012..247bb0fdc133e 100644 --- a/extensions/system-monitor/CHANGELOG.md +++ b/extensions/system-monitor/CHANGELOG.md @@ -1,6 +1,6 @@ # System Monitor Changelog -## [Fix] - {PR_MERGE_DATE} +## [Fix] - 2025-01-02 - Fix issue when showing battery level on Intel-based Macs