55 lines
1.1 KiB
QML
55 lines
1.1 KiB
QML
import QtQuick
|
|
import Quickshell.Widgets
|
|
import Quickshell.Io
|
|
import qs.Services
|
|
import qs.Common
|
|
import qs.Common.Styled
|
|
|
|
Item {
|
|
property var monitor: ""
|
|
|
|
MarginWrapperManager {
|
|
rightMargin: Theme.gaps
|
|
leftMargin: Theme.gaps
|
|
}
|
|
|
|
BackgroundRectangle {
|
|
id: clock
|
|
|
|
implicitWidth: clockText.implicitWidth * 1.6
|
|
implicitHeight: Theme.heightGaps
|
|
|
|
property string calendar: ""
|
|
|
|
StyledText {
|
|
id: clockText
|
|
|
|
anchors.centerIn: parent
|
|
text: Time.time
|
|
}
|
|
|
|
Process {
|
|
id: cal
|
|
running: true
|
|
command: ["cal", "-S3"]
|
|
stdout: StdioCollector {
|
|
onStreamFinished: {
|
|
clock.calendar = this.text;
|
|
}
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
hoverEnabled: true
|
|
onEntered: {
|
|
cal.running = true;
|
|
PopUpHover.start(clock, "time");
|
|
}
|
|
onExited: {
|
|
PopUpHover.exit();
|
|
}
|
|
}
|
|
}
|
|
}
|