added beta of hover texts
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
|
||||
property string shortDate: Qt.formatDate(new Date(), "ddd, dd.MM.yyyy - ")
|
||||
property string fullDate: Qt.formatDate(new Date(), "dddd, MMMM d, yyyy")
|
||||
property string currentTime: Qt.formatTime(new Date(), "hh:mm:ss")
|
||||
property string uptime: "Uptime: ..."
|
||||
property bool expanded: false
|
||||
|
||||
property Timer timeTimer: Timer {
|
||||
interval: 1000
|
||||
running: true
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: root.currentTime = Qt.formatTime(new Date(), "hh:mm:ss")
|
||||
}
|
||||
|
||||
property Timer dateTimer: Timer {
|
||||
interval: 60000
|
||||
running: true
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: {
|
||||
root.shortDate = Qt.formatDate(new Date(), "ddd, dd.MM.yyyy - ")
|
||||
root.fullDate = Qt.formatDate(new Date(), "dddd, MMMM d, yyyy")
|
||||
}
|
||||
}
|
||||
|
||||
property Process sysInfoProcess: Process {
|
||||
command: ["sh", "-c", "echo $(cat /proc/uptime)"]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
var uptimeSecs = parseFloat(text.trim().split(" ")[0])
|
||||
var days = Math.floor(uptimeSecs / 86400)
|
||||
var hours = Math.floor((uptimeSecs % 86400) / 3600)
|
||||
var mins = Math.floor((uptimeSecs % 3600) / 60)
|
||||
root.uptime = "Uptime: " + days + "d " + hours + "h " + mins + "m"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Timer sysInfoTimer: Timer {
|
||||
interval: 10000
|
||||
running: true
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: root.sysInfoProcess.running = true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
singleton ClockState ClockState.qml
|
||||
Reference in New Issue
Block a user