summaryrefslogtreecommitdiff
path: root/.config/quickshell/Modules/BarStatus.qml
blob: 436392a72e9739cb02dac15bb003d9fe13de5ff9 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import Quickshell
import QtQuick
import QtQuick.Layouts
import qs.Services

Rectangle {
	anchors.verticalCenter: parent.verticalCenter
	anchors.right: parent.right
	implicitWidth: status.implicitWidth + 12*2
	height: parent.height
	color: Flexoki.bg
	radius: 18

	RowLayout {
		id: status
		anchors.centerIn: parent
		implicitHeight: parent.implicitHeight
		spacing: 24

		Text {
			text: {
				//     
				var icon
				if (Volume.volume == 0) {
					icon = " "
				} else if (Volume.volume < 50) {
					icon = " "
				} else {
					icon = "  "
				}
				return icon + Volume.volume + "%"
			}
			color: Flexoki.re
			font { family: root.fontFamily; pixelSize: root.fontSize }
		}

		Text {
			text: Wifi.ssid == "" ? "󰖪 " : "󰖩 " + Wifi.ssid
			color: Flexoki.or
			font { family: root.fontFamily; pixelSize: root.fontSize }
		}

		Text {
			text: " " + Brightness.brightness + "%"
			color: Flexoki.ye
			font { family: root.fontFamily; pixelSize: root.fontSize }
		}

		Text {
			text: {
				var icon
				var i = Math.floor((Battery.capacity - 1) / 10)
				switch (Battery.status) {
					case "Full":
						icon = "󰂄"
						break
					case "Discharging":
						icon = ["󰁺","󰁻","󰁼","󰁽","󰁾","󰁿","󰂀","󰂁","󰂂","󰁹"][i]
						break
					case "Charging":
						icon = ["󰢜","󰂆","󰂇","󰂈","󰢝","󰂉","󰢞","󰂊","󰂋","󰂅"][i]
						break
				}
			  return icon + " " + Battery.capacity + "%"
			}
			color: Flexoki.gr
			font { family: root.fontFamily; pixelSize: root.fontSize }
		}

		Text {
			text: " " + Qt.formatDateTime(Time.time, "MMM d hh:mm:ss")
			color: Flexoki.bl
			font { family: root.fontFamily; pixelSize: root.fontSize }
		}

		Text {
			text: "󰐥"
			color: Flexoki.pu
			font { family: root.fontFamily; pixelSize: root.fontSize * 1.5 }
		}
	}
}