diff --git a/Components/CustomAudioSlider.qml b/Components/CustomAudioSlider.qml index 882c3cd..f7d35af 100644 --- a/Components/CustomAudioSlider.qml +++ b/Components/CustomAudioSlider.qml @@ -51,10 +51,6 @@ Slider { implicitWidth: root.implicitWidth - root.handle.x - root.handle.implicitWidth - root.implicitHeight radius: 1000 topLeftRadius: root.implicitHeight / 15 - - Component.onCompleted: { - console.log(root.handle.x, implicitWidth); - } } } handle: CustomRect { diff --git a/Components/MarqueeText.qml b/Components/MarqueeText.qml index 0035767..3f8b69a 100644 --- a/Components/MarqueeText.qml +++ b/Components/MarqueeText.qml @@ -1,5 +1,5 @@ import QtQuick -import QtQuick.Effects +import qs.Config Item { id: root @@ -12,15 +12,13 @@ Item { property int gap: 40 property alias horizontalAlignment: elideText.horizontalAlignment property bool leftFadeEnabled: false - property real leftFadeStrength: overflowing && leftFadeEnabled - ? fadeStrengthMoving : fadeStrengthIdle + property real leftFadeStrength: overflowing && leftFadeEnabled ? fadeStrengthMoving : fadeStrengthIdle property int leftFadeWidth: 28 property bool marqueeEnabled: true readonly property bool overflowing: metrics.width > root.width property int pauseMs: 1200 property real pixelsPerSecond: 40 - property real rightFadeStrength: overflowing ? fadeStrengthMoving : - fadeStrengthIdle + property real rightFadeStrength: overflowing ? fadeStrengthMoving : fadeStrengthIdle property int rightFadeWidth: 28 property bool sliding: false property alias text: elideText.text @@ -43,7 +41,7 @@ Item { onTextChanged: strip.x = 0 onVisibleChanged: if (!visible) - strip.x = 0 + strip.x = 0 onWidthChanged: strip.x = 0 TextMetrics { diff --git a/Config/Config.qml b/Config/Config.qml index 124ae6f..6638e4e 100644 --- a/Config/Config.qml +++ b/Config/Config.qml @@ -242,7 +242,8 @@ Singleton { brightnessIncrement: services.brightnessIncrement, maxVolume: services.maxVolume, defaultPlayer: services.defaultPlayer, - playerAliases: services.playerAliases + playerAliases: services.playerAliases, + visualizerBars: services.visualizerBars }; } @@ -307,8 +308,7 @@ Singleton { fileView.setText(JSON.stringify(config, null, 4)); } catch (e) { - Toaster.toast(qsTr("Failed to serialize config"), e.message, - "settings_alert", Toast.Error); + Toaster.toast(qsTr("Failed to serialize config"), e.message, "settings_alert", Toast.Error); } } } @@ -339,8 +339,7 @@ Singleton { } onLoadFailed: err => { if (err !== FileViewError.FileNotFound) - Toaster.toast(qsTr("Failed to read config"), FileViewError.toString(err), - "settings_alert", Toast.Warning); + Toaster.toast(qsTr("Failed to read config"), FileViewError.toString(err), "settings_alert", Toast.Warning); } onLoaded: { ModeScheduler.checkStartup(); @@ -349,19 +348,15 @@ Singleton { const elapsed = timer.elapsedMs(); if (adapter.utilities.toasts.configLoaded && !root.recentlySaved) { - Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded in %1ms").arg( - elapsed), "rule_settings"); + Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded in %1ms").arg(elapsed), "rule_settings"); } else if (adapter.utilities.toasts.configLoaded && root.recentlySaved) { - Toaster.toast(qsTr("Config saved"), qsTr("Config reloaded in %1ms").arg( - elapsed), "settings_alert"); + Toaster.toast(qsTr("Config saved"), qsTr("Config reloaded in %1ms").arg(elapsed), "settings_alert"); } } catch (e) { - Toaster.toast(qsTr("Failed to load config"), e.message, "settings_alert", - Toast.Error); + Toaster.toast(qsTr("Failed to load config"), e.message, "settings_alert", Toast.Error); } } - onSaveFailed: err => Toaster.toast(qsTr("Failed to save config"), - FileViewError.toString(err), "settings_alert", Toast.Error) + onSaveFailed: err => Toaster.toast(qsTr("Failed to save config"), FileViewError.toString(err), "settings_alert", Toast.Error) JsonAdapter { id: adapter diff --git a/Config/Services.qml b/Config/Services.qml index f228de4..2daf398 100644 --- a/Config/Services.qml +++ b/Config/Services.qml @@ -15,5 +15,6 @@ JsonObject { ] property bool useFahrenheit: false property bool useTwelveHourClock: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().includes("a") + property int visualizerBars: 30 property string weatherLocation: "" } diff --git a/Daemons/Audio.qml b/Daemons/Audio.qml index 4661a9f..624b849 100644 --- a/Daemons/Audio.qml +++ b/Daemons/Audio.qml @@ -1,15 +1,16 @@ pragma Singleton -import qs.Config import ZShell.Services import ZShell import Quickshell import Quickshell.Services.Pipewire import QtQuick +import qs.Config Singleton { id: root + readonly property alias cava: cava readonly property bool muted: !!sink?.audio?.muted readonly property var nodes: Pipewire.nodes.values.reduce((acc, node) => { if (!node.isStream) { @@ -131,6 +132,12 @@ Singleton { previousSourceName = newSourceName; } + CavaProvider { + id: cava + + bars: Config.services.visualizerBars + } + PwObjectTracker { objects: [...root.sinks, ...root.sources, ...root.streams] } diff --git a/Drawers/Backgrounds.qml b/Drawers/Backgrounds.qml index 0abb605..7fb4578 100644 --- a/Drawers/Backgrounds.qml +++ b/Drawers/Backgrounds.qml @@ -23,9 +23,6 @@ Shape { anchors.topMargin: bar.implicitHeight preferredRendererType: Shape.CurveRenderer - Component.onCompleted: console.log(root.bar.implicitHeight, - root.bar.anchors.topMargin) - Osd.Background { startX: root.width - root.panels.sidebar.width startY: (root.height - wrapper.height) / 2 - rounding diff --git a/Drawers/Interactions.qml b/Drawers/Interactions.qml index 0671eb0..7fb1abe 100644 --- a/Drawers/Interactions.qml +++ b/Drawers/Interactions.qml @@ -240,7 +240,6 @@ CustomMouseArea { if (root.visibilities.osd) { // OSD became visible, immediately check if this should be shortcut mode const inOsdArea = root.inRightPanel(root.panels.osd, root.mouseX, root.mouseY); - console.log(inOsdArea); if (!inOsdArea) { root.osdShortcutActive = true; } diff --git a/Helpers/InitialTitle.qml b/Helpers/InitialTitle.qml index c38dc8b..c0d832b 100644 --- a/Helpers/InitialTitle.qml +++ b/Helpers/InitialTitle.qml @@ -10,8 +10,6 @@ Singleton { let activeClass = Hypr.activeToplevel.lastIpcObject.class.toString(); let regex = new RegExp(activeClass, "i"); - console.log("ActiveWindow", activeWindow, "ActiveClass", activeClass, "Regex", regex); - const evalTitle = activeWindow.match(regex); callback(evalTitle); } diff --git a/Modules/AudioPopup.qml b/Modules/AudioPopup.qml index 40a76b9..db8b4a9 100644 --- a/Modules/AudioPopup.qml +++ b/Modules/AudioPopup.qml @@ -213,6 +213,7 @@ Item { radius: 1000 MaterialIcon { + anchors.alignWhenCentered: false anchors.centerIn: parent color: DynamicColors.palette.m3onPrimary font.pointSize: 22 diff --git a/Modules/Calendar/MonthGrid.qml b/Modules/Calendar/MonthGrid.qml index 901ecf4..5ab370b 100644 --- a/Modules/Calendar/MonthGrid.qml +++ b/Modules/Calendar/MonthGrid.qml @@ -71,7 +71,6 @@ GridLayout { Layout.preferredWidth: 40 color: { if (modelData.isToday) { - console.log(width); return DynamicColors.palette.m3primaryContainer; } return "transparent"; @@ -108,14 +107,6 @@ GridLayout { } } } - - StateLayer { - color: DynamicColors.palette.m3onSurface - - onClicked: { - console.log(`Selected date: ${parent.modelData.day}/${parent.modelData.month + 1}/${parent.modelData.year}`); - } - } } } diff --git a/Modules/Dashboard/Dash/Media.qml b/Modules/Dashboard/Dash/Media.qml index 456bd3d..262df36 100644 --- a/Modules/Dashboard/Dash/Media.qml +++ b/Modules/Dashboard/Dash/Media.qml @@ -1,3 +1,6 @@ +pragma ComponentBehavior: Bound + +import Quickshell import QtQuick import QtQuick.Layouts import QtQuick.Shapes @@ -34,6 +37,55 @@ Item { onTriggered: Players.active?.positionChanged() } + Shape { + id: visualizer + + readonly property real centerX: width / 2 + readonly property real centerY: height / 2 + property color colour: DynamicColors.palette.m3primary + readonly property real innerX: cover.implicitWidth / 2 + Appearance.spacing.small + readonly property real innerY: cover.implicitHeight / 2 + Appearance.spacing.small + + anchors.fill: cover + anchors.margins: -Config.dashboard.sizes.mediaVisualiserSize + asynchronous: true + data: visualizerBars.instances + preferredRendererType: Shape.CurveRenderer + } + + Variants { + id: visualizerBars + + model: Array.from({ + length: Config.services.visualizerBars + }, (_, i) => i) + + ShapePath { + id: visualizerBar + + readonly property real angle: modelData * 2 * Math.PI / Config.services.visualizerBars + readonly property real cos: Math.cos(angle) + readonly property real magnitude: value * Config.dashboard.sizes.mediaVisualiserSize + required property int modelData + readonly property real sin: Math.sin(angle) + readonly property real value: Math.max(1e-3, Math.min(1, Audio.cava.values[modelData])) + + capStyle: Appearance.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap + startX: visualizer.centerX + (visualizer.innerX + strokeWidth / 2) * cos + strokeColor: DynamicColors.palette.m3primary + strokeWidth: 360 / Config.services.visualizerBars - Appearance.spacing.small / 4 + + startY: PathLine { + x: visualizer.centerX + (visualizer.innerX + visualizerBar.strokeWidth / 2 + visualizerBar.magnitude) * visualizerBar.cos + y: visualizer.centerY + (visualizer.innerY + visualizerBar.strokeWidth / 2 + visualizerBar.magnitude) * visualizerBar.sin + } + Behavior on strokeColor { + CAnim { + } + } + } + } + Shape { preferredRendererType: Shape.CurveRenderer @@ -136,31 +188,31 @@ Item { width: parent.width - Appearance.padding.large * 4 } - CustomText { + MarqueeText { id: album anchors.horizontalCenter: parent.horizontalCenter anchors.top: title.bottom anchors.topMargin: Appearance.spacing.small - animate: true color: DynamicColors.palette.m3outline - elide: Text.ElideRight font.pointSize: Appearance.font.size.small horizontalAlignment: Text.AlignHCenter + pauseMs: 4000 text: (Players.active?.trackAlbum ?? qsTr("No media")) || qsTr("Unknown album") + width: parent.width - Appearance.padding.large * 4 } - CustomText { + MarqueeText { id: artist anchors.horizontalCenter: parent.horizontalCenter anchors.top: album.bottom anchors.topMargin: Appearance.spacing.small - animate: true color: DynamicColors.palette.m3secondary - elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter + pauseMs: 4000 text: (Players.active?.trackArtist ?? qsTr("No media")) || qsTr("Unknown artist") + width: parent.width - Appearance.padding.large * 4 } Row { diff --git a/Modules/Launcher/Items/WallpaperItem.qml b/Modules/Launcher/Items/WallpaperItem.qml index c657bb3..6620cb9 100644 --- a/Modules/Launcher/Items/WallpaperItem.qml +++ b/Modules/Launcher/Items/WallpaperItem.qml @@ -34,7 +34,6 @@ Item { StateLayer { function onClicked(): void { - console.log(root.modelData.path); Wallpapers.setWallpaper(root.modelData.path); root.visibilities.launcher = false; } diff --git a/Modules/Network/NetworkPopout.qml b/Modules/Network/NetworkPopout.qml index 2c53fe9..519bc6c 100644 --- a/Modules/Network/NetworkPopout.qml +++ b/Modules/Network/NetworkPopout.qml @@ -14,8 +14,6 @@ Item { required property var wrapper - Component.onCompleted: console.log(Networking.backend.toString()) - ColumnLayout { id: layout diff --git a/Modules/Notifications/Sidebar/Utils/Cards/Toggles.qml b/Modules/Notifications/Sidebar/Utils/Cards/Toggles.qml index 15bb2f9..a98fc48 100644 --- a/Modules/Notifications/Sidebar/Utils/Cards/Toggles.qml +++ b/Modules/Notifications/Sidebar/Utils/Cards/Toggles.qml @@ -74,7 +74,6 @@ CustomRect { visible: Bluetooth.defaultAdapter ?? false onClicked: { - // console.log(Bluetooth.defaultAdapter) const adapter = Bluetooth.defaultAdapter; if (adapter) adapter.enabled = !adapter.enabled; diff --git a/Modules/Polkit/Polkit.qml b/Modules/Polkit/Polkit.qml index 69d4781..4304ae4 100644 --- a/Modules/Polkit/Polkit.qml +++ b/Modules/Polkit/Polkit.qml @@ -257,7 +257,6 @@ Scope { onClicked: { panelWindow.detailsOpen = !panelWindow.detailsOpen; - console.log(panelWindow.detailsOpen); } } @@ -300,7 +299,6 @@ Scope { onClicked: { root.shouldShow = false; - console.log(icon.source, icon.visible); polkitAgent.flow.cancelAuthenticationRequest(); passInput.text = ""; } diff --git a/Modules/Wallpaper/WallBackground.qml b/Modules/Wallpaper/WallBackground.qml index 6aac7ba..ad0ffc2 100644 --- a/Modules/Wallpaper/WallBackground.qml +++ b/Modules/Wallpaper/WallBackground.qml @@ -14,7 +14,6 @@ Item { anchors.fill: parent Component.onCompleted: { - console.log(root.source); if (source) Qt.callLater(() => one.update()); } diff --git a/Plugins/ZShell/CMakeLists.txt b/Plugins/ZShell/CMakeLists.txt index 9068c5e..bde2f00 100644 --- a/Plugins/ZShell/CMakeLists.txt +++ b/Plugins/ZShell/CMakeLists.txt @@ -3,10 +3,10 @@ find_package(PkgConfig REQUIRED) pkg_check_modules(Qalculate IMPORTED_TARGET libqalculate REQUIRED) pkg_check_modules(Pipewire IMPORTED_TARGET libpipewire-0.3 REQUIRED) pkg_check_modules(Aubio IMPORTED_TARGET aubio REQUIRED) -# pkg_check_modules(Cava IMPORTED_TARGET libcava QUIET) -# if(NOT Cava_FOUND) -# pkg_check_modules(Cava IMPORTED_TARGET cava REQUIRED) -# endif() +pkg_check_modules(Cava IMPORTED_TARGET libcava QUIET) +if(NOT Cava_FOUND) + pkg_check_modules(Cava IMPORTED_TARGET cava REQUIRED) +endif() set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml") qt_standard_project_setup(REQUIRES 6.9)