feat: basic quickshell setup
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
Scope {}
|
||||
@@ -0,0 +1,10 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "."
|
||||
import "../../config"
|
||||
|
||||
Text {
|
||||
text: `${ClockHandler.date}, ${ClockHandler.time}`
|
||||
color: Appearance.colors.m3onBackground
|
||||
Layout.leftMargin: 10
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
property string time
|
||||
property string date
|
||||
|
||||
Process {
|
||||
id: dateProc
|
||||
command: ["date", "+%a %e %b|%T"]
|
||||
running: true
|
||||
|
||||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
date = data.split("|")[0];
|
||||
time = data.split("|")[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 1000
|
||||
running: true
|
||||
repeat: true
|
||||
onTriggered: dateProc.running = true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
|
||||
Scope {
|
||||
id: root
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
Clock 1.0 Clock.qml
|
||||
singleton ClockHandler 1.0 ClockHandler.qml
|
||||
Reference in New Issue
Block a user