move to snowfall

This commit is contained in:
zackartz 2024-05-23 20:26:30 +00:00
parent 9d7ad7c973
commit 769d4b0df5
No known key found for this signature in database
GPG key ID: 5B53E53A9A514DBA
188 changed files with 2203 additions and 3041 deletions

View file

@ -1,49 +0,0 @@
import { Service, Utils } from "../imports.js";
class Brightness extends Service {
static {
Service.register(
this,
{},
{
screen: ["float", "rw"],
},
);
}
_screen = 0;
get screen() {
return this._screen;
}
set screen(percent) {
if (percent < 0) percent = 0;
if (percent > 1) percent = 1;
Utils.execAsync(`brightnessctl s ${percent * 100}% -q`)
.then(() => {
this._screen = percent;
this.changed("screen");
})
.catch(console.error);
}
constructor() {
super();
try {
this._screen =
Number(Utils.exec("brightnessctl g")) /
Number(Utils.exec("brightnessctl m"));
} catch (error) {
console.error("missing dependancy: brightnessctl");
}
}
}
const service = new Brightness();
globalThis.brightness = service;
export default service;