all repos — quickshell @ e5e7d5b81d5680177d3d337f5ff234e2f703c681

A desert-witch desktop shell

bar/modules/Ram.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
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
// Ram.qml TODO
import QtQuick
import Quickshell
import Quickshell.Io
import QtQuick.Layouts
import "../../"
import "../classes" as Class

Class.RightRowLayout {
  id: ram_module
  Class.TopbarText {
    id: ram
    // Layout.alignment: Qt.AlignBottom
    // anchors.bottom: ram_module.top
    Process {
      id: ram_script
      command: ["bar/scripts/ram.sh"]
      workingDirectory: Quickshell.shellDir
      running: true
      stdout: StdioCollector {
        onStreamFinished: ram.text = this.text.trim() +"%"
      }
    }

    Timer {
      interval: 1000
      running: true
      repeat: true
      onTriggered: ram_script.running = true
    }
  }
  Class.TopbarIcon {
    text: "ð–¡¶"
    font.pixelSize: Resources.fontsize.topbar_bamum
  }
  // Class.TopbarSVG {
  //   icon.source: "../../icons/phosphor/bold/cpu-bold.svg"
  //   // icon.source: "../../icons/phosphor/regular/cpu.svg"
  // icon.width:14*Size.scale
  // icon.height:14*Size.scale
  // }
  Class.TopSep {}
}