diff options
Diffstat (limited to 'modules/dashboard/dash/User.qml')
| -rw-r--r-- | modules/dashboard/dash/User.qml | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/modules/dashboard/dash/User.qml b/modules/dashboard/dash/User.qml index 8dcde1e..2b475dd 100644 --- a/modules/dashboard/dash/User.qml +++ b/modules/dashboard/dash/User.qml @@ -4,7 +4,6 @@ import qs.services import qs.config import qs.utils import Quickshell -import Quickshell.Io import QtQuick Row { @@ -129,37 +128,8 @@ Row { id: uptime icon: "timer" - text: qsTr("Loading uptime...") + text: qsTr("up %1").arg(SysInfo.uptime) colour: Colours.palette.m3tertiary - - Timer { - running: true - repeat: true - interval: 15000 - onTriggered: fileUptime.reload() - } - - FileView { - id: fileUptime - - path: "/proc/uptime" - onLoaded: { - const up = parseInt(text().split(" ")[0] ?? 0); - - const days = Math.floor(up / 86400); - const hours = Math.floor((up % 86400) / 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"}`; - if (minutes > 0 || !str) - str += `${str ? ", " : ""}${minutes} minute${minutes === 1 ? "" : "s"}`; - uptime.text = qsTr("up %1").arg(str); - } - } } } |