diff --git a/Colors.qml b/Colors.qml index 1ffcaa8..746c15e 100644 --- a/Colors.qml +++ b/Colors.qml @@ -5,25 +5,25 @@ import Quickshell Singleton { id: customColors // Core Backgrounds - readonly property color background: "#24283B" - readonly property color foreground: "#C0CAF5" - readonly property color cursor: "#C0CAF5" + readonly property color background: "#272E33" + readonly property color foreground: "#D3C6AA" + readonly property color cursor: "#D3C6AA" // The 16 Colors of the Apocalypse - readonly property color color0: "#414868" - readonly property color color1: "#F7768E" - readonly property color color2: "#9ECE6A" - readonly property color color3: "#E0AF68" - readonly property color color4: "#7AA2F7" - readonly property color color5: "#BB9AF7" - readonly property color color6: "#7DCFFF" - readonly property color color7: "#C0CAF5" - readonly property color color8: "#414868" - readonly property color color9: "#F7768E" - readonly property color color10: "#9ECE6A" - readonly property color color11: "#E0AF68" - readonly property color color12: "#7AA2F7" - readonly property color color13: "#BB9AF7" - readonly property color color14: "#7DCFFF" - readonly property color color15: "#C0CAF5" + readonly property color color0: "#2E383C" + readonly property color color1: "#E67E80" + readonly property color color2: "#A7C080" + readonly property color color3: "#DBBC7F" + readonly property color color4: "#7FBBB3" + readonly property color color5: "#D699B6" + readonly property color color6: "#83C092" + readonly property color color7: "#D3C6AA" + readonly property color color8: "#5C6A72" + readonly property color color9: "#F85552" + readonly property color color10: "#8DA101" + readonly property color color11: "#DFA000" + readonly property color color12: "#3A94C5" + readonly property color color13: "#DF69BA" + readonly property color color14: "#35A77C" + readonly property color color15: "#DFDDC8" } diff --git a/modules/bar/PowerProfiles.qml b/modules/bar/PowerProfiles.qml index 3d03f58..730689e 100644 --- a/modules/bar/PowerProfiles.qml +++ b/modules/bar/PowerProfiles.qml @@ -14,8 +14,8 @@ Item { font.pixelSize: Appearance.fontSize anchors.centerIn: parent MouseArea { + cursorShape: Qt.PointingHandCursor acceptedButtons: Qt.LeftButton | Qt.RightButton - cursorShape: Qt.OpenHandCursor anchors.fill: parent onClicked: mouse => { const modes = [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance]; diff --git a/modules/bar/Volume.qml b/modules/bar/Volume.qml index 95d0468..85364c4 100644 --- a/modules/bar/Volume.qml +++ b/modules/bar/Volume.qml @@ -2,7 +2,7 @@ import QtQuick import Quickshell.Services.Pipewire import Quickshell.Widgets import Quickshell.Io -import qs +import "../../" Item { id: root @@ -16,11 +16,9 @@ Item { } MouseArea { - cursorShape: Qt.OpenHandCursor + cursorShape: Qt.PointingHandCursor onClicked: mouse => { if (mouse.button === Qt.LeftButton) { - // Left Click: Summon the Mixer! - console.log("Summoning Pavucontrol... Nya!"); pavu.startDetached(); } } @@ -61,27 +59,19 @@ Item { width: 12 height: 12 - // The magic: 'image://theme/' pulls from your system icon theme (Papirus, Adwaita, etc.) source: "root:/icons/" + root.getVolumeIcon() + "-symbolic.svg" - - // Optional: Tint the icon if your theme needs it - // sourceSize: Qt.size(24, 24) } Text { PwObjectTracker { - - objects: Pipewire.defaultAudioSink + objects: Pipewire.ready ? Pipewire.defaultAudioSink : [] } - anchors.verticalCenter: parent.verticalCenter width: 20 font.weight: 900 color: Colors.foreground font.family: Appearance.font font.pixelSize: Appearance.fontSize - text: Math.round(Pipewire.defaultAudioSink.audio.volume * 100) + "%" + text: Pipewire.ready ? Math.round(Pipewire.defaultAudioSink.audio.volume * 100) + "%" : "0%" } - - // Click to toggle mute! (Bonus feature) } } diff --git a/modules/bar/Workspaces.qml b/modules/bar/Workspaces.qml index ed984f7..e6a4218 100644 --- a/modules/bar/Workspaces.qml +++ b/modules/bar/Workspaces.qml @@ -1,11 +1,10 @@ +pragma ComponentBehavior: Bound import Quickshell.Hyprland import QtQuick -import QtQuick.Layouts -import qs +import "../../" Item { id: root - property var modelData implicitWidth: workspaceRow.implicitWidth height: 30 Row { @@ -14,9 +13,12 @@ Item { spacing: 10 // Slightly increase spacing between workspace buttons Repeater { + id: wsRepeater + model: Hyprland.workspaces anchors.centerIn: parent Rectangle { id: workspaceNumber + required property var modelData width: 16 height: 16 radius: 20 @@ -27,11 +29,18 @@ Item { font.family: Appearance.font font.pixelSize: Appearance.fontSize anchors.centerIn: workspaceNumber - text: modelData.id - color: modelData.active ? Colors.background : Colors.foreground // Set contrasting color for workspace number + text: parent.modelData.id + color: parent.modelData.active ? Colors.background : Colors.foreground // Set contrasting color for workspace number + } + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton + cursorShape: Qt.PointingHandCursor + onClicked: { + parent.modelData.activate(); + } } } - model: Hyprland.workspaces } } } diff --git a/modules/notifications/NotiPopup.qml b/modules/notifications/NotiPopup.qml index ed1bcbb..1e6d96d 100644 --- a/modules/notifications/NotiPopup.qml +++ b/modules/notifications/NotiPopup.qml @@ -3,17 +3,17 @@ import QtQuick import Quickshell import Quickshell.Wayland import Quickshell.Hyprland -import qs import "." +import "../../" import QtQuick.Layouts WlrLayershell { id: root - screen: { + screen: { // Iterate through all connected Quickshell screens for (let i = 0; i < Quickshell.screens.length; i++) { let screenCandidate = Quickshell.screens[i]; - + // Ask: "Is this screen the one Hyprland is currently focusing?" if (Hyprland.monitorFor(screenCandidate) === Hyprland.focusedMonitor) { return screenCandidate; @@ -34,7 +34,7 @@ WlrLayershell { } implicitWidth: 300 - implicitHeight: notifList.contentHeight + 10 + implicitHeight: notifList.contentHeight + 20 // 2. Layer: Put it ABOVE normal windows layer: WlrLayer.Overlay @@ -68,12 +68,12 @@ WlrLayershell { delegate: Item { id: notifyItem implicitWidth: ListView.view.width - implicitHeight: 60 // Fixed height is usually better for icon layouts + implicitHeight: 80 // Fixed height is usually better for icon layouts required property var modelData Timer { id: timout - interval: 30000 + interval: 3000000 running: true onRunningChanged: notifyItem.modelData.dismiss() } @@ -86,6 +86,7 @@ WlrLayershell { // 2. Use RowLayout to put Image | Text side-by-side RowLayout { + id: fullLayout anchors.margins: 10 anchors.fill: parent spacing: 15 @@ -115,6 +116,7 @@ WlrLayershell { // 📝 THE TEXT ON THE RIGHT ColumnLayout { + id: textLayout // Take up all remaining width Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter | Qt.AlignTop // Center vertically @@ -134,7 +136,7 @@ WlrLayershell { // Limit to 2 lines maximumLineCount: 2 - wrapMode: Text.WrapAnywhere + wrapMode: Text.WordWrap elide: Text.ElideRight Layout.fillWidth: true } diff --git a/modules/notifications/NotifServer.qml b/modules/notifications/NotifServer.qml index dd3a6c8..d2e3efe 100644 --- a/modules/notifications/NotifServer.qml +++ b/modules/notifications/NotifServer.qml @@ -2,7 +2,6 @@ pragma ComponentBehavior: Bound pragma Singleton import Quickshell.Services.Notifications import QtQuick -import Quickshell NotificationServer { bodyMarkupSupported: true @@ -10,6 +9,5 @@ NotificationServer { imageSupported: true onNotification: notification => { notification.tracked = true; - console.log("got notification!!! arf woof"); } } diff --git a/modules/wallpaper/Overlay.qml b/modules/wallpaper/Overlay.qml index 939a190..058e071 100644 --- a/modules/wallpaper/Overlay.qml +++ b/modules/wallpaper/Overlay.qml @@ -5,8 +5,8 @@ import "../../" import "." WlrLayershell { - required property var modelData id: overlayRoot + required property var modelData // 1. Fill the entire screen anchors { diff --git a/modules/wallpaper/ScreenCorners.qml b/modules/wallpaper/ScreenCorners.qml index 0494c9b..fc1d500 100644 --- a/modules/wallpaper/ScreenCorners.qml +++ b/modules/wallpaper/ScreenCorners.qml @@ -1,3 +1,4 @@ +pragma ComponentBehavior: Bound import QtQuick import QtQuick.Shapes @@ -49,7 +50,7 @@ Item { readonly property real screenHeight: cornersShape.height strokeWidth: -1 // No outline - fillColor: cornerColor + fillColor: root.cornerColor // Smooth fade if you toggle it diff --git a/modules/wallpaper/WallSwitcher.qml b/modules/wallpaper/WallSwitcher.qml index c19dad3..f38527d 100644 --- a/modules/wallpaper/WallSwitcher.qml +++ b/modules/wallpaper/WallSwitcher.qml @@ -1,16 +1,15 @@ +pragma ComponentBehavior: Bound import QtQuick import Qt.labs.folderlistmodel 2.15 // <--- The magic file scanner! import Quickshell import Quickshell.Hyprland import Quickshell.Io -import "." -import qs.modules.bar -import qs +import "../../" FloatingWindow { id: root title: "quickshell-WallSwitcher" - visible: true + visible: false implicitWidth: 840 implicitHeight: 640 @@ -21,8 +20,6 @@ FloatingWindow { onPressed: { // Toggle visibility! root.visible = !root.visible; - - console.log("Shortcut pressed! Switcher is now: " + (root.visible ? "Visible" : "Hidden")); } } @@ -63,19 +60,20 @@ FloatingWindow { model: folderModel delegate: Item { + required property var modelData width: 200 height: 100 Image { + id: wallImage width: 180 height: 90 anchors.centerIn: parent // "fileUrl" is provided by FolderListModel - source: fileUrl + source: parent.modelData.fileUrl // IMPORTANT: Downscale the image for the thumbnail! // If you don't do this, loading 50 4K images will eat your RAM - // faster than Chrome eats memory! 🙀 sourceSize.width: 140 sourceSize.height: 90 @@ -83,18 +81,11 @@ FloatingWindow { } MouseArea { - Process { - id: generateScheme - property string cleanPath: fileUrl.toString().replace("file://", "") - command: ["wallust", "run", cleanPath] - } anchors.fill: parent onClicked: { - let cleanPath = fileUrl.toString().replace("file://", ""); + let cleanPath = parent.modelData.fileUrl.toString().replace("file://", ""); // Update the Singleton! - WallpaperStore.currentWall = fileUrl.toString(); - //generateScheme.startDetached(); - console.log(generateScheme.stdout); + WallpaperStore.currentWall = parent.modelData.fileUrl.toString(); } } } diff --git a/modules/wallpaper/Wallpaper.qml b/modules/wallpaper/Wallpaper.qml index 4ef452c..860d6a8 100644 --- a/modules/wallpaper/Wallpaper.qml +++ b/modules/wallpaper/Wallpaper.qml @@ -1,3 +1,4 @@ +pragma ComponentBehavior: Bound import QtQuick import QtQuick.Controls // <--- Needed for StackView import Quickshell @@ -28,17 +29,12 @@ WlrLayershell { id: wallComponent Image { fillMode: Image.PreserveAspectCrop - width: root.width - height: root.height + width: wallStack.width + height: wallStack.height asynchronous: true // ⚡ VERY IMPORTANT: Prevents lag while loading! } } - // 3. Load the initial wallpaper immediately (No animation on boot) - initialItem: wallComponent.createObject(wallStack, { - "source": WallpaperStore.currentWall - }) - // 4. THE ANIMATIONS 🎬 // When a new wall replaces the old one: diff --git a/qmldir b/qmldir new file mode 100644 index 0000000..a5e692c --- /dev/null +++ b/qmldir @@ -0,0 +1,2 @@ +singleton Colors 1.0 Colors.qml +singleton Appearance 1.0 Appearance.qml diff --git a/shell.qml b/shell.qml index 176d2f9..2169331 100644 --- a/shell.qml +++ b/shell.qml @@ -11,23 +11,22 @@ ShellRoot { id: barVariants model: Quickshell.screens delegate: Bar { - screen: modelData + screen: modelData } } Variants { - id: overlayVariants - model: Quickshell.screens - delegate: Overlay { - screen: modelData - } + id: overlayVariants + model: Quickshell.screens + delegate: Overlay { + screen: modelData + } } Variants { - model: Quickshell.screens id: wallVariants + model: Quickshell.screens delegate: Wallpaper { - screen: modelData + screen: modelData } } - NotiPopup { } - + NotiPopup {} }