Add matugen config for quickshell and add futures box
This commit is contained in:
33
quickshell/services/FortuneService.qml
Normal file
33
quickshell/services/FortuneService.qml
Normal file
@@ -0,0 +1,33 @@
|
||||
import QtQuick
|
||||
import Quickshell.Io
|
||||
|
||||
Item {
|
||||
id: fortuneService
|
||||
|
||||
property string fortuneText: "Loading..."
|
||||
|
||||
Process {
|
||||
id: fortuneProcess
|
||||
command: ["fortune"]
|
||||
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
fortuneService.fortuneText = this.text.trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
fortuneProcess.running = true;
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 60000 // update fortune every minute
|
||||
repeat: true
|
||||
running: true
|
||||
|
||||
onTriggered: {
|
||||
fortuneProcess.running = true; // run the process again to get a new fortune
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user