From fcf2dea615d7d2e95b13337d7269d412759d7e83 Mon Sep 17 00:00:00 2001 From: Uyanide Date: Tue, 14 Oct 2025 01:28:38 +0200 Subject: [PATCH] quickshell: nuke kded6 when starting --- .scripts/change-colortheme | 2 +- niri/config.kdl | 2 +- niri/config.kdl.template | 2 +- quickshell/Assets/Config/Settings.json | 2 +- quickshell/Modules/Bar/Components/Battery.qml | 5 ++-- quickshell/Modules/Bar/Components/CpuTemp.qml | 5 ++-- .../Modules/Bar/Components/CpuUsage.qml | 1 + .../Modules/Bar/Components/LyricsBar.qml | 5 ++-- .../Modules/Bar/Components/MemUsage.qml | 1 + quickshell/Modules/Bar/Components/Volume.qml | 6 ++++- quickshell/Modules/Bar/Misc/MonitorItem.qml | 19 +++++++++++---- quickshell/Services/IpService.qml | 4 ++-- quickshell/Services/NotificationService.qml | 2 +- quickshell/Services/NukeKded6.qml | 23 +++++++++++++++++++ quickshell/shell.qml | 2 +- 15 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 quickshell/Services/NukeKded6.qml diff --git a/.scripts/change-colortheme b/.scripts/change-colortheme index 9699e4c..f295bce 100755 --- a/.scripts/change-colortheme +++ b/.scripts/change-colortheme @@ -224,7 +224,7 @@ def _change_quickshell(palette: dict[str, str], flavor: str): apply_theme_funcs: dict[str, Callable[[dict[str, str], str], None]] = { - 'kvantum': _change_kvantum, + # 'kvantum': _change_kvantum, # 'nwg-look': _change_nwglook, 'eww': _change_eww, 'hypr': _change_hypr, diff --git a/niri/config.kdl b/niri/config.kdl index a6b9175..ae7c8b2 100644 --- a/niri/config.kdl +++ b/niri/config.kdl @@ -164,7 +164,7 @@ environment { // Themes QT_QPA_PLATFORM "wayland" QT_QPA_PLATFORMTHEME "kde" - QT_STYLE_OVERRIDE "kvantum" + QT_STYLE_OVERRIDE "Breeze" // Nvidia LIBVA_DRIVER_NAME "nvidia" diff --git a/niri/config.kdl.template b/niri/config.kdl.template index 55bf5cc..cf49bdb 100644 --- a/niri/config.kdl.template +++ b/niri/config.kdl.template @@ -164,7 +164,7 @@ environment { // Themes QT_QPA_PLATFORM "wayland" QT_QPA_PLATFORMTHEME "kde" - QT_STYLE_OVERRIDE "kvantum" + QT_STYLE_OVERRIDE "Breeze" // Nvidia LIBVA_DRIVER_NAME "nvidia" diff --git a/quickshell/Assets/Config/Settings.json b/quickshell/Assets/Config/Settings.json index adcdd39..549c844 100644 --- a/quickshell/Assets/Config/Settings.json +++ b/quickshell/Assets/Config/Settings.json @@ -2,7 +2,7 @@ "location": "Munich", "notifications": { "doNotDisturb": false, - "lastSeenTs": 1760383655000 + "lastSeenTs": 1760397059000 }, "primaryColor": "#89b4fa", "showLyricsBar": false diff --git a/quickshell/Modules/Bar/Components/Battery.qml b/quickshell/Modules/Bar/Components/Battery.qml index 5b14c60..e38414a 100644 --- a/quickshell/Modules/Bar/Components/Battery.qml +++ b/quickshell/Modules/Bar/Components/Battery.qml @@ -9,13 +9,14 @@ MonitorItem { readonly property bool isReady: (battery && battery.ready && battery.isLaptopBattery && battery.isPresent) readonly property real percent: (isReady ? (battery.percentage * 100) : 0) readonly property bool charging: (isReady ? battery.state === UPowerDeviceState.Charging : false) - property int lowBatteryThreshold: 15 + property int lowBatteryThreshold: 20 symbol: { return charging ? Icons.charging : percent >= 80 ? Icons.battery100 : percent >= 60 ? Icons.battery75 : percent >= 40 ? Icons.battery50 : percent >= 20 ? Icons.battery25 : Icons.battery00; } - fillColor: !isReady || charging || percent > lowBatteryThreshold ? Colors.sapphire : Colors.red + fillColor: Colors.sapphire value: percent + critical: isReady && !charging && percent <= lowBatteryThreshold maxValue: 100 textSuffix: "%" pointerCursor: false diff --git a/quickshell/Modules/Bar/Components/CpuTemp.qml b/quickshell/Modules/Bar/Components/CpuTemp.qml index 1c1db5f..7a2de5b 100644 --- a/quickshell/Modules/Bar/Components/CpuTemp.qml +++ b/quickshell/Modules/Bar/Components/CpuTemp.qml @@ -5,8 +5,9 @@ import qs.Modules.Bar.Misc import qs.Services MonitorItem { - symbol: Icons.cpuTemp > 80 ? Icons.tempHigh : Icons.cpuTemp > 50 ? Icons.tempMedium : Icons.tempLow - fillColor: Icons.cpuTemp > 80 ? Colors.red : Colors.yellow + symbol: SystemStatService.cpuTemp > 80 ? Icons.tempHigh : SystemStatService.cpuTemp > 50 ? Icons.tempMedium : Icons.tempLow + fillColor: Colors.yellow + critical: SystemStatService.cpuTemp > 80 value: Math.round(SystemStatService.cpuTemp) maxValue: 120 textSuffix: "°C" diff --git a/quickshell/Modules/Bar/Components/CpuUsage.qml b/quickshell/Modules/Bar/Components/CpuUsage.qml index 80e4068..b14102c 100644 --- a/quickshell/Modules/Bar/Components/CpuUsage.qml +++ b/quickshell/Modules/Bar/Components/CpuUsage.qml @@ -7,6 +7,7 @@ import qs.Services MonitorItem { symbol: Icons.cpu fillColor: Colors.teal + critical: SystemStatService.cpuUsage > 90 value: Math.round(SystemStatService.cpuUsage) maxValue: 100 textSuffix: "%" diff --git a/quickshell/Modules/Bar/Components/LyricsBar.qml b/quickshell/Modules/Bar/Components/LyricsBar.qml index 9adab54..def33a3 100644 --- a/quickshell/Modules/Bar/Components/LyricsBar.qml +++ b/quickshell/Modules/Bar/Components/LyricsBar.qml @@ -13,14 +13,15 @@ Rectangle { border.width: Style.borderS Connections { - target: SettingsService - onShowLyricsBarChanged: { + function onShowLyricsBarChanged() { visible = SettingsService.showLyricsBar; if (visible) LyricsService.startSyncing(); else LyricsService.stopSyncing(); } + + target: SettingsService } RowLayout { diff --git a/quickshell/Modules/Bar/Components/MemUsage.qml b/quickshell/Modules/Bar/Components/MemUsage.qml index 74ef88b..287a7f1 100644 --- a/quickshell/Modules/Bar/Components/MemUsage.qml +++ b/quickshell/Modules/Bar/Components/MemUsage.qml @@ -9,6 +9,7 @@ MonitorItem { symbol: Icons.memory fillColor: Colors.green + critical: SystemStatService.memPercent > 90 value: Math.round(SystemStatService.memPercent) maxValue: 100 textValue: showPercent ? SystemStatService.memPercent : SystemStatService.memGb diff --git a/quickshell/Modules/Bar/Components/Volume.qml b/quickshell/Modules/Bar/Components/Volume.qml index ea96f86..2a75cf6 100644 --- a/quickshell/Modules/Bar/Components/Volume.qml +++ b/quickshell/Modules/Bar/Components/Volume.qml @@ -1,10 +1,11 @@ import QtQuick +import Quickshell import qs.Constants import qs.Modules.Bar.Misc import qs.Services MonitorItem { - symbol: AudioService.muted ? Icons.volumeMuted : (AudioService.volume >= 0.66 ? Icons.volumeHigh : (AudioService.volume >= 0.33 ? Icons.volumeMedium : Icons.volumeLow)) + symbol: AudioService.muted ? Icons.volumeMuted : (AudioService.volume >= 0.5 ? Icons.volumeHigh : (AudioService.volume >= 0.2 ? Icons.volumeMedium : Icons.volumeLow)) fillColor: Colors.lavender value: Math.round(AudioService.volume * 100) maxValue: 100 @@ -18,4 +19,7 @@ MonitorItem { onClicked: { AudioService.toggleMute(); } + onRightClicked: { + Quickshell.execDetached(["sh", "-c", "pkill -x -n pavucontrol || pavucontrol"]); + } } diff --git a/quickshell/Modules/Bar/Misc/MonitorItem.qml b/quickshell/Modules/Bar/Misc/MonitorItem.qml index 67947b8..cd626e3 100644 --- a/quickshell/Modules/Bar/Misc/MonitorItem.qml +++ b/quickshell/Modules/Bar/Misc/MonitorItem.qml @@ -16,7 +16,10 @@ Item { property bool pointerCursor: true property alias hovered: mouseArea.containsMouse property bool disableHover: false + property bool critical: false + property color criticalColor: Colors.red readonly property real ratio: value / maxValue + property color realColor: critical ? criticalColor : fillColor signal wheelUp() signal wheelDown() @@ -74,7 +77,7 @@ Item { ctx.beginPath(); ctx.arc(centerX, centerY, radius, endAngle, startAngle, false); ctx.lineWidth = 3; - ctx.strokeStyle = root.fillColor; + ctx.strokeStyle = root.realColor; ctx.lineCap = "round"; ctx.stroke(); } @@ -84,7 +87,7 @@ Item { progressCircle.requestPaint(); } - function onFillColorChanged() { + function onRealColorChanged() { progressCircle.requestPaint(); } @@ -100,7 +103,7 @@ Item { text: symbol font.family: Fonts.nerd font.pointSize: Fonts.icon - color: fillColor + color: root.realColor horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } @@ -123,7 +126,7 @@ Item { text: (textValue || Math.round(root.value)) + root.textSuffix font.pointSize: Fonts.small font.family: Fonts.primary - color: root.fillColor + color: root.realColor opacity: root.hovered ? 1 : 0 } @@ -139,4 +142,12 @@ Item { } + Behavior on realColor { + ColorAnimation { + duration: Style.animationNormal + easing.type: Easing.InOutCubic + } + + } + } diff --git a/quickshell/Services/IpService.qml b/quickshell/Services/IpService.qml index 9bd0ff1..81b7259 100644 --- a/quickshell/Services/IpService.qml +++ b/quickshell/Services/IpService.qml @@ -58,8 +58,8 @@ Singleton { if (success) { try { const response = JSON.parse(data); - if (response && response.country_code) { - let newCountryCode = response.country_code; + if (response && (response.country_code || response.country)) { + let newCountryCode = response.country_code || response.country; Logger.log("IpService", "Fetched country code: " + newCountryCode); countryCode = newCountryCode; } else { diff --git a/quickshell/Services/NotificationService.qml b/quickshell/Services/NotificationService.qml index dc4e67e..3204ed5 100644 --- a/quickshell/Services/NotificationService.qml +++ b/quickshell/Services/NotificationService.qml @@ -467,7 +467,7 @@ Singleton { Connections { target: SettingsService.notifications - onDoNotDisturbChanged: { + function onDoNotDisturbChanged() { const enabled = SettingsService.notifications.doNotDisturb } } diff --git a/quickshell/Services/NukeKded6.qml b/quickshell/Services/NukeKded6.qml new file mode 100644 index 0000000..ff99013 --- /dev/null +++ b/quickshell/Services/NukeKded6.qml @@ -0,0 +1,23 @@ +import QtQuick +import Quickshell +import Quickshell.Io +import qs.Utils +pragma Singleton + +Singleton { + property bool done: false + + Process { + id: process + + running: true + command: ["sh", "-c", "kquitapp6 kded6"] + onExited: (code, status) => { + if (code !== 0) + Logger.warn("NukeKded6", `Failed to kill kded6: ${code}`); + + done = true; + } + } + +} diff --git a/quickshell/shell.qml b/quickshell/shell.qml index a889994..1490e65 100644 --- a/quickshell/shell.qml +++ b/quickshell/shell.qml @@ -13,7 +13,7 @@ ShellRoot { Loader { id: loader - active: CacheService.loaded + active: CacheService.loaded && NukeKded6.done sourceComponent: Item { Notification {