updated quickshell
This commit is contained in:
@@ -73,6 +73,7 @@ PanelWindow {
|
||||
component ToggleCard: Rectangle {
|
||||
property string title: ""
|
||||
property string icon: ""
|
||||
property string glyph: "" // Nerd Font glyph alternative to icon file
|
||||
property bool active: false
|
||||
signal clicked()
|
||||
|
||||
@@ -97,15 +98,22 @@ PanelWindow {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 12
|
||||
spacing: 12
|
||||
Text {
|
||||
visible: parent.parent.glyph !== ""
|
||||
text: parent.parent.glyph
|
||||
font.family: "JetBrainsMono Nerd Font"
|
||||
font.pixelSize: 20
|
||||
color: parent.parent.active ? Theme.accentVolt : Theme.textMuted
|
||||
}
|
||||
Image {
|
||||
source: icon ? Qt.resolvedUrl("../" + icon) : ""
|
||||
source: parent.parent.icon && parent.parent.glyph === "" ? Qt.resolvedUrl("../" + parent.parent.icon) : ""
|
||||
Layout.preferredWidth: 24
|
||||
Layout.preferredHeight: 24
|
||||
sourceSize: Qt.size(24, 24)
|
||||
visible: parent.icon !== ""
|
||||
visible: parent.parent.icon !== "" && parent.parent.glyph === ""
|
||||
}
|
||||
Text {
|
||||
text: title
|
||||
text: parent.parent.title
|
||||
color: Theme.textPrimary
|
||||
font.family: Theme.fontSans
|
||||
font.pixelSize: 13
|
||||
@@ -312,8 +320,7 @@ PanelWindow {
|
||||
icon: "assets/wifi.svg"
|
||||
active: GlobalState.wifiConnected
|
||||
onClicked: {
|
||||
let proc = Quickshell.createProcess("sh", ["-c", "nm-connection-editor || foot -e nmtui"])
|
||||
proc.start()
|
||||
Quickshell.execDetached(["sh", "-c", "nm-connection-editor || foot -e nmtui"])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,14 +337,14 @@ PanelWindow {
|
||||
ToggleCard {
|
||||
property bool dndActive: false
|
||||
title: "Do Not Disturb"
|
||||
icon: "" // Optional DND icon
|
||||
glyph: "\uF186"
|
||||
active: dndActive
|
||||
onClicked: dndActive = !dndActive
|
||||
}
|
||||
|
||||
ToggleCard {
|
||||
title: GlobalState.volumeMuted ? "Muted" : "Sound"
|
||||
icon: "" // Optional sound icon
|
||||
glyph: GlobalState.volumeMuted ? "\uF026" : "\uF028"
|
||||
active: !GlobalState.volumeMuted
|
||||
onClicked: GlobalState.toggleVolumeMute()
|
||||
}
|
||||
@@ -423,6 +430,13 @@ PanelWindow {
|
||||
valueText: GlobalState.memUsedGb + " / " + GlobalState.memTotalGb + " GB"
|
||||
}
|
||||
|
||||
ProgressBarItem {
|
||||
label: "DISK"
|
||||
percent: GlobalState.diskPercent
|
||||
valueText: GlobalState.diskUsedGb + " / " + GlobalState.diskTotalGb + " GB"
|
||||
barColor: GlobalState.diskPercent > 90 ? Theme.accentCoral : Theme.accentVolt
|
||||
}
|
||||
|
||||
ProgressBarItem {
|
||||
label: "VRAM"
|
||||
percent: (GlobalState.gpuVramUsed / Math.max(1, GlobalState.gpuVramTotal)) * 100
|
||||
@@ -446,7 +460,12 @@ PanelWindow {
|
||||
color: GlobalState.wifiConnected ? Theme.accentVolt : Theme.accentCoral
|
||||
}
|
||||
Text {
|
||||
text: GlobalState.wifiConnected ? "Connected" : "Disconnected"
|
||||
text: {
|
||||
if (!GlobalState.wifiConnected) return "Disconnected";
|
||||
if (GlobalState.connectionType === "wifi") return "Wi-Fi — " + (GlobalState.wifiSsid !== "" ? GlobalState.wifiSsid : "unknown");
|
||||
if (GlobalState.connectionType === "eth") return "Ethernet";
|
||||
return "Connected";
|
||||
}
|
||||
color: Theme.textPrimary
|
||||
font.family: Theme.fontSans
|
||||
font.pixelSize: 14
|
||||
@@ -454,14 +473,8 @@ PanelWindow {
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "SSID: " + (GlobalState.wifiSsid !== "" ? GlobalState.wifiSsid : "None")
|
||||
color: Theme.textSecondary
|
||||
font.family: Theme.fontSans
|
||||
font.pixelSize: 13
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "IP: " + GlobalState.ipAddress
|
||||
visible: GlobalState.wifiConnected
|
||||
text: "IP: " + (GlobalState.ipAddress !== "" ? GlobalState.ipAddress : "—")
|
||||
color: Theme.textSecondary
|
||||
font.family: Theme.fontMono
|
||||
font.pixelSize: 13
|
||||
@@ -478,8 +491,7 @@ PanelWindow {
|
||||
onEntered: parent.color = Theme.textPrimary
|
||||
onExited: parent.color = Theme.textMuted
|
||||
onClicked: {
|
||||
let proc = Quickshell.createProcess("sh", ["-c", "nm-connection-editor || foot -e nmtui"])
|
||||
proc.start()
|
||||
Quickshell.execDetached(["sh", "-c", "nm-connection-editor || foot -e nmtui"])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -558,7 +570,7 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: GlobalState.mediaStatus === "Playing" ? "⏸" : "▶"
|
||||
text: GlobalState.mediaPlaying ? "⏸" : "▶"
|
||||
font.pixelSize: 24
|
||||
color: Theme.textSecondary
|
||||
MouseArea {
|
||||
|
||||
Reference in New Issue
Block a user