Compare commits

..

No commits in common. "3c9f6e78cc8a0af240a5ac7a0ed0cb517f2bbb5a" and "450f24528ce597c3962be55de4183d92bc54c44c" have entirely different histories.

3 changed files with 32 additions and 46 deletions

View file

@ -30,57 +30,50 @@ PanelWindow {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 8 anchors.leftMargin: 8
anchors.rightMargin: 8 anchors.rightMargin: 8
spacing: 0 spacing: 8
// ---- left ---- // ---- left ----
Item { RowLayout {
Layout.fillWidth: true Layout.alignment: Qt.AlignLeft
Layout.fillHeight: true spacing: 8
RowLayout { // M.Workspaces {}
anchors.left: parent.left M.Tray { bar: bar }
anchors.verticalCenter: parent.verticalCenter M.WindowTitle { Layout.maximumWidth: 400 }
spacing: 8
// M.Workspaces {}
M.Tray { bar: bar }
M.WindowTitle { Layout.maximumWidth: 400 }
}
} }
Item { Layout.fillWidth: true }
// ---- center ---- // ---- center ----
RowLayout { RowLayout {
Layout.alignment: Qt.AlignHCenter
spacing: 8 spacing: 8
M.Clock {} M.Clock {}
M.Notifications {} M.Notifications {}
} }
Item { Layout.fillWidth: true }
// ---- right ---- // ---- right ----
Item { RowLayout {
Layout.fillWidth: true Layout.alignment: Qt.AlignRight
Layout.fillHeight: true spacing: 12
RowLayout { M.Mpris {}
anchors.right: parent.right M.Volume {}
anchors.verticalCenter: parent.verticalCenter M.Bluetooth {}
spacing: 12 M.Backlight {}
M.Network {}
M.Mpris {} M.PowerProfile {}
M.Volume {} M.IdleInhibitor {}
M.Bluetooth {} M.Weather {}
M.Backlight {} M.Temperature {}
M.Network {} M.Cpu {}
M.PowerProfile {} M.Memory {}
M.IdleInhibitor {} M.Disk {}
M.Weather {} M.Battery {}
M.Temperature {} M.Wlogout {}
M.Cpu {}
M.Memory {}
M.Disk {}
M.Battery {}
M.Wlogout {}
}
} }
} }
} }

View file

@ -13,7 +13,7 @@ Row {
Process { Process {
id: proc id: proc
running: true running: true
command: ["sh", "-c", "line=$(nmcli -t -f NAME,TYPE,DEVICE connection show --active 2>/dev/null | head -1); if [ -n \"$line\" ]; then echo \"$line\"; else dev=$(nmcli -t -f DEVICE,STATE device 2>/dev/null | grep ':connected' | grep -v ':unmanaged\\|:unavailable\\|:disconnected\\|:connecting' | head -1 | cut -d: -f1); if [ -n \"$dev\" ]; then echo \"linked:linked:$dev\"; fi; fi"] command: ["sh", "-c", "nmcli -t -f NAME,TYPE,DEVICE connection show --active | head -1"]
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
const line = text.trim(); const line = text.trim();
@ -26,9 +26,7 @@ Row {
const parts = line.split(":"); const parts = line.split(":");
root.essid = parts[0] || ""; root.essid = parts[0] || "";
root.ifname = parts[2] || ""; root.ifname = parts[2] || "";
if ((parts[1] || "").includes("wireless")) root.state = "wifi"; root.state = (parts[1] || "").includes("wireless") ? "wifi" : "eth";
else if (parts[0] === "linked") root.state = "linked";
else root.state = "eth";
} }
} }
} }
@ -43,7 +41,6 @@ Row {
text: { text: {
if (root.state === "wifi") return " " + root.essid; if (root.state === "wifi") return " " + root.essid;
if (root.state === "eth") return "󰈀"; if (root.state === "eth") return "󰈀";
if (root.state === "linked") return "󱘖";
return "󰣽"; return "󰣽";
} }
color: M.Theme.base05 color: M.Theme.base05

View file

@ -8,7 +8,6 @@ Row {
property int count: 0 property int count: 0
property bool dnd: false property bool dnd: false
property bool inhibited: false
Process { Process {
id: sub id: sub
@ -19,10 +18,8 @@ Row {
onRead: (line) => { onRead: (line) => {
try { try {
const d = JSON.parse(line); const d = JSON.parse(line);
const cls = d.class ?? "";
root.count = d.count ?? 0; root.count = d.count ?? 0;
root.dnd = cls.includes("dnd"); root.dnd = (d.class ?? "").includes("dnd");
root.inhibited = cls.includes("inhibited");
} catch (e) {} } catch (e) {}
} }
} }
@ -30,7 +27,6 @@ Row {
Text { Text {
text: { text: {
if (root.inhibited) return root.count > 0 ? "󰂛" : "󰪑";
if (root.dnd) return root.count > 0 ? "󰂠" : "󰪓"; if (root.dnd) return root.count > 0 ? "󰂠" : "󰪓";
return root.count > 0 ? "󱅫" : "󰂜"; return root.count > 0 ? "󱅫" : "󰂜";
} }