From d374a70c9c4f8fdd097820e65048fa9379478ff7 Mon Sep 17 00:00:00 2001 From: Tomas Rivera <137088692+Totorile1@users.noreply.github.com> Date: Wed, 11 Mar 2026 10:48:44 +0100 Subject: [PATCH] Put all the QML colors into a single standalone configurable file --- other/quickshell/Bg.qml | 59 ---- other/quickshell/bar/Bar.qml | 11 +- other/quickshell/bar/Launcher.qml | 39 --- other/quickshell/bar/Power.qml | 6 +- other/quickshell/bar/Time.qml | 5 +- other/quickshell/bar/Tooltip.qml | 5 +- other/quickshell/bar/TooltipBackup.qml | 9 +- other/quickshell/bar/Volume.qml | 9 +- other/quickshell/bar/Workspaces.qml | 3 +- other/quickshell/bar/mpris/Players.qml | 3 +- other/quickshell/bar/systray/MenuCheckBox.qml | 7 +- .../bar/systray/MenuChildrenRevealer.qml | 3 +- other/quickshell/bar/systray/MenuItem.qml | 5 +- .../bar/systray/MenuRadioButton.qml | 3 +- other/quickshell/bar/systray/MenuView.qml | 3 +- other/quickshell/bar/systray/SysTray.qml | 5 +- other/quickshell/components/Rope.qml | 6 +- other/quickshell/helloworld.qml | 16 - other/quickshell/launcher/Controller.qml | 40 --- other/quickshell/launcher/Overlay.qml | 302 ------------------ other/quickshell/lock/Context.qml | 56 ---- other/quickshell/lock/Controller.qml | 47 --- other/quickshell/lock/Surface.qml | 281 ---------------- other/quickshell/lock/pam/password.conf | 2 - other/quickshell/notifs/Display.qml | 7 +- other/quickshell/notifs/Overlay.qml | 3 +- other/quickshell/screenshot/Overlay.qml | 5 +- other/quickshell/theme/Colors.qml | 54 ++++ other/quickshell/theme/qmldir | 1 + 29 files changed, 112 insertions(+), 883 deletions(-) delete mode 100644 other/quickshell/Bg.qml delete mode 100644 other/quickshell/bar/Launcher.qml delete mode 100644 other/quickshell/helloworld.qml delete mode 100644 other/quickshell/launcher/Controller.qml delete mode 100644 other/quickshell/launcher/Overlay.qml delete mode 100644 other/quickshell/lock/Context.qml delete mode 100644 other/quickshell/lock/Controller.qml delete mode 100644 other/quickshell/lock/Surface.qml delete mode 100644 other/quickshell/lock/pam/password.conf create mode 100644 other/quickshell/theme/Colors.qml create mode 100644 other/quickshell/theme/qmldir diff --git a/other/quickshell/Bg.qml b/other/quickshell/Bg.qml deleted file mode 100644 index b6d4dbf..0000000 --- a/other/quickshell/Bg.qml +++ /dev/null @@ -1,59 +0,0 @@ -import Quickshell -import Quickshell.Io -import QtQuick -import QtQuick.Effects -import "./" - -PanelWindow { - property var modelData - screen: modelData - - exclusionMode: ExclusionMode.Ignore - aboveWindows: false - color: "transparent" - anchors { - top: true - left: true - bottom: true - right: true - } - Image { - id: bg - anchors.fill: parent - fillMode: Image.PreserveAspectCrop - source: `./assets/${Globals.isDarkTheme ? "darkbg" : "bg"}.png` - smooth: false - } - MultiEffect { - source: bg - anchors.fill: bg - blurEnabled: false - blurMax: 24 - blur: 1.0 - } - - Text { - id: timetxt - x: 900 - y: 150 - font.family: "BigBlueTermPlusNerdFont" - font.pointSize: 100 - font.bold: true - color: Globals.isDarkTheme ? "#9292B6" : "#3B2640" - - Process { - id: dateProc - command: ["date", "+%H %M"] - running: true - stdout: SplitParser { - onRead: data => timetxt.text = data - } - } - Timer { - interval: 1000 - running: true - repeat: true - onTriggered: dateProc.running = true - } - } -} diff --git a/other/quickshell/bar/Bar.qml b/other/quickshell/bar/Bar.qml index 89e6cdf..372dc09 100644 --- a/other/quickshell/bar/Bar.qml +++ b/other/quickshell/bar/Bar.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import Quickshell.Wayland import "mpris" as Mpris import "systray" as SysTray +import "../theme" as Theme import ".." PanelWindow { @@ -32,7 +33,7 @@ PanelWindow { } exclusiveZone: 48 implicitHeight: 72 - color: "transparent" + color: Theme.Colors.barColor1 mask: barRegion Region { @@ -61,12 +62,12 @@ PanelWindow { implicitWidth: left.width + left.anchors.leftMargin + left.anchors.rightMargin implicitHeight: left.height - color: "#3B253F" + color: Theme.Colors.barColor2 Rectangle { z: -1 anchors.fill: parent - color: "#BE850E" + color: Theme.Colors.barColor3 anchors.margins: -4 } Image { @@ -112,12 +113,12 @@ PanelWindow { implicitWidth: right.width + right.anchors.leftMargin + right.anchors.rightMargin implicitHeight: right.height - color: "#3B253F" + color: Theme.Colors.barColor4 Rectangle { z: -1 anchors.fill: parent - color: "#BE850E" + color: Theme.Colors.barColor5 anchors.margins: -4 } Image { diff --git a/other/quickshell/bar/Launcher.qml b/other/quickshell/bar/Launcher.qml deleted file mode 100644 index 4f4e908..0000000 --- a/other/quickshell/bar/Launcher.qml +++ /dev/null @@ -1,39 +0,0 @@ -import QtQuick -import QtQuick.Effects -import Quickshell -import Quickshell.Io -import QtQuick.Layouts -import "../launcher" as Launcher - -MouseArea { - id: root - - implicitWidth: 26 - implicitHeight: 26 - - acceptedButtons: Qt.LeftButton - - Image { - id: img - anchors.fill: parent - source: "../assets/chi-ro.png" - smooth: false - scale: Launcher.Controller.isOpen ? 0.8 : 1 - Behavior on scale { - NumberAnimation { - duration: 70 - } - } - } - MultiEffect { - source: img - anchors.fill: img - blur: 1.0 - brightness: 0.3 - blurEnabled: true - } - - onPressed: () => { - Launcher.Controller.isOpen = true; - } -} diff --git a/other/quickshell/bar/Power.qml b/other/quickshell/bar/Power.qml index 95ea880..56b38d5 100644 --- a/other/quickshell/bar/Power.qml +++ b/other/quickshell/bar/Power.qml @@ -2,7 +2,7 @@ import QtQuick import QtQuick.Effects import Quickshell.Services.UPower import Qt5Compat.GraphicalEffects - +import "../theme" as Theme Item { id: root @@ -28,13 +28,13 @@ Item { Rectangle { id: progressBar anchors.fill: parent - color: "black" + color: Theme.Colors.powerColor1 Rectangle { anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right height: root.isLaptop ? root.percentage * parent.height : parent.height - color: root.isLaptop ? (root.isLow ? "red" : "#EEA939") : "#EEA939" + color: root.isLaptop ? (root.isLow ? Theme.Colors.powerColor2 : Theme.Colors.powerColor3) : Theme.Colors.powerColor4 } visible: false } diff --git a/other/quickshell/bar/Time.qml b/other/quickshell/bar/Time.qml index 4d9089b..4d9eae1 100644 --- a/other/quickshell/bar/Time.qml +++ b/other/quickshell/bar/Time.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Layouts import Quickshell.Io +import "../theme" as Theme import ".." Text { @@ -8,12 +9,12 @@ Text { font.family: "BigBlueTermPlusNerdFont" font.pointSize: 16 font.bold: true - color: "white" + color: Theme.Colors.timeColor1 opacity: 0.5 Process { id: dateProc - command: ["date", "+%H:%M"] + command: ["date", "+%Y-%m-%d\(%a\)\ %T"] running: true stdout: SplitParser { onRead: data => timetxt.text = data diff --git a/other/quickshell/bar/Tooltip.qml b/other/quickshell/bar/Tooltip.qml index 23a9b23..94e9af2 100644 --- a/other/quickshell/bar/Tooltip.qml +++ b/other/quickshell/bar/Tooltip.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import QtQuick import Quickshell import Quickshell.Hyprland +import "../theme" as Theme import "root:/" Scope { @@ -113,7 +114,7 @@ Scope { //implicitWidth: Math.max(700, tooltipItem.largestAnimWidth) // max due to qtwayland glitches //implicitHeight: Math.max(700, tooltipItem.largestAnimHeight) // max due to qtwayland glitches visible: true - color: "transparent" + color: Theme.Colors.tooltipColor1 //color: "#20ff0000" mask: Region { @@ -154,7 +155,7 @@ Scope { // bkg Rectangle { anchors.fill: parent - color: "#3B253F" + color: Theme.Colors.tooltipColor2 } readonly property var targetWidth: shownItem?.implicitWidth ?? 0 diff --git a/other/quickshell/bar/TooltipBackup.qml b/other/quickshell/bar/TooltipBackup.qml index 4a5d3cd..d7f2e39 100644 --- a/other/quickshell/bar/TooltipBackup.qml +++ b/other/quickshell/bar/TooltipBackup.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import QtQuick import Quickshell import Quickshell.Hyprland +import "../theme" as Theme import "root:/" Scope { @@ -118,7 +119,7 @@ Scope { return h; } visible: true - color: "transparent" + color: Theme.Colors.tooltipBackupColor1 //color: "#20ff0000" mask: Region { @@ -136,14 +137,14 @@ Scope { } /*Rectangle { - color: "#10ff0000" + color: Theme.Colors.tooltipBackupColor2 //y: tooltipItem.highestAnimY height: tooltipItem.lowestAnimY - tooltipItem.highestAnimY width: parent.width } Rectangle { - color: "#1000ff00" + color: Theme.Colors.tooltipBackupColor3 //y: tooltipItem.highestAnimY height: popup.height width: parent.width @@ -173,7 +174,7 @@ Scope { // bkg Rectangle { anchors.fill: parent - color: "red" + color: Theme.Colors.tooltipBackupColor4 } readonly property var targetWidth: shownItem?.implicitWidth ?? 0 diff --git a/other/quickshell/bar/Volume.qml b/other/quickshell/bar/Volume.qml index afc2bf1..4c0c42a 100644 --- a/other/quickshell/bar/Volume.qml +++ b/other/quickshell/bar/Volume.qml @@ -6,6 +6,7 @@ import QtQuick.Controls import Quickshell import Quickshell.Services.Pipewire import Quickshell.Widgets +import "../theme" as Theme import "mpris" MouseArea { @@ -62,7 +63,7 @@ MouseArea { anchor.window: root.bar width: 200 height: 32 - color: "#9B5B36" + color: Theme.Colors.volumeColor1 Connections { target: root function onXChanged() { @@ -97,7 +98,7 @@ MouseArea { implicitHeight: 16 width: slider.availableWidth height: implicitHeight - color: "#824524" + color: Theme.Colors.volumeColor2 opacity: node.audio.muted ? 0.5 : 1 Rectangle { @@ -106,7 +107,7 @@ MouseArea { y: anchors.topMargin width: slider.visualPosition * (parent.width - anchors.leftMargin - anchors.rightMargin) height: parent.height - anchors.topMargin - anchors.bottomMargin - color: "#8D804B" + color: Theme.Colors.volumeColor3 } } @@ -116,7 +117,7 @@ MouseArea { implicitWidth: 12 implicitHeight: 12 rotation: 45 - color: "#8D804B" + color: Theme.Colors.volumeColor4 } } diff --git a/other/quickshell/bar/Workspaces.qml b/other/quickshell/bar/Workspaces.qml index 6c76bdc..10abe98 100644 --- a/other/quickshell/bar/Workspaces.qml +++ b/other/quickshell/bar/Workspaces.qml @@ -4,6 +4,7 @@ import QtQuick import QtQuick.Effects import QtQuick.Layouts import Quickshell.Hyprland +import "../theme" as Theme MouseArea { id: root @@ -81,7 +82,7 @@ MouseArea { anchors.fill: parent anchors.margins: 2 radius: width / 2 - color: wsItem.exists ? "#C0DB4C" : "#59622D" + color: wsItem.exists ? Theme.Colors.workspacesColor1 : Theme.Colors.workspacesColor2 } Image { anchors.fill: parent diff --git a/other/quickshell/bar/mpris/Players.qml b/other/quickshell/bar/mpris/Players.qml index 363a8c1..792d8ee 100644 --- a/other/quickshell/bar/mpris/Players.qml +++ b/other/quickshell/bar/mpris/Players.qml @@ -9,6 +9,7 @@ import Quickshell.Widgets import Quickshell.Wayland import Quickshell.Hyprland import Quickshell.Services.Mpris +import "../../theme" as Theme import "../.." import ".." @@ -148,7 +149,7 @@ MouseArea { elide: Text.ElideRight width: Math.min(parent.width - 20, implicitWidth) font.family: "BigBlueTermPlusNerdFont" - color: "white" + color: Theme.Colors.playersLabel } } } diff --git a/other/quickshell/bar/systray/MenuCheckBox.qml b/other/quickshell/bar/systray/MenuCheckBox.qml index 2f24423..3131fe5 100644 --- a/other/quickshell/bar/systray/MenuCheckBox.qml +++ b/other/quickshell/bar/systray/MenuCheckBox.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Shapes +import "../../theme" as Theme import "../.." Rectangle { @@ -7,7 +8,7 @@ Rectangle { implicitHeight: 18 implicitWidth: 18 radius: 3 - color: checkState == Qt.Checked ? "#C5E3EE" : "#90ACAD" + color: checkState == Qt.Checked ? Theme.Colors.menuCheckBoxChecked1 : Theme.Colors.menuCheckBoxChecked2 Shape { visible: checkState == Qt.Checked @@ -18,8 +19,8 @@ Rectangle { ShapePath { strokeWidth: 2 capStyle: ShapePath.RoundCap - joinStyle: ShapePath.RoundJoin - fillColor: "transparent" + joinStyle: ShapePath.RoundJoin + fillColor: Theme.Colors.menuCheckBoxShapePath startX: start.x startY: start.y diff --git a/other/quickshell/bar/systray/MenuChildrenRevealer.qml b/other/quickshell/bar/systray/MenuChildrenRevealer.qml index ad7c0f8..4a9d0fe 100644 --- a/other/quickshell/bar/systray/MenuChildrenRevealer.qml +++ b/other/quickshell/bar/systray/MenuChildrenRevealer.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Shapes import Quickshell +import "../../theme" as Theme Item { property bool expanded: false; @@ -37,7 +38,7 @@ Item { strokeWidth: 2 capStyle: ShapePath.RoundCap joinStyle: ShapePath.MiterJoin - fillColor: "transparent" + fillColor: Theme.Colors.menuChildrenRevealerShapePath startX: xStart startY: yStart diff --git a/other/quickshell/bar/systray/MenuItem.qml b/other/quickshell/bar/systray/MenuItem.qml index ab3c819..f0177bf 100644 --- a/other/quickshell/bar/systray/MenuItem.qml +++ b/other/quickshell/bar/systray/MenuItem.qml @@ -3,6 +3,7 @@ import QtQuick.Layouts import Quickshell import Quickshell.Widgets import Quickshell.DBusMenu +import "../../theme" as Theme import "../.." MouseArea { @@ -34,7 +35,7 @@ MouseArea { anchors.fill: parent visible: root.containsMouse || childrenRevealer.expanded - color: "#824524" + color: Theme.Colors.menuItemColor1 } ColumnLayout { id: row @@ -71,7 +72,7 @@ MouseArea { Text { text: entry.text - color: entry.enabled ? "white" : "#bbbbbb" + color: entry.enabled ? Theme.Colors.menuItemColor2 : Theme.Colors.menuItemColor3 } Item { diff --git a/other/quickshell/bar/systray/MenuRadioButton.qml b/other/quickshell/bar/systray/MenuRadioButton.qml index 2abd692..b32ff0d 100644 --- a/other/quickshell/bar/systray/MenuRadioButton.qml +++ b/other/quickshell/bar/systray/MenuRadioButton.qml @@ -1,4 +1,5 @@ import QtQuick +import "../../theme" as Theme import "../.." Rectangle { @@ -6,7 +7,7 @@ Rectangle { implicitHeight: 18 implicitWidth: 18 radius: width / 2 - color: checkState == Qt.Checked ? "#C5E3EE" : "#90ACAD" + color: checkState == Qt.Checked ? Theme.Colors.menuRadioButtonColor1 : Theme.Colors.menuRadioButtonColor2 Rectangle { x: parent.width * 0.25 diff --git a/other/quickshell/bar/systray/MenuView.qml b/other/quickshell/bar/systray/MenuView.qml index 2b2682b..15afb39 100644 --- a/other/quickshell/bar/systray/MenuView.qml +++ b/other/quickshell/bar/systray/MenuView.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Layouts import Quickshell +import "../../theme" as Theme ColumnLayout { id: root @@ -60,7 +61,7 @@ ColumnLayout { property var separator: Component { Rectangle { - color: "#824524" + color: Theme.Colors.menuViewColor implicitHeight: 4 } } diff --git a/other/quickshell/bar/systray/SysTray.qml b/other/quickshell/bar/systray/SysTray.qml index 19c01a7..25df5f4 100644 --- a/other/quickshell/bar/systray/SysTray.qml +++ b/other/quickshell/bar/systray/SysTray.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import QtQuick.Effects import Quickshell import Quickshell.Services.SystemTray +import "../../theme" as Theme import ".." import "../.." import "../../components" @@ -121,11 +122,11 @@ Rectangle { implicitWidth: Math.max(1, menuView.implicitWidth) implicitHeight: Math.max(1, menuView.implicitHeight) - color: "transparent" + color: Theme.Colors.sysTrayColor1 Rectangle { anchors.fill: parent - color: "#9B5B36" + color: Theme.Colors.sysTrayColor2 MenuView { id: menuView anchors.fill: parent diff --git a/other/quickshell/components/Rope.qml b/other/quickshell/components/Rope.qml index 9d1c7db..d24cb42 100644 --- a/other/quickshell/components/Rope.qml +++ b/other/quickshell/components/Rope.qml @@ -1,6 +1,6 @@ import QtQuick import QtQuick.Shapes - +import "../theme" as Theme Item { id: root @@ -30,9 +30,9 @@ Item { ShapePath { id: path capStyle: ShapePath.RoundCap - strokeColor: "#DAC99B" + strokeColor: Theme.Colors.ropeColor1 strokeWidth: 10 - fillColor: "transparent" + fillColor: Theme.Colors.ropeColor2 } } diff --git a/other/quickshell/helloworld.qml b/other/quickshell/helloworld.qml deleted file mode 100644 index 0c30bbe..0000000 --- a/other/quickshell/helloworld.qml +++ /dev/null @@ -1,16 +0,0 @@ -import Quickshell -import QtQuick - -FloatingWindow { - visible: true - width: 200 - height: 100 - - Text { - anchors.centerIn: parent - // centers it within parent - text: "Hello world!" - color: "#0db9d7" - font.pixelSize: 18 - } -} diff --git a/other/quickshell/launcher/Controller.qml b/other/quickshell/launcher/Controller.qml deleted file mode 100644 index ee68419..0000000 --- a/other/quickshell/launcher/Controller.qml +++ /dev/null @@ -1,40 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import QtQuick -import Quickshell -import Quickshell.Io -import "." as Launcher - -Singleton { - id: root - property bool isOpen: false - property var lastUsedTimes: ({}) - - IpcHandler { - target: "launcher" - - function open() { - root.isOpen = true; - } - - function close() { - root.isOpen = false; - } - - function toggle() { - root.isOpen = !root.isOpen; - } - } - - LazyLoader { - active: root.isOpen - Launcher.Overlay { - controller: root - } - } - - // Empty function to define first reference to singleton - function init() { - } -} diff --git a/other/quickshell/launcher/Overlay.qml b/other/quickshell/launcher/Overlay.qml deleted file mode 100644 index ad750c2..0000000 --- a/other/quickshell/launcher/Overlay.qml +++ /dev/null @@ -1,302 +0,0 @@ -pragma ComponentBehavior: Bound - -import QtQuick -import QtQuick.Effects -import QtQuick.Layouts -import Quickshell -import Quickshell.Wayland -import Quickshell.Widgets -import ".." - -PanelWindow { - id: root - - required property var controller - - exclusionMode: ExclusionMode.Ignore - anchors { - left: true - right: true - top: true - bottom: true - } - color: "transparent" - WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive - WlrLayershell.namespace: "shell:launcher" - - Rectangle { - id: main - - anchors.centerIn: parent - height: 7 + searchContainer.implicitHeight + list.topMargin + list.bottomMargin + Math.min(list.contentHeight, list.delegateHeight * 10) - Behavior on height { - NumberAnimation { - duration: 200 - easing.type: Easing.OutCubic - } - } - width: 450 - color: Globals.isDarkTheme ? "#393536" : "#f3eac7" - - ColumnLayout { - anchors.fill: parent - anchors.margins: 7 - anchors.bottomMargin: 0 - spacing: 0 - - Rectangle { - id: searchContainer - Layout.fillWidth: true - implicitHeight: search.implicitHeight + 10 - color: Globals.isDarkTheme ? "#44000000" : "#11000000" - - TextInput { - id: search - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 4 - color: Globals.isDarkTheme ? "#D6C8A6" : "#403D3B" - - font.family: "BigBlueTermPlusNerdFont" - - focus: true - Keys.forwardTo: [list] - Keys.onEscapePressed: root.controller.isOpen = false - - Keys.onPressed: event => { - if (event.modifiers & Qt.ControlModifier) { - if (event.key == Qt.Key_J) { - list.currentIndex = list.currentIndex == list.count - 1 ? 0 : list.currentIndex + 1; - event.accepted = true; - } else if (event.key == Qt.Key_K) { - list.currentIndex = list.currentIndex == 0 ? list.count - 1 : list.currentIndex - 1; - event.accepted = true; - } - } - } - - onAccepted: { - if (list.currentItem) { - list.currentItem.clicked(null); - } - } - - onTextChanged: { - list.currentIndex = 0; - } - } - } - - ListView { - id: list - Layout.fillWidth: true - Layout.fillHeight: true - clip: true - cacheBuffer: 0 // works around QTBUG-131106 - //reuseItems: true - - model: ScriptModel { - values: DesktopEntries.applications.values.map(object => { - const stxt = search.text.toLowerCase(); - const ntxt = object.name.toLowerCase(); - - let si = 0; - let ni = 0; - - let matches = []; - let startMatch = -1; - - for (let si = 0; si != stxt.length; ++si) { - const sc = stxt[si]; - - while (true) { - // Drop any entries with letters that don't exist in order - if (ni == ntxt.length) - return null; - - const nc = ntxt[ni++]; - - if (nc == sc) { - if (startMatch == -1) - startMatch = ni; - break; - } else { - if (startMatch != -1) { - matches.push({ - index: startMatch, - length: ni - startMatch - }); - - startMatch = -1; - } - } - } - } - - if (startMatch != -1) { - matches.push({ - index: startMatch, - length: ni - startMatch + 1 - }); - } - - return { - object: object, - matches: matches - }; - }).filter(entry => entry !== null).sort((a, b) => { - if (!search.text) { - if (controller.lastUsedTimes[a.object.id]) - print(controller.lastUsedTimes[a.object.id]); - let aDate = controller.lastUsedTimes[a.object.id] ?? new Date(0); - let bDate = controller.lastUsedTimes[b.object.id] ?? new Date(0); - return bDate - aDate; - } - - let ai = 0; - let bi = 0; - let s = 0; - - while (ai != a.matches.length && bi != b.matches.length) { - const am = a.matches[ai]; - const bm = b.matches[bi]; - - s = bm.length - am.length; - if (s != 0) - return s; - - s = am.index - bm.index; - if (s != 0) - return s; - - ++ai; - ++bi; - } - - s = a.matches.length - b.matches.length; - if (s != 0) - return s; - - s = a.object.name.length - b.object.name.length; - if (s != 0) - return s; - - return a.object.name.localeCompare(b.object.name); - }).map(entry => entry.object) - - onValuesChanged: list.currentIndex = 0 - } - - topMargin: 7 - bottomMargin: list.count == 0 ? 0 : 7 - - add: Transition { - NumberAnimation { - property: "opacity" - from: 0 - to: 1 - duration: 100 - } - } - - displaced: Transition { - NumberAnimation { - property: "y" - duration: 200 - easing.type: Easing.OutCubic - } - NumberAnimation { - property: "opacity" - to: 1 - duration: 100 - } - } - - move: Transition { - NumberAnimation { - property: "y" - duration: 200 - easing.type: Easing.OutCubic - } - NumberAnimation { - property: "opacity" - to: 1 - duration: 100 - } - } - - remove: Transition { - NumberAnimation { - property: "y" - duration: 200 - easing.type: Easing.OutCubic - } - NumberAnimation { - property: "opacity" - to: 0 - duration: 100 - } - } - - highlight: Rectangle { - color: Globals.isDarkTheme ? "#20e0ffff" : "#11000000" - } - keyNavigationEnabled: true - keyNavigationWraps: true - highlightMoveVelocity: -1 - highlightMoveDuration: 100 - preferredHighlightBegin: list.topMargin - preferredHighlightEnd: list.height - list.bottomMargin - highlightRangeMode: ListView.ApplyRange - snapMode: ListView.SnapToItem - - readonly property real delegateHeight: 44 - - delegate: MouseArea { - required property DesktopEntry modelData - - implicitHeight: list.delegateHeight - implicitWidth: ListView.view.width - - onClicked: { - controller.lastUsedTimes[modelData.id] = new Date(); - modelData.execute(); - root.controller.isOpen = false; - } - - RowLayout { - id: delegateLayout - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: 5 - } - - IconImage { - Layout.alignment: Qt.AlignVCenter - asynchronous: true - implicitSize: 30 - source: Quickshell.iconPath(modelData.icon) - } - Text { - text: modelData.name - font.family: "BigBlueTermPlusNerdFont" - color: Globals.isDarkTheme ? "#D6C8A6" : "#403D3B" - Layout.alignment: Qt.AlignVCenter - } - } - } - } - } - } - MultiEffect { - source: main - anchors.fill: main - shadowBlur: 0 - shadowEnabled: true - shadowColor: "#33000000" - shadowVerticalOffset: 16 - shadowHorizontalOffset: 12 - } -} diff --git a/other/quickshell/lock/Context.qml b/other/quickshell/lock/Context.qml deleted file mode 100644 index a29895e..0000000 --- a/other/quickshell/lock/Context.qml +++ /dev/null @@ -1,56 +0,0 @@ -import QtQuick -import Quickshell -import Quickshell.Services.Pam - -Scope { - id: root - signal pamSuccess - signal unlocked - signal failed - - // These properties are in the context and not individual lock surfaces - // so all surfaces can share the same state. - property string currentText: "" - property bool unlockInProgress: false - property bool showFailure: false - - // Clear the failure text once the user starts typing. - onCurrentTextChanged: showFailure = false - - function tryUnlock() { - if (currentText === "") - return; - - root.unlockInProgress = true; - pam.start(); - } - - PamContext { - id: pam - - // Its best to have a custom pam config for quickshell, as the system one - // might not be what your interface expects, and break in some way. - // This particular example only supports passwords. - configDirectory: "pam" - config: "password.conf" - - // pam_unix will ask for a response for the password prompt - onPamMessage: { - if (this.responseRequired) { - this.respond(root.currentText); - } - } - - // pam_unix won't send any important messages so all we need is the completion status. - onCompleted: result => { - if (result == PamResult.Success) { - root.pamSuccess(); - } else { - root.currentText = ""; - root.showFailure = true; - } - - root.unlockInProgress = false; - } - } -} diff --git a/other/quickshell/lock/Controller.qml b/other/quickshell/lock/Controller.qml deleted file mode 100644 index f2b01d8..0000000 --- a/other/quickshell/lock/Controller.qml +++ /dev/null @@ -1,47 +0,0 @@ -pragma Singleton -pragma ComponentBehavior: Bound - -import Quickshell -import Quickshell.Io -import Quickshell.Wayland -import QtQuick -import "." as Lock - -Singleton { - Process { - id: screencopyCmd - running: false - command: ["grim", "-s", "0.5", "-t", "jpeg", "/tmp/lock_screencopy.jpeg"] - onExited: lock.locked = true - } - IpcHandler { - target: "lockscreen" - - function lock(): void { - screencopyCmd.running = true; - } - } - - WlSessionLock { - id: lock - locked: false - - WlSessionLockSurface { - id: lockSurface - color: "transparent" - Lock.Surface { - anchors.fill: parent - context: lockContext - } - } - } - - Lock.Context { - id: lockContext - onUnlocked: lock.locked = false - } - - // Empty function to define first reference to singleton - function init() { - } -} diff --git a/other/quickshell/lock/Surface.qml b/other/quickshell/lock/Surface.qml deleted file mode 100644 index 4426b74..0000000 --- a/other/quickshell/lock/Surface.qml +++ /dev/null @@ -1,281 +0,0 @@ -pragma ComponentBehavior: Bound - -import QtQuick -import QtQuick.Layouts -import QtQuick.Effects -import QtQuick.Controls.Fusion -import Quickshell.Wayland -import Quickshell -import "." as Lock - -Rectangle { - id: root - required property Lock.Context context - - color: "black" - - Image { - id: chest - anchors.centerIn: parent - source: "../assets/chest.png" - sourceClipRect: Qt.rect(32, 0, 32, 32) - smooth: false - height: width - - // Rectangles - RowLayout { - visible: passwordBox.enabled - anchors.centerIn: parent - anchors.verticalCenterOffset: 31 - spacing: 31 - Repeater { - model: 6 - delegate: Rectangle { - id: r - required property var modelData - color: root.context.showFailure ? "#D6568F" : "#6BCBF3" - implicitWidth: 31 - implicitHeight: 31 - MultiEffect { - id: glow - source: parent - anchors.fill: parent - brightness: passwordBox.length > r.modelData ? 0.7 : 0 - blur: passwordBox.length > r.modelData ? 2.0 : 0 - blurEnabled: true - } - } - } - } - - Image { - id: screencopy - anchors.centerIn: parent - source: "/tmp/lock_screencopy.jpeg" - height: width * (9 / 16) // Width is animated below - } - - Image { - id: chestInFront - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - height: parent.width / 2 - source: "../assets/chest.png" - sourceClipRect: Qt.rect(32, 16, 32, 16) - smooth: false - visible: false - z: 9999 - } - } - - // Enter anim - // ------------ - - // Screencopy anim - NumberAnimation { - target: screencopy - property: "width" - from: 1920 - to: 250 - duration: 700 - easing.type: Easing.OutBack - easing.overshoot: 0.9 - running: true - } - SequentialAnimation { - id: screencopyAnim - running: true - NumberAnimation { - target: screencopy - property: "anchors.verticalCenterOffset" - to: -150 - duration: 500 - easing.type: Easing.OutBack - } - PauseAnimation { - duration: 200 - } - PropertyAction { - target: chestInFront - property: "visible" - value: true - } - NumberAnimation { - target: screencopy - property: "anchors.verticalCenterOffset" - to: 100 - duration: 300 - easing.type: Easing.Linear - } - } - - // Chest anim - SequentialAnimation { - id: chestAnim - running: true - NumberAnimation { - target: chest - property: "width" - from: 2000 - to: 500 - duration: 500 - easing.type: Easing.OutBack - running: true - } - PauseAnimation { - duration: 500 - } - PropertyAction { - target: chest - property: "sourceClipRect.x" - value: 0 - } - PropertyAction { - target: chestInFront - property: "visible" - value: false - } - PropertyAction { - target: screencopy - property: "visible" - value: false - } - NumberAnimation { - onStarted: screencopy.visible = false - target: chest - property: "anchors.verticalCenterOffset" - to: 50 - duration: 100 - easing.type: Easing.OutBack - } - NumberAnimation { - target: chest - property: "anchors.verticalCenterOffset" - to: 0 - duration: 100 - easing.type: Easing.OutBack - } - } - - // Exit anim - // ------------ - - // Screencopy anim - SequentialAnimation { - id: screencopyAnimExit - running: false - PropertyAction { - target: chestInFront - property: "visible" - value: true - } - NumberAnimation { - target: screencopy - property: "anchors.verticalCenterOffset" - to: -150 - duration: 200 - easing.type: Easing.OutBack - } - PropertyAction { - target: chestInFront - property: "visible" - value: false - } - NumberAnimation { - target: screencopy - property: "anchors.verticalCenterOffset" - to: 0 - duration: 400 - easing.type: Easing.OutBack - } - NumberAnimation { - target: screencopy - property: "width" - to: 1920 - duration: 400 - easing.type: Easing.OutBack - running: true - } - onFinished: () => root.context.unlocked() - } - - // Chest anim - SequentialAnimation { - id: chestAnimExit - running: false - PropertyAction { - target: chest - property: "sourceClipRect.x" - value: 32 - } - PropertyAction { - target: screencopy - property: "visible" - value: true - } - NumberAnimation { - target: chest - property: "anchors.verticalCenterOffset" - to: -50 - duration: 100 - easing.type: Easing.OutBack - } - NumberAnimation { - target: chest - property: "anchors.verticalCenterOffset" - to: 0 - duration: 200 - easing.type: Easing.OutBack - } - } - - TextField { - id: passwordBox - - implicitWidth: 400 - font.pointSize: 50 - color: "transparent" - cursorVisible: false - background: Rectangle { - color: "transparent" - } - - focus: true - enabled: !screencopyAnim.running && !chestAnim.running && !screencopyAnimExit.running && !chestAnimExit.running && !root.context.unlockInProgress - opacity: 0 - echoMode: TextInput.Password - inputMethodHints: Qt.ImhSensitiveData - - onTextChanged: () => { - if (text != "") { - root.context.showFailure = false; - } - } - - onAccepted: () => { - root.context.currentText = text; - root.context.tryUnlock(); - } - - Connections { - target: root.context - - function onUnlockInProgressChanged() { - if (root.context.unlockInProgress == false) { - passwordBox.text = ""; - } - } - - function onPamSuccess() { - screencopyAnimExit.running = true; - chestAnimExit.running = true; - } - } - } - - // Button { - // text: "Its not working, let me out" - // onClicked: root.context.unlocked() - // } -} diff --git a/other/quickshell/lock/pam/password.conf b/other/quickshell/lock/pam/password.conf deleted file mode 100644 index 50babc8..0000000 --- a/other/quickshell/lock/pam/password.conf +++ /dev/null @@ -1,2 +0,0 @@ -auth required pam_unix.so - diff --git a/other/quickshell/notifs/Display.qml b/other/quickshell/notifs/Display.qml index 7366afb..89a1d3a 100644 --- a/other/quickshell/notifs/Display.qml +++ b/other/quickshell/notifs/Display.qml @@ -3,6 +3,7 @@ import QtQuick import QtQuick.Layouts import Quickshell.Services.Notifications +import "../theme" as Theme Item { id: root @@ -32,7 +33,7 @@ Item { Rectangle { id: bannerRect - color: "#3B253F" + color: Theme.Colors.background Layout.fillWidth: true implicitHeight: textColumn.height Layout.leftMargin: (width / trumpetTop.sourceSize.width) * 2 + 3 @@ -70,7 +71,7 @@ Item { wrapMode: Text.Wrap font.pointSize: 18 font.bold: true - color: "#9292B6" + color: Theme.Colors.displayColor1 } Text { @@ -79,7 +80,7 @@ Item { wrapMode: Text.Wrap font.pointSize: 14 font.bold: false - color: "#9292B6" + color: Theme.Colors.displayColor2 } } } diff --git a/other/quickshell/notifs/Overlay.qml b/other/quickshell/notifs/Overlay.qml index 3a86adc..dbe7ab3 100644 --- a/other/quickshell/notifs/Overlay.qml +++ b/other/quickshell/notifs/Overlay.qml @@ -4,6 +4,7 @@ import QtQuick import Quickshell import Quickshell.Wayland import Quickshell.Services.Notifications +import "../theme" as Theme import "." PanelWindow { @@ -14,7 +15,7 @@ PanelWindow { WlrLayershell.namespace: "shell:notifications" exclusionMode: ExclusionMode.Ignore - color: "transparent" + color: Theme.Colors.notifsOverlayColor1 anchors { left: true diff --git a/other/quickshell/screenshot/Overlay.qml b/other/quickshell/screenshot/Overlay.qml index 0625cfb..fd4c96f 100644 --- a/other/quickshell/screenshot/Overlay.qml +++ b/other/quickshell/screenshot/Overlay.qml @@ -4,6 +4,7 @@ import QtQuick import Quickshell import Quickshell.Io import Quickshell.Wayland +import "../theme" as Theme import "../components" // TODO: make configurable: cursor visibility, screen freeze @@ -76,11 +77,11 @@ PanelWindow { ctx.reset(); // Background - ctx.fillStyle = "#44000000"; + ctx.fillStyle = Theme.Colors.screenshotOverlayColor1; ctx.fillRect(0, 0, root.width, root.height); // Border - ctx.fillStyle = "#824524"; + ctx.fillStyle = Theme.Colors.screenshotOverlayColor2; ctx.fillRect(root.left - borderExtendX, root.top - borderWidthH, root.right - root.left + borderExtendX * 2, borderWidthH); ctx.fillRect(root.left - borderExtendX, root.bottom, root.right - root.left + borderExtendX * 2, borderWidthH); ctx.fillRect(root.left - borderWidthV, root.top - borderExtendY, borderWidthV, root.bottom - root.top + borderExtendY * 2); diff --git a/other/quickshell/theme/Colors.qml b/other/quickshell/theme/Colors.qml new file mode 100644 index 0000000..f942b4c --- /dev/null +++ b/other/quickshell/theme/Colors.qml @@ -0,0 +1,54 @@ +// Colors.qml +pragma Singleton +import QtQuick + +QtObject { + readonly property color text: "#9292B6" + readonly property color background: "#3B253F" + + + + // dont know what they are + readonly property color playersLabel: "white" + readonly property color menuCheckBoxChecked1: "#C5E3EE" + readonly property color menuCheckBoxChecked2: "#90ACAD" + readonly property color menuCheckBoxShapePath: "transparent" + readonly property color menuChildrenRevealerShapePath: "transparent" + readonly property color menuItemColor1: "#824524" + readonly property color menuItemColor2: "white" + readonly property color menuItemColor3: "#bbbbbb" + readonly property color menuRadioButtonColor1: "#C5E3EE" + readonly property color menuRadioButtonColor2: "#90ACAD" + readonly property color menuViewColor: "#824524" + readonly property color sysTrayColor1: "transparent" + readonly property color sysTrayColor2: "#9B5B36" + readonly property color barColor1: "transparent" + readonly property color barColor2: "#3B253F" + readonly property color barColor3: "#BE850E" + readonly property color barColor4: "#3B253F" + readonly property color barColor5: "#BE850E" + readonly property color powerColor1: "black" + readonly property color powerColor2: "red" + readonly property color powerColor3: "#EEA939" + readonly property color powerColor4: "#EEA939" + readonly property color timeColor1: "white" + readonly property color tooltipColor1: "transparent" + readonly property color tooltipColor2: "#3B253F" + readonly property color tooltipBackupColor1: "transparent" + readonly property color tooltipBackupColor2: "#10ff0000" + readonly property color tooltipBackupColor3: "#10ff0000" + readonly property color tooltipBackupColor4: "red" + readonly property color volumeColor1: "#9B5B36" + readonly property color volumeColor2: "#824524" + readonly property color volumeColor3: "#8D804B" + readonly property color volumeColor4: "#8D804B" + readonly property color workspacesColor1: "#C0DB4C" + readonly property color workspacesColor2: "#59622D" + readonly property color ropeColor1: "#DAC99B" + readonly property color ropeColor2: "transparent" + readonly property color displayColor1: "#9292B6" + readonly property color displayColor2: "#9292B6" + readonly property color notifsOverlayColor1: "transparent" + readonly property color screenshotOverlayColor1: "#44000000" + readonly property color screenshotOverlayColor2: "#824524" +} diff --git a/other/quickshell/theme/qmldir b/other/quickshell/theme/qmldir new file mode 100644 index 0000000..b7cddb9 --- /dev/null +++ b/other/quickshell/theme/qmldir @@ -0,0 +1 @@ +singleton Colors 1.0 Colors.qml