From be45e63c778207b7985696550f875007b5569c03 Mon Sep 17 00:00:00 2001 From: lucy Date: Tue, 6 Jan 2026 15:10:35 +0100 Subject: [PATCH] switch back to svg icons --- modules/bar/Battery.qml | 37 ++++++----------------------------- modules/bar/Volume.qml | 28 ++++++++++++++++---------- modules/settings/Settings.qml | 16 +++++++++------ modules/settings/config.json | 4 ++-- modules/wallpaper/Overlay.qml | 12 ++++++------ shell.qml | 3 +++ 6 files changed, 45 insertions(+), 55 deletions(-) diff --git a/modules/bar/Battery.qml b/modules/bar/Battery.qml index 9b78f9a..8ba3360 100644 --- a/modules/bar/Battery.qml +++ b/modules/bar/Battery.qml @@ -4,6 +4,8 @@ import QtQuick import "../../" import "../settings/" import QtQuick.Layouts +import Quickshell +import Quickshell.Widgets Item { id: root @@ -11,35 +13,6 @@ Item { implicitWidth: masterLayout.implicitWidth height: 34 property bool isCharging: UPower.displayDevice.state === UPowerDeviceState.Charging - function getBatteryIcon() { - if (isCharging) { - return "battery_android_frame_bolt"; - } - if (UPower.displayDevice.percentage < 0.12) { - return "battery_android_frame_0"; - } - if (UPower.displayDevice.percentage < 0.24) { - return "battery_android_frame_1"; - } - if (UPower.displayDevice.percentage < 0.36) { - return "battery_android_frame_2"; - } - if (UPower.displayDevice.percentage < 0.48) { - return "battery_android_frame_3"; - } - if (UPower.displayDevice.percentage < 0.60) { - return "battery_android_frame_4"; - } - if (UPower.displayDevice.percentage < 0.72) { - return "battery_android_frame_5"; - } - if (UPower.displayDevice.percentage < 0.84) { - return "battery_android_frame_6"; - } - if (UPower.displayDevice.percentage > 0.84) { - return "battery_android_full"; - } - } ColumnLayout { id: masterLayout implicitWidth: botText.width @@ -54,8 +27,10 @@ Item { text: Math.round(UPower.displayDevice.percentage * 100) + "%" color: Colors.foreground } - Icons { - text: root.getBatteryIcon() + IconImage { + anchors.verticalCenter: parent.verticalCenter + implicitSize: 12 + source: Quickshell.iconPath(UPower.displayDevice.iconName) } } Text { diff --git a/modules/bar/Volume.qml b/modules/bar/Volume.qml index 2a4c407..cde88cc 100644 --- a/modules/bar/Volume.qml +++ b/modules/bar/Volume.qml @@ -2,6 +2,7 @@ import QtQuick import Quickshell.Services.Pipewire import Quickshell.Widgets import QtQuick.Layouts +import Quickshell import Quickshell.Io import "../../" import "../settings/" @@ -25,28 +26,29 @@ Item { command: ["pavucontrol"] // The command and args list } + // Logic to pick the correct icon name function getVolumeIcon() { // Safety check: if Pipewire is dead or sink is missing if (!sink) - return "volume_off"; + return "audio-volume-muted-symbolic"; // If muted, show the hush icon if (sink.audio.muted) - return "volume_off"; + return "audio-volume-muted-symbolic"; // Volume is usually 0.0 to 1.0 (0% to 100%) const vol = sink.audio.volume; if (vol <= 0.25) - return "volume_mute"; + return "audio-volume-low-symbolic"; if (vol < 0.75) - return "volume_down"; - if (vol < 1.00) - return "volume_up"; + return "audio-volume-medium-symbolic"; + if (vol <= 1.00) + return "audio-volume-high-symbolic"; // If it's loud, prepare the ears! - return "volume_up"; + return "audio-volume-high-danger-symbolic"; } ColumnLayout { @@ -55,10 +57,13 @@ Item { spacing: 0 implicitWidth: botText.width Row { - spacing: 2 + + spacing: 5 Text { id: topText + anchors.verticalCenter: parent.verticalCenter PwObjectTracker { + objects: Pipewire.ready ? root.sink : [] } font.weight: 900 @@ -66,10 +71,13 @@ Item { font.family: Settings.font font.pixelSize: Settings.fontSize text: Pipewire.ready ? root.sink.audio.volume.toFixed(2) + "%" : "0%" + onTextChanged: console.log(Quickshell.iconPath) } - Icons { + IconImage { id: icon - text: root.getVolumeIcon() + anchors.verticalCenter: parent.verticalCenter + implicitSize: 12 + source: Quickshell.iconPath(root.getVolumeIcon()) } } Text { diff --git a/modules/settings/Settings.qml b/modules/settings/Settings.qml index babf26b..8faef55 100644 --- a/modules/settings/Settings.qml +++ b/modules/settings/Settings.qml @@ -9,6 +9,14 @@ Singleton { property alias font: jsonAdapter.font property alias fontSize: jsonAdapter.fontSize property alias wallDir: jsonAdapter.wallDir + onCurrentWallChanged: settingsView.writeAdapter() + onWallDirChanged: settingsView.writeAdapter() + onFontChanged: { + Quickshell.reload(); + settingsView.writeAdapter(); + } + onFontSizeChanged: settingsView.writeAdapter() + FileView { id: settingsView path: "/home/lucy/.config/quickshell/modules/settings/config.json" @@ -21,12 +29,8 @@ Singleton { id: jsonAdapter property string currentWall: "" property string wallDir: "/home/lucy/.walls/" - property string font: "MonaSpiceXe Nerd Font Propo" - property real fontSize: 13 + property string font: "Google Sans" + property real fontSize: 14 } } - onCurrentWallChanged: settingsView.writeAdapter() - onWallDirChanged: settingsView.writeAdapter() - onFontChanged: settingsView.writeAdapter() - onFontSizeChanged: settingsView.writeAdapter() } diff --git a/modules/settings/config.json b/modules/settings/config.json index f0f8cfd..afc34f3 100644 --- a/modules/settings/config.json +++ b/modules/settings/config.json @@ -1,6 +1,6 @@ { - "currentWall": "file:///home/lucy/.walls/gentoo-abducted-1680x1050.png", - "font": "MonaSpiceXe Nerd Font Propo", + "currentWall": "file:///home/lucy/.walls/ayanami.png", + "font": "SFMono Nerd Font Propo", "fontSize": 13, "wallDir": "/home/lucy/.walls/" } diff --git a/modules/wallpaper/Overlay.qml b/modules/wallpaper/Overlay.qml index 3c16e1e..85cd27d 100644 --- a/modules/wallpaper/Overlay.qml +++ b/modules/wallpaper/Overlay.qml @@ -8,9 +8,9 @@ import "." WlrLayershell { id: overlayRoot required property var modelData - property var padding: 2 - property var rounding: 15 - property var hyprgaps: 15 + property var padding: 0 + property var rounding: 25 + property var hyprgaps: 20 onPaddingChanged: { hyprGaps.exec(hyprGaps.command); console.log(hyprGaps.command); @@ -20,15 +20,15 @@ WlrLayershell { id: hyprGaps running: true property bool isZero: overlayRoot.padding === 0 - property var top: isZero ? 10 : overlayRoot.padding * 2 + overlayRoot.hyprgaps - property var sides: overlayRoot.padding + overlayRoot.hyprgaps + property var top: overlayRoot.hyprgaps + property var sides: isZero ? overlayRoot.hyprgaps : overlayRoot.padding + overlayRoot.hyprgaps property var gaps: top + "," + sides + "," + sides + "," + sides command: ["hyprctl", "keyword", "general:gaps_out", gaps] onStarted: console.log("set gaps to ", gaps) } Process { id: hyprRounding - property var rounding: overlayRoot.rounding - 5 + property var rounding: overlayRoot.rounding running: true command: ["hyprctl", "keyword", "decoration:rounding", rounding] onStarted: console.log("set rounding to ", overlayRoot.rounding) diff --git a/shell.qml b/shell.qml index 5932310..6f26c05 100644 --- a/shell.qml +++ b/shell.qml @@ -1,11 +1,14 @@ //@ pragma UseQApplication pragma ComponentBehavior: Bound import Quickshell +import Quickshell.Io import "./modules/bar/" import "./modules/wallpaper/" import "./modules/notifications/" ShellRoot { + id: shellRoot + Variants { id: barVariants model: Quickshell.screens