@zeluizr/lattice 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/LICENSE +21 -0
- package/MANIFESTO.md +37 -0
- package/README.md +139 -0
- package/dist/app.js +196 -0
- package/dist/cli.js +116 -0
- package/dist/collectors/disks.js +96 -0
- package/dist/collectors/git.js +89 -0
- package/dist/collectors/gpu.js +28 -0
- package/dist/collectors/power.js +105 -0
- package/dist/collectors/sensors.js +80 -0
- package/dist/collectors/system.js +71 -0
- package/dist/collectors/tokens.js +185 -0
- package/dist/collectors/types.js +2 -0
- package/dist/collectors/vtex.js +37 -0
- package/dist/components/LanguageSelect.js +25 -0
- package/dist/components/Panel.js +6 -0
- package/dist/config.js +42 -0
- package/dist/format.js +56 -0
- package/dist/i18n/en.js +76 -0
- package/dist/i18n/es.js +75 -0
- package/dist/i18n/index.js +38 -0
- package/dist/i18n/pt-BR.js +75 -0
- package/dist/icons.js +50 -0
- package/dist/theme.js +34 -0
- package/native/build.sh +23 -0
- package/native/smc.c +151 -0
- package/package.json +74 -0
- package/prebuilds/darwin-arm64/lattice-smc +0 -0
- package/scripts/setup-sudoers.sh +29 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# (Optional) Allow `powermetrics` via sudo WITHOUT a password, so lattice can
|
|
3
|
+
# show watts without you typing your password every time.
|
|
4
|
+
#
|
|
5
|
+
# Creates /etc/sudoers.d/lattice-powermetrics. Run with:
|
|
6
|
+
# sudo bash scripts/setup-sudoers.sh
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
if [ "$(id -u)" -ne 0 ]; then
|
|
10
|
+
echo "Run with sudo: sudo bash scripts/setup-sudoers.sh" >&2
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
USER_NAME="${SUDO_USER:-$(whoami)}"
|
|
15
|
+
PM="$(command -v powermetrics || echo /usr/bin/powermetrics)"
|
|
16
|
+
FILE="/etc/sudoers.d/lattice-powermetrics"
|
|
17
|
+
|
|
18
|
+
echo "${USER_NAME} ALL=(root) NOPASSWD: ${PM}" > "$FILE"
|
|
19
|
+
chmod 0440 "$FILE"
|
|
20
|
+
|
|
21
|
+
# validate syntax; if invalid, remove so it can't break sudo
|
|
22
|
+
if visudo -cf "$FILE" >/dev/null; then
|
|
23
|
+
echo "OK: ${USER_NAME} can run ${PM} without a password."
|
|
24
|
+
echo "Now run: lattice"
|
|
25
|
+
else
|
|
26
|
+
rm -f "$FILE"
|
|
27
|
+
echo "Invalid syntax — file removed." >&2
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|