ddcutil-service usage

This commit is contained in:
Zacharias-Brohn
2026-02-27 14:46:09 +01:00
parent afb736102d
commit 178375d861
9 changed files with 59 additions and 17 deletions
+2 -5
View File
@@ -69,15 +69,12 @@ Singleton {
onLoaded: {
const up = parseInt(text().split(" ")[0] ?? 0);
const days = Math.floor(up / 86400);
const hours = Math.floor((up % 86400) / 3600);
const hours = Math.floor(up / 3600);
const minutes = Math.floor((up % 3600) / 60);
let str = "";
if (days > 0)
str += `${days} day${days === 1 ? "" : "s"}`;
if (hours > 0)
str += `${str ? ", " : ""}${hours} hour${hours === 1 ? "" : "s"}`;
str += `${hours} hour${hours === 1 ? "" : "s"}`;
if (minutes > 0 || !str)
str += `${str ? ", " : ""}${minutes} minute${minutes === 1 ? "" : "s"}`;
root.uptime = str;