feat: init quickshell
This commit is contained in:
46
modules/desktop/quickshell/qml/scripts/test-integration.qml
Normal file
46
modules/desktop/quickshell/qml/scripts/test-integration.qml
Normal file
@@ -0,0 +1,46 @@
|
||||
import QtQuick
|
||||
import "../Services" as Services
|
||||
import "../Data" as Data
|
||||
|
||||
// Test matugen integration with full shell context
|
||||
Item {
|
||||
Services.MatugenService {
|
||||
id: matugenService
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("MatugenService test initialized");
|
||||
|
||||
// Connect to the matugen theme
|
||||
if (Data.ThemeManager.matugen) {
|
||||
Data.ThemeManager.matugen.matugenService = matugenService;
|
||||
console.log("Connected service to theme");
|
||||
}
|
||||
}
|
||||
|
||||
onMatugenColorsLoaded: {
|
||||
console.log("✓ Colors loaded signal received");
|
||||
console.log("✓ Service reports available:", isAvailable());
|
||||
console.log("✓ Theme reports active:", Data.ThemeManager.matugen.isMatugenActive());
|
||||
|
||||
if (Data.ThemeManager.matugen.dark) {
|
||||
console.log("✓ Dark theme background:", Data.ThemeManager.matugen.dark.base00);
|
||||
console.log("✓ Dark theme primary:", Data.ThemeManager.matugen.dark.base0D);
|
||||
}
|
||||
|
||||
Qt.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 3000
|
||||
running: true
|
||||
onTriggered: {
|
||||
console.log("✗ Timeout - colors didn't load");
|
||||
Qt.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("Testing matugen integration in shell context...");
|
||||
}
|
||||
}
|
||||
76
modules/desktop/quickshell/qml/scripts/test-matugen.qml
Normal file
76
modules/desktop/quickshell/qml/scripts/test-matugen.qml
Normal file
@@ -0,0 +1,76 @@
|
||||
import QtQuick
|
||||
import Quickshell.Io
|
||||
|
||||
// Simple test script for matugen integration
|
||||
// Run with: quickshell scripts/test-matugen.qml
|
||||
|
||||
Item {
|
||||
FileView {
|
||||
id: matugenFile
|
||||
path: "Data/colors.css"
|
||||
blockWrites: true
|
||||
|
||||
onLoaded: {
|
||||
console.log("✓ Matugen colors.css found!");
|
||||
console.log("File size:", text().length, "bytes");
|
||||
|
||||
const lines = text().split('\n');
|
||||
const colors = {};
|
||||
let colorCount = 0;
|
||||
|
||||
// Parse colors
|
||||
for (const line of lines) {
|
||||
const match = line.match(/@define-color\s+(\w+)\s+(#[0-9a-fA-F]{6});/);
|
||||
if (match) {
|
||||
colors[match[1]] = match[2];
|
||||
colorCount++;
|
||||
}
|
||||
}
|
||||
|
||||
console.log("✓ Found", colorCount, "color definitions");
|
||||
console.log("\nMaterial You colors detected:");
|
||||
|
||||
// Check for key Material You colors
|
||||
const keyColors = ["background", "surface", "primary", "secondary", "tertiary", "on_background", "on_surface", "on_primary", "on_secondary", "on_tertiary", "surface_container", "surface_tint", "error", "outline"];
|
||||
|
||||
for (const colorName of keyColors) {
|
||||
if (colors[colorName]) {
|
||||
console.log(` ${colorName}: ${colors[colorName]}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (colorCount > 10) {
|
||||
console.log("\n✓ Matugen integration should work perfectly!");
|
||||
console.log("✓ Switch to 'Matugen' theme in your quickshell appearance settings");
|
||||
} else {
|
||||
console.log("\n⚠ Limited color palette detected");
|
||||
console.log("⚠ Make sure you've run matugen with a wallpaper or image");
|
||||
}
|
||||
|
||||
Qt.exit(0);
|
||||
}
|
||||
|
||||
onTextChanged: {
|
||||
console.log("Matugen colors updated!");
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 2000
|
||||
running: true
|
||||
onTriggered: {
|
||||
if (!matugenFile.loaded) {
|
||||
console.log("✗ Matugen colors.css not found at Data/colors.css");
|
||||
console.log("✗ Please copy your matugen colors.css to Data/colors.css");
|
||||
console.log(" cp ~/.cache/matugen/colors.css Data/colors.css");
|
||||
console.log("✗ Or generate matugen colors directly to this location");
|
||||
Qt.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("Testing matugen integration...");
|
||||
console.log("Looking for Data/colors.css...");
|
||||
}
|
||||
}
|
||||
40
modules/desktop/quickshell/qml/scripts/test-simple.qml
Normal file
40
modules/desktop/quickshell/qml/scripts/test-simple.qml
Normal file
@@ -0,0 +1,40 @@
|
||||
import QtQuick
|
||||
import "../Data" as Data
|
||||
|
||||
// Simple test for direct matugen import
|
||||
Item {
|
||||
Component.onCompleted: {
|
||||
console.log("Testing direct matugen import...");
|
||||
|
||||
if (Data.ThemeManager.matugen) {
|
||||
console.log("✓ Matugen theme available");
|
||||
console.log("✓ Is active:", Data.ThemeManager.matugen.isMatugenActive());
|
||||
|
||||
if (Data.ThemeManager.matugen.dark) {
|
||||
console.log("✓ Dark theme available");
|
||||
console.log(" Background:", Data.ThemeManager.matugen.dark.base00);
|
||||
console.log(" Primary:", Data.ThemeManager.matugen.dark.base0D);
|
||||
console.log(" Accent:", Data.ThemeManager.matugen.dark.base0E);
|
||||
}
|
||||
|
||||
if (Data.ThemeManager.matugen.light) {
|
||||
console.log("✓ Light theme available");
|
||||
console.log(" Background:", Data.ThemeManager.matugen.light.base00);
|
||||
console.log(" Primary:", Data.ThemeManager.matugen.light.base0D);
|
||||
console.log(" Accent:", Data.ThemeManager.matugen.light.base0E);
|
||||
}
|
||||
|
||||
// Test raw color access
|
||||
const primaryColor = Data.ThemeManager.matugen.getMatugenColor("primary");
|
||||
if (primaryColor) {
|
||||
console.log("✓ Raw primary color:", primaryColor);
|
||||
}
|
||||
|
||||
console.log("✅ Matugen integration working perfectly!");
|
||||
} else {
|
||||
console.log("✗ Matugen theme not found");
|
||||
}
|
||||
|
||||
Qt.exit(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user