summaryrefslogtreecommitdiff
path: root/modules/dashboard/dash/User.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-11 15:59:39 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-11 15:59:39 +1000
commit1e1cdd95c1cb81e40c9198ab644badb348332389 (patch)
tree85bfc01b6d7bb366e57891426f57024955d8d303 /modules/dashboard/dash/User.qml
parentlock: better scaling for weather & fetch (diff)
downloadcaelestia-shell-1e1cdd95c1cb81e40c9198ab644badb348332389.tar.gz
caelestia-shell-1e1cdd95c1cb81e40c9198ab644badb348332389.tar.bz2
caelestia-shell-1e1cdd95c1cb81e40c9198ab644badb348332389.zip
lock/fetch: shell -> uptime + no qsTr
Diffstat (limited to 'modules/dashboard/dash/User.qml')
-rw-r--r--modules/dashboard/dash/User.qml32
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);
- }
- }
}
}