feat: init quickshell
This commit is contained in:
38
modules/desktop/quickshell/qml/Data/MatugenManager.qml
Normal file
38
modules/desktop/quickshell/qml/Data/MatugenManager.qml
Normal file
@@ -0,0 +1,38 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
property var service: null
|
||||
|
||||
// Expose current colors from the service
|
||||
readonly property color primary: service?.colors?.raw?.primary || "#7ed7b8"
|
||||
readonly property color on_primary: service?.colors?.raw?.on_primary || "#00382a"
|
||||
readonly property color primary_container: service?.colors?.raw?.primary_container || "#454b03"
|
||||
readonly property color on_primary_container: service?.colors?.raw?.on_primary_container || "#e2e993"
|
||||
readonly property color secondary: service?.colors?.raw?.secondary || "#c8c9a6"
|
||||
readonly property color surface_bright: service?.colors?.raw?.surface_bright || "#373b30"
|
||||
readonly property bool hasColors: service?.isLoaded || false
|
||||
|
||||
// Expose all raw Material 3 colors for complete access
|
||||
readonly property var rawColors: service?.colors?.raw || ({})
|
||||
|
||||
function setService(matugenService) {
|
||||
service = matugenService;
|
||||
console.log("MatugenManager: Service registered");
|
||||
}
|
||||
|
||||
function reloadColors() {
|
||||
if (service && service.reloadColors) {
|
||||
console.log("MatugenManager: Triggering color reload");
|
||||
service.reloadColors();
|
||||
return true;
|
||||
} else {
|
||||
console.warn("MatugenManager: No service available for reload");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isAvailable() {
|
||||
return service !== null;
|
||||
}
|
||||
}
|
||||
315
modules/desktop/quickshell/qml/Data/Settings.qml
Normal file
315
modules/desktop/quickshell/qml/Data/Settings.qml
Normal file
@@ -0,0 +1,315 @@
|
||||
pragma Singleton
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import Quickshell.Io
|
||||
|
||||
Singleton {
|
||||
id: settings
|
||||
|
||||
// Prevent auto-saving during initial load
|
||||
property bool isLoading: true
|
||||
|
||||
// Settings persistence with atomic writes
|
||||
FileView {
|
||||
id: settingsFile
|
||||
path: "settings.json"
|
||||
blockWrites: true
|
||||
atomicWrites: true
|
||||
watchChanges: false
|
||||
|
||||
onLoaded: {
|
||||
settings.isLoading = true; // Disable auto-save during loading
|
||||
try {
|
||||
var content = JSON.parse(text());
|
||||
if (content) {
|
||||
// Load with fallback defaults
|
||||
settings.isDarkTheme = content.isDarkTheme ?? true;
|
||||
settings.currentTheme = content.currentTheme ?? (content.isDarkTheme !== false ? "oxocarbon_dark" : "oxocarbon_light");
|
||||
settings.useCustomAccent = content.useCustomAccent ?? false;
|
||||
settings.avatarSource = content.avatarSource ?? "/home/imxyy/Pictures/icon.jpg";
|
||||
settings.weatherLocation = content.weatherLocation ?? "Dinslaken";
|
||||
settings.useFahrenheit = content.useFahrenheit ?? false;
|
||||
settings.displayTime = content.displayTime ?? 6000;
|
||||
settings.videoPath = content.videoPath ?? "~/Videos/";
|
||||
settings.customDarkAccent = content.customDarkAccent ?? "#be95ff";
|
||||
settings.customLightAccent = content.customLightAccent ?? "#8a3ffc";
|
||||
settings.autoSwitchPlayer = content.autoSwitchPlayer ?? true;
|
||||
settings.alwaysShowPlayerDropdown = content.alwaysShowPlayerDropdown ?? true;
|
||||
settings.historyLimit = content.historyLimit ?? 25;
|
||||
settings.nightLightEnabled = content.nightLightEnabled ?? false;
|
||||
settings.nightLightWarmth = content.nightLightWarmth ?? 0.4;
|
||||
settings.nightLightAuto = content.nightLightAuto ?? false;
|
||||
settings.nightLightStartHour = content.nightLightStartHour ?? 20;
|
||||
settings.nightLightEndHour = content.nightLightEndHour ?? 6;
|
||||
settings.nightLightManualOverride = content.nightLightManualOverride ?? false;
|
||||
settings.nightLightManuallyEnabled = content.nightLightManuallyEnabled ?? false;
|
||||
settings.ignoredApps = content.ignoredApps ?? [];
|
||||
settings.workspaceBurstEnabled = content.workspaceBurstEnabled ?? true;
|
||||
settings.workspaceGlowEnabled = content.workspaceGlowEnabled ?? true;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Error parsing user settings:", e);
|
||||
}
|
||||
// Re-enable auto-save after loading is complete
|
||||
settings.isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
// User-configurable settings
|
||||
property string avatarSource: "/home/imxyy/Pictures/icon.jpg"
|
||||
property bool isDarkTheme: true // Keep for backwards compatibility
|
||||
property string currentTheme: "oxocarbon_dark" // New theme system
|
||||
property bool useCustomAccent: false // Whether to use custom accent colors
|
||||
property string weatherLocation: "Dinslaken"
|
||||
property bool useFahrenheit: false // Temperature unit setting
|
||||
property int displayTime: 6000 // Notification display time in ms
|
||||
property var ignoredApps: [] // Apps to ignore notifications from (case-insensitive)
|
||||
property int historyLimit: 25 // Notification history limit
|
||||
property string videoPath: "~/Videos/"
|
||||
property string customDarkAccent: "#be95ff"
|
||||
property string customLightAccent: "#8a3ffc"
|
||||
|
||||
// Music Player settings
|
||||
property bool autoSwitchPlayer: true
|
||||
property bool alwaysShowPlayerDropdown: true
|
||||
|
||||
// Night Light settings
|
||||
property bool nightLightEnabled: false
|
||||
property real nightLightWarmth: 0.4
|
||||
property bool nightLightAuto: false
|
||||
property int nightLightStartHour: 20 // 8 PM
|
||||
property int nightLightEndHour: 6 // 6 AM
|
||||
property bool nightLightManualOverride: false // Track manual user actions
|
||||
property bool nightLightManuallyEnabled: false // Track if user manually enabled it
|
||||
|
||||
// Animation settings
|
||||
property bool workspaceBurstEnabled: true
|
||||
property bool workspaceGlowEnabled: true
|
||||
|
||||
// UI constants
|
||||
readonly property real borderWidth: 9
|
||||
readonly property real cornerRadius: 20
|
||||
|
||||
signal settingsChanged
|
||||
|
||||
// Helper functions for managing ignored apps
|
||||
function addIgnoredApp(appName) {
|
||||
if (appName && appName.trim() !== "") {
|
||||
var trimmedName = appName.trim();
|
||||
// Case-insensitive check for existing apps
|
||||
var exists = false;
|
||||
for (var i = 0; i < ignoredApps.length; i++) {
|
||||
if (ignoredApps[i].toLowerCase() === trimmedName.toLowerCase()) {
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exists) {
|
||||
var newApps = ignoredApps.slice(); // Create a copy
|
||||
newApps.push(trimmedName);
|
||||
ignoredApps = newApps;
|
||||
console.log("Added ignored app:", trimmedName, "Current list:", ignoredApps);
|
||||
// Force save immediately (only if not loading)
|
||||
if (!isLoading) {
|
||||
saveSettings();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function removeIgnoredApp(appName) {
|
||||
var index = ignoredApps.indexOf(appName);
|
||||
if (index > -1) {
|
||||
var newApps = ignoredApps.slice(); // Create a copy
|
||||
newApps.splice(index, 1);
|
||||
ignoredApps = newApps;
|
||||
console.log("Removed ignored app:", appName, "Current list:", ignoredApps);
|
||||
// Force save immediately (only if not loading)
|
||||
if (!isLoading) {
|
||||
saveSettings();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
try {
|
||||
var content = {
|
||||
isDarkTheme: settings.isDarkTheme,
|
||||
currentTheme: settings.currentTheme,
|
||||
useCustomAccent: settings.useCustomAccent,
|
||||
avatarSource: settings.avatarSource,
|
||||
weatherLocation: settings.weatherLocation,
|
||||
useFahrenheit: settings.useFahrenheit,
|
||||
displayTime: settings.displayTime,
|
||||
videoPath: settings.videoPath,
|
||||
customDarkAccent: settings.customDarkAccent,
|
||||
customLightAccent: settings.customLightAccent,
|
||||
autoSwitchPlayer: settings.autoSwitchPlayer,
|
||||
alwaysShowPlayerDropdown: settings.alwaysShowPlayerDropdown,
|
||||
historyLimit: settings.historyLimit,
|
||||
nightLightEnabled: settings.nightLightEnabled,
|
||||
nightLightWarmth: settings.nightLightWarmth,
|
||||
nightLightAuto: settings.nightLightAuto,
|
||||
nightLightStartHour: settings.nightLightStartHour,
|
||||
nightLightEndHour: settings.nightLightEndHour,
|
||||
nightLightManualOverride: settings.nightLightManualOverride,
|
||||
nightLightManuallyEnabled: settings.nightLightManuallyEnabled,
|
||||
ignoredApps: settings.ignoredApps,
|
||||
workspaceBurstEnabled: settings.workspaceBurstEnabled,
|
||||
workspaceGlowEnabled: settings.workspaceGlowEnabled
|
||||
};
|
||||
var jsonContent = JSON.stringify(content, null, 4);
|
||||
settingsFile.setText(jsonContent);
|
||||
} catch (e) {
|
||||
console.log("Error saving user settings:", e);
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-save watchers (only save when not loading)
|
||||
onIsDarkThemeChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onCurrentThemeChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onUseCustomAccentChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onAvatarSourceChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onWeatherLocationChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onUseFahrenheitChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onDisplayTimeChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onHistoryLimitChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onVideoPathChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onCustomDarkAccentChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onCustomLightAccentChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onAutoSwitchPlayerChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onAlwaysShowPlayerDropdownChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onNightLightEnabledChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onNightLightWarmthChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onNightLightAutoChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onNightLightStartHourChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onNightLightEndHourChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onNightLightManualOverrideChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onNightLightManuallyEnabledChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onIgnoredAppsChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onWorkspaceBurstEnabledChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
onWorkspaceGlowEnabledChanged: {
|
||||
if (!isLoading) {
|
||||
settingsChanged();
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
settingsFile.reload();
|
||||
}
|
||||
}
|
||||
240
modules/desktop/quickshell/qml/Data/ThemeManager.qml
Normal file
240
modules/desktop/quickshell/qml/Data/ThemeManager.qml
Normal file
@@ -0,0 +1,240 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import "Themes" as Themes
|
||||
|
||||
Singleton {
|
||||
id: themeManager
|
||||
|
||||
// Import all theme definitions
|
||||
property var oxocarbon: Themes.Oxocarbon
|
||||
property var dracula: Themes.Dracula
|
||||
property var gruvbox: Themes.Gruvbox
|
||||
property var catppuccin: Themes.Catppuccin
|
||||
property var matugen: Themes.Matugen
|
||||
|
||||
// Available theme definitions
|
||||
readonly property var themes: ({
|
||||
"oxocarbon_dark": oxocarbon.dark,
|
||||
"oxocarbon_light": oxocarbon.light,
|
||||
"dracula_dark": dracula.dark,
|
||||
"dracula_light": dracula.light,
|
||||
"gruvbox_dark": gruvbox.dark,
|
||||
"gruvbox_light": gruvbox.light,
|
||||
"catppuccin_dark": catppuccin.dark,
|
||||
"catppuccin_light": catppuccin.light,
|
||||
"matugen_dark": matugen.dark,
|
||||
"matugen_light": matugen.light
|
||||
})
|
||||
|
||||
// Current theme selection - defaults to oxocarbon_dark if not set
|
||||
readonly property string currentThemeId: Settings.currentTheme || "oxocarbon_dark"
|
||||
readonly property var currentTheme: themes[currentThemeId] || themes["oxocarbon_dark"]
|
||||
|
||||
// Auto-update accents when Matugen colors change
|
||||
Connections {
|
||||
target: MatugenManager
|
||||
function onPrimaryChanged() {
|
||||
if (currentThemeId.startsWith("matugen_")) {
|
||||
updateMatugenAccents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Connect to MatugenService signals for automatic accent updates
|
||||
Connections {
|
||||
target: MatugenManager.service
|
||||
function onMatugenColorsUpdated() {
|
||||
if (currentThemeId.startsWith("matugen_")) {
|
||||
console.log("ThemeManager: Received matugen colors update signal");
|
||||
updateMatugenAccents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize currentTheme in settings if not present
|
||||
Component.onCompleted: {
|
||||
if (!Settings.currentTheme) {
|
||||
console.log("Initializing currentTheme in settings");
|
||||
Settings.currentTheme = "oxocarbon_dark";
|
||||
Settings.saveSettings();
|
||||
}
|
||||
|
||||
// Matugen theme is now self-contained with service-based colors
|
||||
console.log("Matugen theme initialized with service-based colors");
|
||||
|
||||
// Update accents if already using matugen theme
|
||||
if (currentThemeId.startsWith("matugen_")) {
|
||||
updateMatugenAccents();
|
||||
}
|
||||
}
|
||||
|
||||
// Custom accent colors (can be changed by user)
|
||||
property string customDarkAccent: Settings.customDarkAccent || "#be95ff"
|
||||
property string customLightAccent: Settings.customLightAccent || "#8a3ffc"
|
||||
|
||||
// Dynamic color properties based on current theme
|
||||
readonly property color base00: currentTheme.base00
|
||||
readonly property color base01: currentTheme.base01
|
||||
readonly property color base02: currentTheme.base02
|
||||
readonly property color base03: currentTheme.base03
|
||||
readonly property color base04: currentTheme.base04
|
||||
readonly property color base05: currentTheme.base05
|
||||
readonly property color base06: currentTheme.base06
|
||||
readonly property color base07: currentTheme.base07
|
||||
readonly property color base08: currentTheme.base08
|
||||
readonly property color base09: currentTheme.base09
|
||||
readonly property color base0A: currentTheme.base0A
|
||||
readonly property color base0B: currentTheme.base0B
|
||||
readonly property color base0C: currentTheme.base0C
|
||||
readonly property color base0D: currentTheme.base0D
|
||||
readonly property color base0E: Settings.useCustomAccent ? (currentTheme.type === "dark" ? customDarkAccent : customLightAccent) : currentTheme.base0E
|
||||
readonly property color base0F: currentTheme.base0F
|
||||
|
||||
// Common UI color mappings
|
||||
readonly property color bgColor: base00
|
||||
readonly property color bgLight: base01
|
||||
readonly property color bgLighter: base02
|
||||
readonly property color fgColor: base04
|
||||
readonly property color fgColorBright: base05
|
||||
readonly property color accentColor: base0E
|
||||
readonly property color accentColorBright: base0D
|
||||
readonly property color highlightBg: Qt.rgba(base0E.r, base0E.g, base0E.b, 0.15)
|
||||
readonly property color errorColor: base08
|
||||
readonly property color greenColor: base0B
|
||||
readonly property color redColor: base08
|
||||
|
||||
// Alternative semantic aliases for convenience
|
||||
readonly property color background: base00
|
||||
readonly property color panelBackground: base01
|
||||
readonly property color selection: base02
|
||||
readonly property color border: base03
|
||||
readonly property color secondaryText: base04
|
||||
readonly property color primaryText: base05
|
||||
readonly property color brightText: base06
|
||||
readonly property color brightestText: base07
|
||||
readonly property color error: base08
|
||||
readonly property color warning: base09
|
||||
readonly property color highlight: base0A
|
||||
readonly property color success: base0B
|
||||
readonly property color info: base0C
|
||||
readonly property color primary: base0D
|
||||
readonly property color accent: base0E
|
||||
readonly property color special: base0F
|
||||
|
||||
// UI styling constants
|
||||
readonly property real borderWidth: 9
|
||||
readonly property real cornerRadius: 20
|
||||
|
||||
// Color utility functions
|
||||
function withOpacity(color, opacity) {
|
||||
return Qt.rgba(color.r, color.g, color.b, opacity);
|
||||
}
|
||||
|
||||
function withHighlight(color) {
|
||||
return Qt.rgba(color.r, color.g, color.b, 0.15);
|
||||
}
|
||||
|
||||
// Theme management functions
|
||||
function setTheme(themeId) {
|
||||
if (themes[themeId]) {
|
||||
const previousThemeId = Settings.currentTheme;
|
||||
Settings.currentTheme = themeId;
|
||||
|
||||
// Check if switching between matugen light/dark modes
|
||||
if (themeId.startsWith("matugen_") && previousThemeId && previousThemeId.startsWith("matugen_")) {
|
||||
const newMode = themeId.includes("_light") ? "light" : "dark";
|
||||
const oldMode = previousThemeId.includes("_light") ? "light" : "dark";
|
||||
|
||||
if (newMode !== oldMode) {
|
||||
console.log(`🎨 Switching matugen from ${oldMode} to ${newMode} mode`);
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-update accents for Matugen themes
|
||||
if (themeId.startsWith("matugen_")) {
|
||||
updateMatugenAccents();
|
||||
}
|
||||
|
||||
Settings.saveSettings();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Auto-update accent colors when using Matugen theme
|
||||
function updateMatugenAccents() {
|
||||
if (MatugenManager.isAvailable() && MatugenManager.hasColors) {
|
||||
// Get colors from the raw matugen palette
|
||||
const rawColors = MatugenManager.rawColors;
|
||||
|
||||
// Use primary for both dark and light themes - it's generated appropriately by matugen
|
||||
const accent = rawColors.primary;
|
||||
|
||||
// Debug log the colors we're using
|
||||
console.log("Raw colors available:", Object.keys(rawColors));
|
||||
console.log("Selected accent for both themes:", accent);
|
||||
|
||||
// Update custom accents - use the same accent for both
|
||||
setCustomAccent(accent, accent);
|
||||
|
||||
// Enable custom accents for Matugen theme
|
||||
Settings.useCustomAccent = true;
|
||||
Settings.saveSettings();
|
||||
|
||||
console.log("Auto-updated Matugen accents from service:", accent);
|
||||
} else {
|
||||
console.log("MatugenManager service not available or no colors loaded yet");
|
||||
}
|
||||
}
|
||||
|
||||
function getThemeList() {
|
||||
return Object.keys(themes).map(function (key) {
|
||||
return {
|
||||
id: key,
|
||||
name: themes[key].name,
|
||||
type: themes[key].type
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function getDarkThemes() {
|
||||
return getThemeList().filter(function (theme) {
|
||||
return theme.type === "dark";
|
||||
});
|
||||
}
|
||||
|
||||
function getLightThemes() {
|
||||
return getThemeList().filter(function (theme) {
|
||||
return theme.type === "light";
|
||||
});
|
||||
}
|
||||
|
||||
function setCustomAccent(darkColor, lightColor) {
|
||||
customDarkAccent = darkColor;
|
||||
customLightAccent = lightColor;
|
||||
Settings.customDarkAccent = darkColor;
|
||||
Settings.customLightAccent = lightColor;
|
||||
Settings.saveSettings();
|
||||
}
|
||||
|
||||
function toggleCustomAccent() {
|
||||
Settings.useCustomAccent = !Settings.useCustomAccent;
|
||||
Settings.saveSettings();
|
||||
}
|
||||
|
||||
// Legacy function for backwards compatibility
|
||||
function toggleTheme() {
|
||||
// Switch between dark and light variants of current theme family
|
||||
var currentFamily = currentThemeId.replace(/_dark|_light/, "");
|
||||
var newThemeId = currentTheme.type === "dark" ? currentFamily + "_light" : currentFamily + "_dark";
|
||||
|
||||
// If the opposite variant doesn't exist, switch to oxocarbon
|
||||
if (!themes[newThemeId]) {
|
||||
newThemeId = currentTheme.type === "dark" ? "oxocarbon_light" : "oxocarbon_dark";
|
||||
}
|
||||
|
||||
setTheme(newThemeId);
|
||||
}
|
||||
}
|
||||
76
modules/desktop/quickshell/qml/Data/Themes/Catppuccin.qml
Normal file
76
modules/desktop/quickshell/qml/Data/Themes/Catppuccin.qml
Normal file
@@ -0,0 +1,76 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
readonly property var dark: ({
|
||||
name: "Catppuccin Mocha",
|
||||
type: "dark",
|
||||
base00: "#1e1e2e" // Base
|
||||
,
|
||||
base01: "#181825" // Mantle
|
||||
,
|
||||
base02: "#313244" // Surface0
|
||||
,
|
||||
base03: "#45475a" // Surface1
|
||||
,
|
||||
base04: "#585b70" // Surface2
|
||||
,
|
||||
base05: "#cdd6f4" // Text
|
||||
,
|
||||
base06: "#f5e0dc" // Rosewater
|
||||
,
|
||||
base07: "#b4befe" // Lavender
|
||||
,
|
||||
base08: "#f38ba8" // Red
|
||||
,
|
||||
base09: "#fab387" // Peach
|
||||
,
|
||||
base0A: "#f9e2af" // Yellow
|
||||
,
|
||||
base0B: "#a6e3a1" // Green
|
||||
,
|
||||
base0C: "#94e2d5" // Teal
|
||||
,
|
||||
base0D: "#89b4fa" // Blue
|
||||
,
|
||||
base0E: "#cba6f7" // Mauve
|
||||
,
|
||||
base0F: "#f2cdcd" // Flamingo
|
||||
})
|
||||
|
||||
readonly property var light: ({
|
||||
name: "Catppuccin Latte",
|
||||
type: "light",
|
||||
base00: "#eff1f5" // Base
|
||||
,
|
||||
base01: "#e6e9ef" // Mantle
|
||||
,
|
||||
base02: "#ccd0da" // Surface0
|
||||
,
|
||||
base03: "#bcc0cc" // Surface1
|
||||
,
|
||||
base04: "#acb0be" // Surface2
|
||||
,
|
||||
base05: "#4c4f69" // Text
|
||||
,
|
||||
base06: "#dc8a78" // Rosewater
|
||||
,
|
||||
base07: "#7287fd" // Lavender
|
||||
,
|
||||
base08: "#d20f39" // Red
|
||||
,
|
||||
base09: "#fe640b" // Peach
|
||||
,
|
||||
base0A: "#df8e1d" // Yellow
|
||||
,
|
||||
base0B: "#40a02b" // Green
|
||||
,
|
||||
base0C: "#179299" // Teal
|
||||
,
|
||||
base0D: "#1e66f5" // Blue
|
||||
,
|
||||
base0E: "#8839ef" // Mauve
|
||||
,
|
||||
base0F: "#dd7878" // Flamingo
|
||||
})
|
||||
}
|
||||
76
modules/desktop/quickshell/qml/Data/Themes/Dracula.qml
Normal file
76
modules/desktop/quickshell/qml/Data/Themes/Dracula.qml
Normal file
@@ -0,0 +1,76 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
readonly property var dark: ({
|
||||
name: "Dracula",
|
||||
type: "dark",
|
||||
base00: "#282a36" // Background
|
||||
,
|
||||
base01: "#44475a" // Current line
|
||||
,
|
||||
base02: "#565761" // Selection
|
||||
,
|
||||
base03: "#6272a4" // Comment
|
||||
,
|
||||
base04: "#6272a4" // Dark foreground
|
||||
,
|
||||
base05: "#f8f8f2" // Foreground
|
||||
,
|
||||
base06: "#f8f8f2" // Light foreground
|
||||
,
|
||||
base07: "#ffffff" // Light background
|
||||
,
|
||||
base08: "#ff5555" // Red
|
||||
,
|
||||
base09: "#ffb86c" // Orange
|
||||
,
|
||||
base0A: "#f1fa8c" // Yellow
|
||||
,
|
||||
base0B: "#50fa7b" // Green
|
||||
,
|
||||
base0C: "#8be9fd" // Cyan
|
||||
,
|
||||
base0D: "#bd93f9" // Blue
|
||||
,
|
||||
base0E: "#ff79c6" // Magenta
|
||||
,
|
||||
base0F: "#ffb86c" // Orange
|
||||
})
|
||||
|
||||
readonly property var light: ({
|
||||
name: "Dracula Light",
|
||||
type: "light",
|
||||
base00: "#f8f8f2" // Light background
|
||||
,
|
||||
base01: "#ffffff" // Lighter background
|
||||
,
|
||||
base02: "#e5e5e5" // Selection
|
||||
,
|
||||
base03: "#bfbfbf" // Comment
|
||||
,
|
||||
base04: "#6272a4" // Dark foreground
|
||||
,
|
||||
base05: "#282a36" // Dark text
|
||||
,
|
||||
base06: "#21222c" // Darker text
|
||||
,
|
||||
base07: "#191a21" // Darkest
|
||||
,
|
||||
base08: "#e74c3c" // Red (adjusted for light)
|
||||
,
|
||||
base09: "#f39c12" // Orange
|
||||
,
|
||||
base0A: "#f1c40f" // Yellow
|
||||
,
|
||||
base0B: "#27ae60" // Green
|
||||
,
|
||||
base0C: "#17a2b8" // Cyan
|
||||
,
|
||||
base0D: "#6c7ce0" // Blue
|
||||
,
|
||||
base0E: "#e91e63" // Magenta
|
||||
,
|
||||
base0F: "#f39c12" // Orange
|
||||
})
|
||||
}
|
||||
76
modules/desktop/quickshell/qml/Data/Themes/Gruvbox.qml
Normal file
76
modules/desktop/quickshell/qml/Data/Themes/Gruvbox.qml
Normal file
@@ -0,0 +1,76 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
readonly property var dark: ({
|
||||
name: "Gruvbox Dark",
|
||||
type: "dark",
|
||||
base00: "#282828" // Dark background
|
||||
,
|
||||
base01: "#3c3836" // Dark1
|
||||
,
|
||||
base02: "#504945" // Dark2
|
||||
,
|
||||
base03: "#665c54" // Dark3
|
||||
,
|
||||
base04: "#bdae93" // Light4
|
||||
,
|
||||
base05: "#d5c4a1" // Light3
|
||||
,
|
||||
base06: "#ebdbb2" // Light2
|
||||
,
|
||||
base07: "#fbf1c7" // Light1
|
||||
,
|
||||
base08: "#fb4934" // Red
|
||||
,
|
||||
base09: "#fe8019" // Orange
|
||||
,
|
||||
base0A: "#fabd2f" // Yellow
|
||||
,
|
||||
base0B: "#b8bb26" // Green
|
||||
,
|
||||
base0C: "#8ec07c" // Cyan
|
||||
,
|
||||
base0D: "#83a598" // Blue
|
||||
,
|
||||
base0E: "#d3869b" // Purple
|
||||
,
|
||||
base0F: "#d65d0e" // Brown
|
||||
})
|
||||
|
||||
readonly property var light: ({
|
||||
name: "Gruvbox Light",
|
||||
type: "light",
|
||||
base00: "#fbf1c7" // Light background
|
||||
,
|
||||
base01: "#ebdbb2" // Light1
|
||||
,
|
||||
base02: "#d5c4a1" // Light2
|
||||
,
|
||||
base03: "#bdae93" // Light3
|
||||
,
|
||||
base04: "#665c54" // Dark3
|
||||
,
|
||||
base05: "#504945" // Dark2
|
||||
,
|
||||
base06: "#3c3836" // Dark1
|
||||
,
|
||||
base07: "#282828" // Dark background
|
||||
,
|
||||
base08: "#cc241d" // Red
|
||||
,
|
||||
base09: "#d65d0e" // Orange
|
||||
,
|
||||
base0A: "#d79921" // Yellow
|
||||
,
|
||||
base0B: "#98971a" // Green
|
||||
,
|
||||
base0C: "#689d6a" // Cyan
|
||||
,
|
||||
base0D: "#458588" // Blue
|
||||
,
|
||||
base0E: "#b16286" // Purple
|
||||
,
|
||||
base0F: "#d65d0e" // Brown
|
||||
})
|
||||
}
|
||||
141
modules/desktop/quickshell/qml/Data/Themes/Matugen.qml
Normal file
141
modules/desktop/quickshell/qml/Data/Themes/Matugen.qml
Normal file
@@ -0,0 +1,141 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
// Reference to the MatugenService
|
||||
property var matugenService: null
|
||||
|
||||
// Debug helper to check service status
|
||||
function debugServiceStatus() {
|
||||
console.log("🔍 Debug: matugenService =", matugenService);
|
||||
console.log("🔍 Debug: matugenService.isLoaded =", matugenService ? matugenService.isLoaded : "N/A");
|
||||
console.log("🔍 Debug: matugenService.colorVersion =", matugenService ? matugenService.colorVersion : "N/A");
|
||||
console.log("🔍 Debug: condition result =", (matugenService && matugenService.isLoaded && matugenService.colorVersion >= 0));
|
||||
if (matugenService && matugenService.colors) {
|
||||
console.log("🔍 Debug: service.colors.dark =", JSON.stringify(matugenService.colors.dark));
|
||||
}
|
||||
}
|
||||
|
||||
// Map matugen colors to base16 scheme - using the service when available
|
||||
// The colorVersion dependency forces re-evaluation when colors update
|
||||
readonly property var dark: {
|
||||
debugServiceStatus();
|
||||
if (matugenService && matugenService.isLoaded && matugenService.colorVersion >= 0) {
|
||||
// Use service colors if available, or generate fallback if we have light colors
|
||||
return matugenService.colors.dark || {
|
||||
name: "Matugen Dark (Generated from Light)",
|
||||
type: "dark",
|
||||
// If we only have light colors, create dark fallback
|
||||
base00: "#141311",
|
||||
base01: "#1c1c19",
|
||||
base02: "#20201d",
|
||||
base03: "#2a2a27",
|
||||
base04: "#c9c7ba",
|
||||
base05: "#e5e2de",
|
||||
base06: "#31302e",
|
||||
base07: "#e5e2de",
|
||||
base08: "#ffb4ab",
|
||||
base09: "#b5ccb9",
|
||||
base0A: "#e4e5c1",
|
||||
base0B: "#c8c7b7",
|
||||
base0C: "#c8c9a6",
|
||||
base0D: "#c8c9a6",
|
||||
base0E: "#47483b",
|
||||
base0F: "#000000"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
name: "Matugen Dark",
|
||||
type: "dark",
|
||||
// Updated fallback colors to match current quickshell-colors.qml
|
||||
base00: "#141311",
|
||||
base01: "#1c1c19",
|
||||
base02: "#20201d",
|
||||
base03: "#2a2a27",
|
||||
base04: "#c9c7ba",
|
||||
base05: "#e5e2de",
|
||||
base06: "#31302e",
|
||||
base07: "#e5e2de",
|
||||
base08: "#ffb4ab",
|
||||
base09: "#b5ccb9",
|
||||
base0A: "#e4e5c1",
|
||||
base0B: "#c8c7b7",
|
||||
base0C: "#c8c9a6",
|
||||
base0D: "#c8c9a6",
|
||||
base0E: "#47483b",
|
||||
base0F: "#000000"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
readonly property var light: {
|
||||
if (matugenService && matugenService.isLoaded && matugenService.colorVersion >= 0) {
|
||||
// Use service colors if available, or generate fallback if we have dark colors
|
||||
return matugenService.colors.light || {
|
||||
name: "Matugen Light (Generated from Dark)",
|
||||
type: "light",
|
||||
// If we only have dark colors, create light fallback
|
||||
base00: "#ffffff",
|
||||
base01: "#f5f5f5",
|
||||
base02: "#e8e8e8",
|
||||
base03: "#d0d0d0",
|
||||
base04: "#666666",
|
||||
base05: "#1a1a1a",
|
||||
base06: "#000000",
|
||||
base07: "#ffffff",
|
||||
base08: "#d32f2f",
|
||||
base09: "#7b1fa2",
|
||||
base0A: "#f57c00",
|
||||
base0B: "#388e3c",
|
||||
base0C: "#0097a7",
|
||||
base0D: "#1976d2",
|
||||
base0E: "#5e35b1",
|
||||
base0F: "#000000"
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
name: "Matugen Light",
|
||||
type: "light",
|
||||
// Updated fallback colors based on current colors
|
||||
base00: "#ffffff",
|
||||
base01: "#f5f5f5",
|
||||
base02: "#e8e8e8",
|
||||
base03: "#d0d0d0",
|
||||
base04: "#666666",
|
||||
base05: "#1a1a1a",
|
||||
base06: "#000000",
|
||||
base07: "#ffffff",
|
||||
base08: "#d32f2f",
|
||||
base09: "#7b1fa2",
|
||||
base0A: "#f57c00",
|
||||
base0B: "#388e3c",
|
||||
base0C: "#0097a7",
|
||||
base0D: "#1976d2",
|
||||
base0E: "#5e35b1",
|
||||
base0F: "#000000"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Direct access to primary colors for accent updates
|
||||
readonly property color primary: (matugenService && matugenService.getColor && matugenService.colorVersion >= 0) ? matugenService.getColor("primary") || "#c8c9a6" : "#c8c9a6"
|
||||
readonly property color on_primary: (matugenService && matugenService.getColor && matugenService.colorVersion >= 0) ? matugenService.getColor("on_primary") || "#303219" : "#303219"
|
||||
|
||||
// Function to set the service reference
|
||||
function setMatugenService(service) {
|
||||
matugenService = service;
|
||||
console.log("🔌 MatugenService connected to theme:", service);
|
||||
|
||||
// Connect to service signals for automatic updates
|
||||
if (service) {
|
||||
service.matugenColorsUpdated.connect(function () {
|
||||
console.log("🎨 Matugen colors updated in theme (version " + service.colorVersion + ")");
|
||||
debugServiceStatus();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("Matugen theme loaded, waiting for MatugenService connection");
|
||||
}
|
||||
}
|
||||
76
modules/desktop/quickshell/qml/Data/Themes/Oxocarbon.qml
Normal file
76
modules/desktop/quickshell/qml/Data/Themes/Oxocarbon.qml
Normal file
@@ -0,0 +1,76 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
readonly property var dark: ({
|
||||
name: "Oxocarbon Dark",
|
||||
type: "dark",
|
||||
base00: "#161616" // OLED-friendly background
|
||||
,
|
||||
base01: "#262626" // Surface 1
|
||||
,
|
||||
base02: "#393939" // Surface 2
|
||||
,
|
||||
base03: "#525252" // Surface 3
|
||||
,
|
||||
base04: "#6f6f6f" // Text secondary
|
||||
,
|
||||
base05: "#c6c6c6" // Text primary
|
||||
,
|
||||
base06: "#e0e0e0" // Text on color
|
||||
,
|
||||
base07: "#f4f4f4" // Text inverse
|
||||
,
|
||||
base08: "#ff7eb6" // Red (pink)
|
||||
,
|
||||
base09: "#ee5396" // Magenta
|
||||
,
|
||||
base0A: "#42be65" // Green
|
||||
,
|
||||
base0B: "#be95ff" // Purple
|
||||
,
|
||||
base0C: "#3ddbd9" // Cyan
|
||||
,
|
||||
base0D: "#78a9ff" // Blue
|
||||
,
|
||||
base0E: "#be95ff" // Purple (accent)
|
||||
,
|
||||
base0F: "#08bdba" // Teal
|
||||
})
|
||||
|
||||
readonly property var light: ({
|
||||
name: "Oxocarbon Light",
|
||||
type: "light",
|
||||
base00: "#f4f4f4" // Light background
|
||||
,
|
||||
base01: "#ffffff" // Surface 1
|
||||
,
|
||||
base02: "#e0e0e0" // Surface 2
|
||||
,
|
||||
base03: "#c6c6c6" // Surface 3
|
||||
,
|
||||
base04: "#525252" // Text secondary
|
||||
,
|
||||
base05: "#262626" // Text primary
|
||||
,
|
||||
base06: "#161616" // Text on color
|
||||
,
|
||||
base07: "#000000" // Text inverse
|
||||
,
|
||||
base08: "#da1e28" // Red
|
||||
,
|
||||
base09: "#d12771" // Magenta
|
||||
,
|
||||
base0A: "#198038" // Green
|
||||
,
|
||||
base0B: "#8a3ffc" // Purple
|
||||
,
|
||||
base0C: "#007d79" // Cyan
|
||||
,
|
||||
base0D: "#0f62fe" // Blue
|
||||
,
|
||||
base0E: "#8a3ffc" // Purple (accent)
|
||||
,
|
||||
base0F: "#005d5d" // Teal
|
||||
})
|
||||
}
|
||||
60
modules/desktop/quickshell/qml/Data/quickshell-colors.qml
Normal file
60
modules/desktop/quickshell/qml/Data/quickshell-colors.qml
Normal file
@@ -0,0 +1,60 @@
|
||||
pragma Singleton
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
readonly property color background: "#13140c"
|
||||
readonly property color error: "#ffb4ab"
|
||||
readonly property color error_container: "#93000a"
|
||||
readonly property color inverse_on_surface: "#313128"
|
||||
readonly property color inverse_primary: "#5d631c"
|
||||
readonly property color inverse_surface: "#e5e3d6"
|
||||
readonly property color on_background: "#e5e3d6"
|
||||
readonly property color on_error: "#690005"
|
||||
readonly property color on_error_container: "#ffdad6"
|
||||
readonly property color on_primary: "#2f3300"
|
||||
readonly property color on_primary_container: "#e2e993"
|
||||
readonly property color on_primary_fixed: "#1b1d00"
|
||||
readonly property color on_primary_fixed_variant: "#454b03"
|
||||
readonly property color on_secondary: "#30321a"
|
||||
readonly property color on_secondary_container: "#e4e5c1"
|
||||
readonly property color on_secondary_fixed: "#1b1d07"
|
||||
readonly property color on_secondary_fixed_variant: "#47492e"
|
||||
readonly property color on_surface: "#e5e3d6"
|
||||
readonly property color on_surface_variant: "#c8c7b7"
|
||||
readonly property color on_tertiary: "#07372c"
|
||||
readonly property color on_tertiary_container: "#beecdc"
|
||||
readonly property color on_tertiary_fixed: "#002019"
|
||||
readonly property color on_tertiary_fixed_variant: "#234e42"
|
||||
readonly property color outline: "#929182"
|
||||
readonly property color outline_variant: "#47483b"
|
||||
readonly property color primary: "#c5cc7a"
|
||||
readonly property color primary_container: "#454b03"
|
||||
readonly property color primary_fixed: "#e2e993"
|
||||
readonly property color primary_fixed_dim: "#c5cc7a"
|
||||
readonly property color scrim: "#000000"
|
||||
readonly property color secondary: "#c8c9a6"
|
||||
readonly property color secondary_container: "#47492e"
|
||||
readonly property color secondary_fixed: "#e4e5c1"
|
||||
readonly property color secondary_fixed_dim: "#c8c9a6"
|
||||
readonly property color shadow: "#000000"
|
||||
readonly property color surface: "#13140c"
|
||||
readonly property color surface_bright: "#3a3a31"
|
||||
readonly property color surface_container: "#202018"
|
||||
readonly property color surface_container_high: "#2a2a22"
|
||||
readonly property color surface_container_highest: "#35352c"
|
||||
readonly property color surface_container_low: "#1c1c14"
|
||||
readonly property color surface_container_lowest: "#0e0f08"
|
||||
readonly property color surface_dim: "#13140c"
|
||||
readonly property color surface_tint: "#c5cc7a"
|
||||
|
||||
readonly property color surface_variant: "#47483b"
|
||||
readonly property color tertiary: "#a3d0c0"
|
||||
readonly property color tertiary_container: "#234e42"
|
||||
readonly property color tertiary_fixed: "#beecdc"
|
||||
readonly property color tertiary_fixed_dim: "#a3d0c0"
|
||||
|
||||
function withAlpha(color: color, alpha: real): color {
|
||||
return Qt.rgba(color.r, color.g, color.b, alpha);
|
||||
}
|
||||
}
|
||||
7
modules/desktop/quickshell/qml/Data/settings.json
Normal file
7
modules/desktop/quickshell/qml/Data/settings.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"isDarkTheme": true,
|
||||
"avatarSource": "/home/imxyy/Pictures/icon.jpg",
|
||||
"weatherLocation": "Dinslaken",
|
||||
"displayTime": 6000,
|
||||
"videoPath": "~/Videos/"
|
||||
}
|
||||
Reference in New Issue
Block a user