i

Owner: IIIlllIIIllI URL: git@github.com:nyangkosense/i.git

more dynamic power control

Commit 699a9d4b691329e2391a21107ccbadb70f41bb7d by SeMi <sebastian.michalk@protonmail.com> on 2025-06-15 14:24:14 +0200
diff --git a/config.def.h b/config.def.h
index 9d4e8e2..68929b1 100644
--- a/config.def.h
+++ b/config.def.h
@@ -24,9 +24,16 @@ static const struct {
 /* battery path - adjust for your system */
 static const char *battery_path = "/sys/class/power_supply/BAT0";
 
-/* commands for power management (requires appropriate sudo permissions) */
-static const char *reboot_cmd = "/usr/bin/doas /sbin/reboot";
-static const char *shutdown_cmd = "/usr/bin/doas /sbin/shutdown -h now";
+/* commands for power management (adjust for your system) */
+/* Common alternatives:
+ * sudo systems: "sudo reboot", "sudo shutdown -h now"
+ * doas systems: "doas reboot", "doas shutdown -h now" 
+ * systemd: "systemctl reboot", "systemctl poweroff"
+ * OpenBSD: "doas /sbin/reboot", "doas /sbin/shutdown -h now"
+ * FreeBSD: "sudo /sbin/reboot", "sudo /sbin/shutdown -h now"
+ */
+static const char *reboot_cmd = "PATH=/usr/bin:/bin:/sbin:/usr/sbin doas reboot";
+static const char *shutdown_cmd = "PATH=/usr/bin:/bin:/sbin:/usr/sbin doas shutdown -h now";
 
 /* ASCII art definitions for different operating systems */
 static const char *ascii_alpine[] = {