mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2026-01-10 03:32:54 +00:00
feat: update system
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
import Widget from "resource:///com/github/Aylur/ags/widget.js";
|
||||
import icons from "../../icons.js";
|
||||
import Brightness from "../../services/brightness.js";
|
||||
import * as Utils from "resource:///com/github/Aylur/ags/utils.js";
|
||||
|
||||
const CanSupportBrightness = () => Utils.exec("which gbmonctl");
|
||||
|
||||
const BrightnessSlider = () =>
|
||||
Widget.Slider({
|
||||
draw_value: false,
|
||||
hexpand: true,
|
||||
binds: [["value", Brightness, "screen"]],
|
||||
value: Brightness.bind("screen"),
|
||||
on_change: ({ value }) => (Brightness.screen = value),
|
||||
});
|
||||
|
||||
@@ -18,14 +15,9 @@ export default () =>
|
||||
children: [
|
||||
Widget.Button({
|
||||
child: Widget.Icon(icons.brightness.indicator),
|
||||
binds: [
|
||||
[
|
||||
"tooltip-text",
|
||||
Brightness,
|
||||
"screen",
|
||||
(v) => `Screen Brightness: ${Math.floor(v * 100)}%`,
|
||||
],
|
||||
],
|
||||
tooltip_text: Brightness.bind("screen").transform(
|
||||
(v) => `Screen Brightness: ${Math.floor(v * 100)}%`,
|
||||
),
|
||||
}),
|
||||
BrightnessSlider(),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user