init: working version
This commit is contained in:
commit
7d8d7dacae
109 changed files with 15066 additions and 0 deletions
36
services/User.qml
Normal file
36
services/User.qml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
Singleton {
|
||||
|
||||
readonly property string user: userProcess.user
|
||||
readonly property string uptime: fileUptime.uptime
|
||||
|
||||
Timer {
|
||||
running: true
|
||||
repeat: true
|
||||
interval: 15000
|
||||
triggeredOnStart: true
|
||||
onTriggered: fileUptime.reload()
|
||||
}
|
||||
|
||||
FileView {
|
||||
id: fileUptime
|
||||
property string uptime: ""
|
||||
path: "/proc/uptime"
|
||||
onLoaded: uptime = Time.formatSeconds(parseInt(text().split(" ")[0] ?? 0));
|
||||
}
|
||||
|
||||
Process {
|
||||
id: userProcess
|
||||
property string user: ""
|
||||
running: true
|
||||
command: ["whoami"]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: userProcess.user = this.text.trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue