Put all the QML colors into a single standalone configurable file

This commit is contained in:
Tomas Rivera
2026-03-11 10:48:44 +01:00
parent 3bc27a2a4f
commit d374a70c9c
29 changed files with 112 additions and 883 deletions
-59
View File
@@ -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
}
}
}
+6 -5
View File
@@ -5,6 +5,7 @@ import QtQuick.Layouts
import Quickshell.Wayland import Quickshell.Wayland
import "mpris" as Mpris import "mpris" as Mpris
import "systray" as SysTray import "systray" as SysTray
import "../theme" as Theme
import ".." import ".."
PanelWindow { PanelWindow {
@@ -32,7 +33,7 @@ PanelWindow {
} }
exclusiveZone: 48 exclusiveZone: 48
implicitHeight: 72 implicitHeight: 72
color: "transparent" color: Theme.Colors.barColor1
mask: barRegion mask: barRegion
Region { Region {
@@ -61,12 +62,12 @@ PanelWindow {
implicitWidth: left.width + left.anchors.leftMargin + left.anchors.rightMargin implicitWidth: left.width + left.anchors.leftMargin + left.anchors.rightMargin
implicitHeight: left.height implicitHeight: left.height
color: "#3B253F" color: Theme.Colors.barColor2
Rectangle { Rectangle {
z: -1 z: -1
anchors.fill: parent anchors.fill: parent
color: "#BE850E" color: Theme.Colors.barColor3
anchors.margins: -4 anchors.margins: -4
} }
Image { Image {
@@ -112,12 +113,12 @@ PanelWindow {
implicitWidth: right.width + right.anchors.leftMargin + right.anchors.rightMargin implicitWidth: right.width + right.anchors.leftMargin + right.anchors.rightMargin
implicitHeight: right.height implicitHeight: right.height
color: "#3B253F" color: Theme.Colors.barColor4
Rectangle { Rectangle {
z: -1 z: -1
anchors.fill: parent anchors.fill: parent
color: "#BE850E" color: Theme.Colors.barColor5
anchors.margins: -4 anchors.margins: -4
} }
Image { Image {
-39
View File
@@ -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;
}
}
+3 -3
View File
@@ -2,7 +2,7 @@ import QtQuick
import QtQuick.Effects import QtQuick.Effects
import Quickshell.Services.UPower import Quickshell.Services.UPower
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import "../theme" as Theme
Item { Item {
id: root id: root
@@ -28,13 +28,13 @@ Item {
Rectangle { Rectangle {
id: progressBar id: progressBar
anchors.fill: parent anchors.fill: parent
color: "black" color: Theme.Colors.powerColor1
Rectangle { Rectangle {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: root.isLaptop ? root.percentage * parent.height : parent.height 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 visible: false
} }
+3 -2
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell.Io import Quickshell.Io
import "../theme" as Theme
import ".." import ".."
Text { Text {
@@ -8,12 +9,12 @@ Text {
font.family: "BigBlueTermPlusNerdFont" font.family: "BigBlueTermPlusNerdFont"
font.pointSize: 16 font.pointSize: 16
font.bold: true font.bold: true
color: "white" color: Theme.Colors.timeColor1
opacity: 0.5 opacity: 0.5
Process { Process {
id: dateProc id: dateProc
command: ["date", "+%H:%M"] command: ["date", "+%Y-%m-%d\(%a\)\ %T"]
running: true running: true
stdout: SplitParser { stdout: SplitParser {
onRead: data => timetxt.text = data onRead: data => timetxt.text = data
+3 -2
View File
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Hyprland import Quickshell.Hyprland
import "../theme" as Theme
import "root:/" import "root:/"
Scope { Scope {
@@ -113,7 +114,7 @@ Scope {
//implicitWidth: Math.max(700, tooltipItem.largestAnimWidth) // max due to qtwayland glitches //implicitWidth: Math.max(700, tooltipItem.largestAnimWidth) // max due to qtwayland glitches
//implicitHeight: Math.max(700, tooltipItem.largestAnimHeight) // max due to qtwayland glitches //implicitHeight: Math.max(700, tooltipItem.largestAnimHeight) // max due to qtwayland glitches
visible: true visible: true
color: "transparent" color: Theme.Colors.tooltipColor1
//color: "#20ff0000" //color: "#20ff0000"
mask: Region { mask: Region {
@@ -154,7 +155,7 @@ Scope {
// bkg // bkg
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: "#3B253F" color: Theme.Colors.tooltipColor2
} }
readonly property var targetWidth: shownItem?.implicitWidth ?? 0 readonly property var targetWidth: shownItem?.implicitWidth ?? 0
+5 -4
View File
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Hyprland import Quickshell.Hyprland
import "../theme" as Theme
import "root:/" import "root:/"
Scope { Scope {
@@ -118,7 +119,7 @@ Scope {
return h; return h;
} }
visible: true visible: true
color: "transparent" color: Theme.Colors.tooltipBackupColor1
//color: "#20ff0000" //color: "#20ff0000"
mask: Region { mask: Region {
@@ -136,14 +137,14 @@ Scope {
} }
/*Rectangle { /*Rectangle {
color: "#10ff0000" color: Theme.Colors.tooltipBackupColor2
//y: tooltipItem.highestAnimY //y: tooltipItem.highestAnimY
height: tooltipItem.lowestAnimY - tooltipItem.highestAnimY height: tooltipItem.lowestAnimY - tooltipItem.highestAnimY
width: parent.width width: parent.width
} }
Rectangle { Rectangle {
color: "#1000ff00" color: Theme.Colors.tooltipBackupColor3
//y: tooltipItem.highestAnimY //y: tooltipItem.highestAnimY
height: popup.height height: popup.height
width: parent.width width: parent.width
@@ -173,7 +174,7 @@ Scope {
// bkg // bkg
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: "red" color: Theme.Colors.tooltipBackupColor4
} }
readonly property var targetWidth: shownItem?.implicitWidth ?? 0 readonly property var targetWidth: shownItem?.implicitWidth ?? 0
+5 -4
View File
@@ -6,6 +6,7 @@ import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
import Quickshell.Widgets import Quickshell.Widgets
import "../theme" as Theme
import "mpris" import "mpris"
MouseArea { MouseArea {
@@ -62,7 +63,7 @@ MouseArea {
anchor.window: root.bar anchor.window: root.bar
width: 200 width: 200
height: 32 height: 32
color: "#9B5B36" color: Theme.Colors.volumeColor1
Connections { Connections {
target: root target: root
function onXChanged() { function onXChanged() {
@@ -97,7 +98,7 @@ MouseArea {
implicitHeight: 16 implicitHeight: 16
width: slider.availableWidth width: slider.availableWidth
height: implicitHeight height: implicitHeight
color: "#824524" color: Theme.Colors.volumeColor2
opacity: node.audio.muted ? 0.5 : 1 opacity: node.audio.muted ? 0.5 : 1
Rectangle { Rectangle {
@@ -106,7 +107,7 @@ MouseArea {
y: anchors.topMargin y: anchors.topMargin
width: slider.visualPosition * (parent.width - anchors.leftMargin - anchors.rightMargin) width: slider.visualPosition * (parent.width - anchors.leftMargin - anchors.rightMargin)
height: parent.height - anchors.topMargin - anchors.bottomMargin height: parent.height - anchors.topMargin - anchors.bottomMargin
color: "#8D804B" color: Theme.Colors.volumeColor3
} }
} }
@@ -116,7 +117,7 @@ MouseArea {
implicitWidth: 12 implicitWidth: 12
implicitHeight: 12 implicitHeight: 12
rotation: 45 rotation: 45
color: "#8D804B" color: Theme.Colors.volumeColor4
} }
} }
+2 -1
View File
@@ -4,6 +4,7 @@ import QtQuick
import QtQuick.Effects import QtQuick.Effects
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell.Hyprland import Quickshell.Hyprland
import "../theme" as Theme
MouseArea { MouseArea {
id: root id: root
@@ -81,7 +82,7 @@ MouseArea {
anchors.fill: parent anchors.fill: parent
anchors.margins: 2 anchors.margins: 2
radius: width / 2 radius: width / 2
color: wsItem.exists ? "#C0DB4C" : "#59622D" color: wsItem.exists ? Theme.Colors.workspacesColor1 : Theme.Colors.workspacesColor2
} }
Image { Image {
anchors.fill: parent anchors.fill: parent
+2 -1
View File
@@ -9,6 +9,7 @@ import Quickshell.Widgets
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Hyprland import Quickshell.Hyprland
import Quickshell.Services.Mpris import Quickshell.Services.Mpris
import "../../theme" as Theme
import "../.." import "../.."
import ".." import ".."
@@ -148,7 +149,7 @@ MouseArea {
elide: Text.ElideRight elide: Text.ElideRight
width: Math.min(parent.width - 20, implicitWidth) width: Math.min(parent.width - 20, implicitWidth)
font.family: "BigBlueTermPlusNerdFont" font.family: "BigBlueTermPlusNerdFont"
color: "white" color: Theme.Colors.playersLabel
} }
} }
} }
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Shapes import QtQuick.Shapes
import "../../theme" as Theme
import "../.." import "../.."
Rectangle { Rectangle {
@@ -7,7 +8,7 @@ Rectangle {
implicitHeight: 18 implicitHeight: 18
implicitWidth: 18 implicitWidth: 18
radius: 3 radius: 3
color: checkState == Qt.Checked ? "#C5E3EE" : "#90ACAD" color: checkState == Qt.Checked ? Theme.Colors.menuCheckBoxChecked1 : Theme.Colors.menuCheckBoxChecked2
Shape { Shape {
visible: checkState == Qt.Checked visible: checkState == Qt.Checked
@@ -18,8 +19,8 @@ Rectangle {
ShapePath { ShapePath {
strokeWidth: 2 strokeWidth: 2
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
joinStyle: ShapePath.RoundJoin joinStyle: ShapePath.RoundJoin
fillColor: "transparent" fillColor: Theme.Colors.menuCheckBoxShapePath
startX: start.x startX: start.x
startY: start.y startY: start.y
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Shapes import QtQuick.Shapes
import Quickshell import Quickshell
import "../../theme" as Theme
Item { Item {
property bool expanded: false; property bool expanded: false;
@@ -37,7 +38,7 @@ Item {
strokeWidth: 2 strokeWidth: 2
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
joinStyle: ShapePath.MiterJoin joinStyle: ShapePath.MiterJoin
fillColor: "transparent" fillColor: Theme.Colors.menuChildrenRevealerShapePath
startX: xStart startX: xStart
startY: yStart startY: yStart
+3 -2
View File
@@ -3,6 +3,7 @@ import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Widgets import Quickshell.Widgets
import Quickshell.DBusMenu import Quickshell.DBusMenu
import "../../theme" as Theme
import "../.." import "../.."
MouseArea { MouseArea {
@@ -34,7 +35,7 @@ MouseArea {
anchors.fill: parent anchors.fill: parent
visible: root.containsMouse || childrenRevealer.expanded visible: root.containsMouse || childrenRevealer.expanded
color: "#824524" color: Theme.Colors.menuItemColor1
} }
ColumnLayout { ColumnLayout {
id: row id: row
@@ -71,7 +72,7 @@ MouseArea {
Text { Text {
text: entry.text text: entry.text
color: entry.enabled ? "white" : "#bbbbbb" color: entry.enabled ? Theme.Colors.menuItemColor2 : Theme.Colors.menuItemColor3
} }
Item { Item {
@@ -1,4 +1,5 @@
import QtQuick import QtQuick
import "../../theme" as Theme
import "../.." import "../.."
Rectangle { Rectangle {
@@ -6,7 +7,7 @@ Rectangle {
implicitHeight: 18 implicitHeight: 18
implicitWidth: 18 implicitWidth: 18
radius: width / 2 radius: width / 2
color: checkState == Qt.Checked ? "#C5E3EE" : "#90ACAD" color: checkState == Qt.Checked ? Theme.Colors.menuRadioButtonColor1 : Theme.Colors.menuRadioButtonColor2
Rectangle { Rectangle {
x: parent.width * 0.25 x: parent.width * 0.25
+2 -1
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import "../../theme" as Theme
ColumnLayout { ColumnLayout {
id: root id: root
@@ -60,7 +61,7 @@ ColumnLayout {
property var separator: Component { property var separator: Component {
Rectangle { Rectangle {
color: "#824524" color: Theme.Colors.menuViewColor
implicitHeight: 4 implicitHeight: 4
} }
} }
+3 -2
View File
@@ -5,6 +5,7 @@ import QtQuick.Layouts
import QtQuick.Effects import QtQuick.Effects
import Quickshell import Quickshell
import Quickshell.Services.SystemTray import Quickshell.Services.SystemTray
import "../../theme" as Theme
import ".." import ".."
import "../.." import "../.."
import "../../components" import "../../components"
@@ -121,11 +122,11 @@ Rectangle {
implicitWidth: Math.max(1, menuView.implicitWidth) implicitWidth: Math.max(1, menuView.implicitWidth)
implicitHeight: Math.max(1, menuView.implicitHeight) implicitHeight: Math.max(1, menuView.implicitHeight)
color: "transparent" color: Theme.Colors.sysTrayColor1
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: "#9B5B36" color: Theme.Colors.sysTrayColor2
MenuView { MenuView {
id: menuView id: menuView
anchors.fill: parent anchors.fill: parent
+3 -3
View File
@@ -1,6 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Shapes import QtQuick.Shapes
import "../theme" as Theme
Item { Item {
id: root id: root
@@ -30,9 +30,9 @@ Item {
ShapePath { ShapePath {
id: path id: path
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
strokeColor: "#DAC99B" strokeColor: Theme.Colors.ropeColor1
strokeWidth: 10 strokeWidth: 10
fillColor: "transparent" fillColor: Theme.Colors.ropeColor2
} }
} }
-16
View File
@@ -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
}
}
-40
View File
@@ -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() {
}
}
-302
View File
@@ -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
}
}
-56
View File
@@ -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;
}
}
}
-47
View File
@@ -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() {
}
}
-281
View File
@@ -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()
// }
}
-2
View File
@@ -1,2 +0,0 @@
auth required pam_unix.so
+4 -3
View File
@@ -3,6 +3,7 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell.Services.Notifications import Quickshell.Services.Notifications
import "../theme" as Theme
Item { Item {
id: root id: root
@@ -32,7 +33,7 @@ Item {
Rectangle { Rectangle {
id: bannerRect id: bannerRect
color: "#3B253F" color: Theme.Colors.background
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: textColumn.height implicitHeight: textColumn.height
Layout.leftMargin: (width / trumpetTop.sourceSize.width) * 2 + 3 Layout.leftMargin: (width / trumpetTop.sourceSize.width) * 2 + 3
@@ -70,7 +71,7 @@ Item {
wrapMode: Text.Wrap wrapMode: Text.Wrap
font.pointSize: 18 font.pointSize: 18
font.bold: true font.bold: true
color: "#9292B6" color: Theme.Colors.displayColor1
} }
Text { Text {
@@ -79,7 +80,7 @@ Item {
wrapMode: Text.Wrap wrapMode: Text.Wrap
font.pointSize: 14 font.pointSize: 14
font.bold: false font.bold: false
color: "#9292B6" color: Theme.Colors.displayColor2
} }
} }
} }
+2 -1
View File
@@ -4,6 +4,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Services.Notifications import Quickshell.Services.Notifications
import "../theme" as Theme
import "." import "."
PanelWindow { PanelWindow {
@@ -14,7 +15,7 @@ PanelWindow {
WlrLayershell.namespace: "shell:notifications" WlrLayershell.namespace: "shell:notifications"
exclusionMode: ExclusionMode.Ignore exclusionMode: ExclusionMode.Ignore
color: "transparent" color: Theme.Colors.notifsOverlayColor1
anchors { anchors {
left: true left: true
+3 -2
View File
@@ -4,6 +4,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Wayland import Quickshell.Wayland
import "../theme" as Theme
import "../components" import "../components"
// TODO: make configurable: cursor visibility, screen freeze // TODO: make configurable: cursor visibility, screen freeze
@@ -76,11 +77,11 @@ PanelWindow {
ctx.reset(); ctx.reset();
// Background // Background
ctx.fillStyle = "#44000000"; ctx.fillStyle = Theme.Colors.screenshotOverlayColor1;
ctx.fillRect(0, 0, root.width, root.height); ctx.fillRect(0, 0, root.width, root.height);
// Border // 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.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 - 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); ctx.fillRect(root.left - borderWidthV, root.top - borderExtendY, borderWidthV, root.bottom - root.top + borderExtendY * 2);
+54
View File
@@ -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"
}
+1
View File
@@ -0,0 +1 @@
singleton Colors 1.0 Colors.qml