move Theme, SystemStats, Modules to shell/services/
This commit is contained in:
parent
197f6976e0
commit
989182d603
59 changed files with 432 additions and 388 deletions
|
|
@ -2,10 +2,11 @@ import QtQuick
|
|||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import "." as M
|
||||
import "../services" as S
|
||||
|
||||
M.BarSection {
|
||||
id: root
|
||||
spacing: M.Theme.moduleSpacing
|
||||
spacing: S.Theme.moduleSpacing
|
||||
tooltip: ""
|
||||
|
||||
property string ifname: ""
|
||||
|
|
@ -16,7 +17,7 @@ M.BarSection {
|
|||
|
||||
Process {
|
||||
id: proc
|
||||
running: M.Modules.network.enable
|
||||
running: S.Modules.network.enable
|
||||
command: ["sh", "-c", "line=$(nmcli -t -f NAME,TYPE,DEVICE connection show --active 2>/dev/null | head -1); if [ -z \"$line\" ]; then dev=$(nmcli -t -f DEVICE,STATE device 2>/dev/null | grep ':connected' | grep -v ':unmanaged\\|:unavailable\\|:disconnected\\|:connecting' | head -1 | cut -d: -f1); [ -n \"$dev\" ] && line=\"linked:linked:$dev\"; fi; [ -z \"$line\" ] && exit 0; echo \"$line\"; dev=$(echo \"$line\" | cut -d: -f3); ip=$(nmcli -t -f IP4.ADDRESS device show \"$dev\" 2>/dev/null | head -1 | cut -d: -f2); echo \"ip:${ip:-}\"; sig=$(nmcli -t -f GENERAL.SIGNAL device show \"$dev\" 2>/dev/null | head -1 | cut -d: -f2); echo \"sig:${sig:-}\""]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
|
|
@ -53,7 +54,7 @@ M.BarSection {
|
|||
// Event-driven: re-poll on any network change
|
||||
Process {
|
||||
id: monitor
|
||||
running: M.Modules.network.enable
|
||||
running: S.Modules.network.enable
|
||||
command: ["nmcli", "monitor"]
|
||||
stdout: SplitParser {
|
||||
splitMarker: "\n"
|
||||
|
|
@ -71,7 +72,7 @@ M.BarSection {
|
|||
// Fallback poll
|
||||
Timer {
|
||||
interval: 60000
|
||||
running: M.Modules.network.enable
|
||||
running: S.Modules.network.enable
|
||||
repeat: true
|
||||
onTriggered: proc.running = true
|
||||
}
|
||||
|
|
@ -86,13 +87,13 @@ M.BarSection {
|
|||
return "\uDB85\uDE16";
|
||||
return "\uDB82\uDCFD";
|
||||
}
|
||||
color: root.state === "disconnected" ? M.Theme.base08 : root.accentColor
|
||||
color: root.state === "disconnected" ? S.Theme.base08 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
M.BarLabel {
|
||||
visible: root.state === "wifi"
|
||||
label: root.essid
|
||||
color: root.state === "disconnected" ? M.Theme.base08 : root.accentColor
|
||||
color: root.state === "disconnected" ? S.Theme.base08 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue