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'],
+ + + + + +