Added WiFi button and system-apis

This commit is contained in:
2025-06-20 21:44:39 +02:00
parent 0d3ee0a0eb
commit b06811a3c5
4 changed files with 212 additions and 12 deletions

11
api/set_brightness.php Normal file
View File

@ -0,0 +1,11 @@
<?php
header('Content-Type: application/json');
$level = intval($_GET['level'] ?? 50);
if ($level < 10 || $level > 100) {
echo json_encode(['success' => false, 'error' => 'Invalid level']);
exit;
}
$output = shell_exec("sudo brightnessctl set {$level}%");
echo json_encode(['success' => true]);
?>

11
api/set_volume.php Normal file
View File

@ -0,0 +1,11 @@
<?php
header('Content-Type: application/json');
$level = intval($_GET['level'] ?? 50);
if ($level < 0 || $level > 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]);
?>