all repos — quickshell @ 55b30d92682fe15ee20bd17e46c79ca21e176659

A desert-witch desktop shell

bar/modules/Sunset.qml (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
// Sunset.qml
import QtQuick
import Quickshell
import Quickshell.Io
import QtQuick.Layouts
import "../.."
import "classes"

// TopbarIcon {
//   id: sunset_indicator
//   text: sunset.text[0] == "+" ? "𖡹" : "𖥸"
//   font.pixelSize: Resources.fontsize.topbar_bamum
// }
BarText {
  id: sunset
  Process {
    id: sunset_script
    command: ["bar/scripts/suntime.sh"]
    workingDirectory: Quickshell.shellDir
    running: true
    stdout: StdioCollector {
      onStreamFinished: {
        sunset.text = '<span style="color:#c1a387;">│</span>' + Icons.modules.sunset + this.text.trim();
      }
    }
  }
  Timer {
    interval: 1000
    running: true
    repeat: true
    onTriggered: sunset_script.running = true
  }
}