@hybrid fjord
import dbus from "@homebridge/dbus-native";
const sessionBus = dbus.sessionBus();
sessionBus
.getService("org.freedesktop.portal.Desktop")
.getInterface("/org/freedesktop/portal/desktop", "org.freedesktop.portal.Settings", function (err, settings) {
if (err) { return ""; }
settings.Read("org.freedesktop.appearance", "accent-color", function (err, result) {
if (err) { return ""; }
const [r, g, b] = result[1][0][1][0];
const r255 = Math.round(r * 255);
const g255 = Math.round(g * 255);
const b255 = Math.round(b * 255);
const toHex = (value: number) => value.toString(16).padStart(2, "0");
const hexColor = `#${toHex(r255)}${toHex(g255)}${toHex(b255)}`;
console.log(hexColor);
});
});
needs to be async but should work












