pipewire service, lock-aware applets, cpu overall chart, security comments

This commit is contained in:
Damocles 2026-04-27 18:36:07 +02:00
parent e7bf175169
commit 8628b4b27b
13 changed files with 183 additions and 208 deletions

View file

@ -1,6 +1,7 @@
import QtQuick
import "../services" as S
// NOT safe for lock screen - can toggle bluetooth power and connect/disconnect devices
Column {
id: root

View file

@ -11,7 +11,6 @@ Column {
required property color accentColor
property bool active: true
property bool locked: false
property bool _coreActive: false
onActiveChanged: {
@ -141,36 +140,25 @@ Column {
}
}
// Overall CPU utilization chart
Item {
width: root.width
height: 44
Separator {}
Text {
id: _totalLabel
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: S.SystemStats.cpuUsage + "%"
color: S.Theme.loadColor(S.SystemStats.cpuUsage)
font.pixelSize: S.Theme.fontSize - 1
font.family: S.Theme.fontFamily
font.bold: true
width: 32
}
// Overall CPU utilization
InfoRow {
label: "Total"
value: S.SystemStats.cpuUsage + "% @ " + S.SystemStats.cpuFreqGhz.toFixed(2) + " GHz"
valueColor: S.Theme.loadColor(S.SystemStats.cpuUsage)
}
SparklineCanvas {
anchors.left: _totalLabel.right
anchors.leftMargin: 6
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
height: 32
history: root._cpuHistory
strokeColor: root.accentColor
colorAt: v => S.Theme.loadColor(v)
active: root.active
}
SparklineCanvas {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.right: parent.right
anchors.rightMargin: 12
height: 32
history: root._cpuHistory
strokeColor: root.accentColor
colorAt: v => S.Theme.loadColor(v)
active: root.active
}
property var _cpuHistory: []
@ -184,72 +172,77 @@ Column {
}
}
Separator {}
Item {
// Process list - hidden on lock screen (exposes running process names)
Column {
visible: !S.LockService.locked
width: root.width
height: 18
Text {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: "PROCESS"
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
font.letterSpacing: 1
}
Separator {}
Text {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: "CPU"
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
font.letterSpacing: 1
}
}
// Top processes by CPU
Repeater {
model: root.processes
delegate: Item {
required property var modelData
width: root.width
height: 20
Item {
width: parent.width
height: 18
Text {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: modelData.cmd
color: S.Theme.base05
font.pixelSize: S.Theme.fontSize - 2
text: "PROCESS"
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
elide: Text.ElideRight
width: parent.width - 80
font.letterSpacing: 1
}
Text {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: modelData.cpu.toFixed(1) + "%"
color: S.Theme.loadColor(modelData.cpu)
font.pixelSize: S.Theme.fontSize - 2
text: "CPU"
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
width: 36
horizontalAlignment: Text.AlignRight
font.letterSpacing: 1
}
}
}
Item {
width: 1
height: 4
Repeater {
model: root.processes
delegate: Item {
required property var modelData
width: root.width
height: 20
Text {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: modelData.cmd
color: S.Theme.base05
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
elide: Text.ElideRight
width: parent.width - 80
}
Text {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: modelData.cpu.toFixed(1) + "%"
color: S.Theme.loadColor(modelData.cpu)
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
width: 36
horizontalAlignment: Text.AlignRight
}
}
}
Item {
width: 1
height: 4
}
}
}

View file

@ -101,72 +101,77 @@ Column {
active: root.active
}
Separator {}
Item {
// Process list - hidden on lock screen (exposes running process names)
Column {
visible: !S.LockService.locked
width: root.width
height: 18
Text {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: "PROCESS"
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
font.letterSpacing: 1
}
Separator {}
Text {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: "MEM"
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
font.letterSpacing: 1
}
}
// Top processes by memory
Repeater {
model: root.processes
delegate: Item {
required property var modelData
width: root.width
height: 20
Item {
width: parent.width
height: 18
Text {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: modelData.cmd
color: S.Theme.base05
font.pixelSize: S.Theme.fontSize - 2
text: "PROCESS"
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
elide: Text.ElideRight
width: parent.width - 80
font.letterSpacing: 1
}
Text {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: modelData.mem.toFixed(1) + "%"
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize - 2
text: "MEM"
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
width: 36
horizontalAlignment: Text.AlignRight
font.letterSpacing: 1
}
}
}
Item {
width: 1
height: 4
Repeater {
model: root.processes
delegate: Item {
required property var modelData
width: root.width
height: 20
Text {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: modelData.cmd
color: S.Theme.base05
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
elide: Text.ElideRight
width: parent.width - 80
}
Text {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: modelData.mem.toFixed(1) + "%"
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
width: 36
horizontalAlignment: Text.AlignRight
}
}
}
Item {
width: 1
height: 4
}
}
}

View file

@ -1,6 +1,7 @@
import QtQuick
import "../services" as S
// NOT safe for lock screen - can toggle wifi and connect/disconnect networks
Column {
id: root

View file

@ -3,6 +3,9 @@ import Quickshell
import "../services" as S
import "../modules" as M
// NOT safe for lock screen - notification contents may be sensitive,
// can dismiss/clear notifications and toggle DND
Column {
id: root

View file

@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import "../services" as S
// NOT safe for lock screen - executes system commands (shutdown, reboot, logout, suspend)
Column {
id: root

View file

@ -5,11 +5,9 @@ import "../services" as S
Column {
id: root
required property var sink
required property var sinkList
required property var streamList
required property color accentColor
readonly property var sink: S.PipewireService.sink
property real volume: sink?.audio?.volume ?? 0
property bool muted: sink?.audio?.muted ?? false
readonly property string volumeIcon: muted ? "\uF026" : (volume > 0.5 ? "\uF028" : (volume > 0 ? "\uF027" : "\uF026"))
@ -95,14 +93,15 @@ Column {
}
}
// Device + stream list
// Device + stream list (hidden on lock screen)
Column {
id: deviceList
visible: !S.LockService.locked
width: root.width
// Output devices - only shown when more than one exists
Column {
visible: root.sinkList.length > 1
visible: S.PipewireService.sinks.length > 1
width: parent.width
Separator {}
@ -119,7 +118,7 @@ Column {
}
Repeater {
model: root.sinkList
model: S.PipewireService.sinks
delegate: HoverableListItem {
required property var modelData
@ -149,11 +148,11 @@ Column {
// Streams section
Separator {
visible: root.streamList.length > 0
visible: S.PipewireService.streams.length > 0
}
Text {
visible: root.streamList.length > 0
visible: S.PipewireService.streams.length > 0
width: parent.width
height: visible ? 24 : 0
verticalAlignment: Text.AlignVCenter
@ -165,7 +164,7 @@ Column {
}
Repeater {
model: root.streamList
model: S.PipewireService.streams
delegate: Item {
id: streamEntry