From b06811a3c5e6e1048ba824aa7f30ffe2cfd1d749 Mon Sep 17 00:00:00 2001 From: Surillya Date: Fri, 20 Jun 2025 21:44:39 +0200 Subject: [PATCH] Added WiFi button and system-apis --- api/set_brightness.php | 11 +++ api/set_volume.php | 11 +++ index.php | 199 +++++++++++++++++++++++++++++++++++++++-- wifi_list.php | 3 - 4 files changed, 212 insertions(+), 12 deletions(-) create mode 100644 api/set_brightness.php create mode 100644 api/set_volume.php diff --git a/api/set_brightness.php b/api/set_brightness.php new file mode 100644 index 0000000..0cfe9f9 --- /dev/null +++ b/api/set_brightness.php @@ -0,0 +1,11 @@ + 100) { + echo json_encode(['success' => false, 'error' => 'Invalid level']); + exit; +} + +$output = shell_exec("sudo brightnessctl set {$level}%"); +echo json_encode(['success' => true]); +?> diff --git a/api/set_volume.php b/api/set_volume.php new file mode 100644 index 0000000..4aa86e8 --- /dev/null +++ b/api/set_volume.php @@ -0,0 +1,11 @@ + 100) { + echo json_encode(['success' => false, 'error' => 'Invalid level']); + exit; +} + +$output = shell_exec("pactl set-sink-volume @DEFAULT_SINK@ {$level}%"); +echo json_encode(['success' => true]); +?> diff --git a/index.php b/index.php index 86f1503..fccf1a1 100644 --- a/index.php +++ b/index.php @@ -300,15 +300,41 @@ if (!$state || !isset($state['localData']) || !json_decode($state['localData'],
-
- + +
+ + + +
@@ -392,6 +418,29 @@ if (!$state || !isset($state['localData']) || !json_decode($state['localData'],
+ + + + + +