quickshell: steal wifi & bluetooth panel

This commit is contained in:
2025-10-19 04:08:22 +02:00
parent ffa502e0c3
commit acf6f69268
27 changed files with 2355 additions and 124 deletions

View File

@@ -85,7 +85,8 @@ Variants {
symbol: Icons.distro
buttonColor: Colors.distroColor
onClicked: {
PanelService.getPanel("controlCenterPanel")?.toggle(this)
// PanelService.getPanel("controlCenterPanel")?.toggle(this)
PanelService.getPanel("wifiPanel")?.toggle(this)
}
onRightClicked: {
if (action.running) {
@@ -96,6 +97,27 @@ Variants {
}
}
SymbolButton {
symbol: SettingsService.wifiEnabled ? Icons.wifiOn : Icons.wifiOff
buttonColor: Colors.green
onClicked: {
PanelService.getPanel("wifiPanel")?.toggle(this)
}
}
SymbolButton {
symbol: BluetoothService.enabled ? Icons.bluetoothOn : Icons.bluetoothOff
buttonColor: Colors.peach
onClicked: {
PanelService.getPanel("bluetoothPanel")?.toggle(this)
}
}
Item {
width: 5
}
Separator {
}
@@ -176,7 +198,6 @@ Variants {
}
Ip {
showCountryCode: true
}
CpuTemp {

View File

@@ -5,17 +5,9 @@ import qs.Constants
import qs.Services
Item {
// Text {
// id: ipText
// anchors.verticalCenter: parent.verticalCenter
// text: Icons.global + " " + (showCountryCode ? IpService.countryCode : IpService.ip)
// font.pixelSize: Fonts.medium
// color: Colors.peach
// }
id: root
property bool showCountryCode: true
property bool _showCountryCode: true
implicitHeight: parent.height
implicitWidth: layout.width + 10
@@ -43,8 +35,8 @@ Item {
Text {
id: ipText
text: showCountryCode ? IpService.countryCode : IpService.ip
font.pointSize: showCountryCode ? Fonts.medium : Fonts.small
text: _showCountryCode ? IpService.countryCode : IpService.ip
font.pointSize: _showCountryCode ? Fonts.medium : Fonts.small
font.family: Fonts.primary
color: Colors.peach
anchors.verticalCenter: parent.verticalCenter
@@ -73,10 +65,10 @@ Item {
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onClicked: (mouse) => {
if (mouse.button === Qt.LeftButton) {
WriteClipboard.write(showCountryCode ? IpService.countryCode : IpService.ip);
SendNotification.show("Copied to clipboard", showCountryCode ? IpService.countryCode : IpService.ip);
WriteClipboard.write(_showCountryCode ? IpService.countryCode : IpService.ip);
SendNotification.show("Copied to clipboard", _showCountryCode ? IpService.countryCode : IpService.ip);
} else if (mouse.button === Qt.RightButton)
showCountryCode = !showCountryCode;
_showCountryCode = !_showCountryCode;
else if (mouse.button === Qt.MiddleButton)
IpService.refresh();
}

View File

@@ -5,15 +5,15 @@ import qs.Modules.Bar.Misc
import qs.Services
MonitorItem {
property bool showPercent: false
property bool _showPercent: false
symbol: Icons.memory
fillColor: Colors.green
critical: SystemStatService.memPercent > 90
value: Math.round(SystemStatService.memPercent)
maxValue: 100
textValue: showPercent ? SystemStatService.memPercent : SystemStatService.memGb
textSuffix: showPercent ? "%" : "GB"
textValue: _showPercent ? SystemStatService.memPercent : SystemStatService.memGb
textSuffix: _showPercent ? "%" : "GB"
onClicked: {
if (action.running) {
action.signal(15);
@@ -22,7 +22,7 @@ MonitorItem {
action.exec(["ghostty", "-e", "btop"]);
}
onRightClicked: {
showPercent = !showPercent;
_showPercent = !_showPercent;
}
Process {

View File

@@ -56,7 +56,6 @@ Rectangle {
// Process icon path
if (icon.includes("?path=")) {
// Seems qmlfmt does not support the following ES6 syntax: const[name, path] = icon.split
const chunks = icon.split("?path=")
const name = chunks[0]
const path = chunks[1]

View File

@@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell
import Quickshell.Widgets
import qs.Constants
import qs.Utils
import qs.Noctalia
@@ -154,12 +155,11 @@ PopupWindow {
family: Fonts.sans
}
Image {
IconImage {
Layout.preferredWidth: Style.marginL
Layout.preferredHeight: Style.marginL
source: modelData?.icon ?? ""
visible: (modelData?.icon ?? "") !== ""
fillMode: Image.PreserveAspectFit
}
NIcon {