ColorTemplates: rename to MatugenTemplates

Autoformat
This commit is contained in:
Ly-sec
2025-10-03 23:57:51 +02:00
parent 515f7565fd
commit d8c373ce31
13 changed files with 36 additions and 34 deletions
+4 -4
View File
@@ -24,7 +24,7 @@ ColumnLayout {
var pathParts = schemePath.split("/")
var filename = pathParts[pathParts.length - 1] // Get filename
var schemeName = filename.replace(".json", "") // Remove .json extension
// Convert folder names back to display names
if (schemeName === "Noctalia-default") {
schemeName = "Noctalia (default)"
@@ -33,7 +33,7 @@ ColumnLayout {
} else if (schemeName === "Tokyo-Night") {
schemeName = "Tokyo Night"
}
return schemeName
}
@@ -112,7 +112,7 @@ ColumnLayout {
onLoaded: {
// Extract scheme name from path
var schemeName = extractSchemeName(path)
try {
var jsonData = JSON.parse(text())
root.schemeLoaded(schemeName, jsonData)
@@ -418,7 +418,7 @@ ColumnLayout {
color: Color.mOnSurface
Layout.fillWidth: true
Layout.maximumWidth: 100 * scaling
Layout.preferredHeight: 40 * scaling // Fixed height for consistent alignment
Layout.preferredHeight: 40 * scaling // Fixed height for consistent alignment
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
+4 -4
View File
@@ -94,11 +94,11 @@ Singleton {
Process {
id: findProcess
running: false
onExited: function(exitCode) {
onExited: function (exitCode) {
if (exitCode === 0) {
var output = stdout.text.trim()
var files = output.split('\n').filter(function(line) {
var files = output.split('\n').filter(function (line) {
return line.length > 0
})
schemes = files
@@ -121,7 +121,7 @@ Singleton {
scanning = false
}
}
stdout: StdioCollector {}
stderr: StdioCollector {}
}
+16 -14
View File
@@ -10,11 +10,10 @@ import "../Helpers/ColorVariants.js" as ColorVariants
Singleton {
id: root
readonly property string colorsApplyScript: Quickshell.shellDir + '/Bin/colors-apply.sh';
readonly property string colorsApplyScript: Quickshell.shellDir + '/Bin/colors-apply.sh'
property string dynamicConfigPath: Settings.cacheDir + "matugen.dynamic.toml"
// External state management
Connections {
target: WallpaperService
@@ -421,26 +420,29 @@ Singleton {
// For terminals simply copy the full color from theme from iTerm2 so everything looks super nice!
var copyCmd = ""
if (Settings.data.templates.foot) {
if (copyCmd !== "") copyCmd += " ; "
copyCmd += `cp -f ${getTerminalColorsTemplate('foot')} ~/.config/foot/themes/noctalia`;
if (copyCmd !== "")
copyCmd += " ; "
copyCmd += `cp -f ${getTerminalColorsTemplate('foot')} ~/.config/foot/themes/noctalia`
copyCmd += ` ; ${colorsApplyScript} foot`
}
if (Settings.data.templates.ghostty) {
if (copyCmd !== "") copyCmd += " ; "
copyCmd += `cp -f ${getTerminalColorsTemplate('ghostty')} ~/.config/ghostty/themes/noctalia`;
if (copyCmd !== "")
copyCmd += " ; "
copyCmd += `cp -f ${getTerminalColorsTemplate('ghostty')} ~/.config/ghostty/themes/noctalia`
copyCmd += ` ; ${colorsApplyScript} ghostty`
}
if (Settings.data.templates.kitty) {
if (copyCmd !== "") copyCmd += " ; "
copyCmd += `cp -f ${getTerminalColorsTemplate('kitty')}.conf ~/.config/kitty/themes/noctalia.conf`;
if (copyCmd !== "")
copyCmd += " ; "
copyCmd += `cp -f ${getTerminalColorsTemplate('kitty')}.conf ~/.config/kitty/themes/noctalia.conf`
copyCmd += ` ; ${colorsApplyScript} kitty`
}
// Finally execute all copies at once.
if (copyCmd !== "") {
//console.log(copyCmd)
//console.log(copyCmd)
copyProcess.command = ["bash", "-lc", copyCmd]
copyProcess.running = true
}
@@ -448,9 +450,9 @@ Singleton {
// --------------------------------
function getTerminalColorsTemplate(terminal) {
var colorScheme = Settings.data.colorSchemes.predefinedScheme;
const darkLight = Settings.data.colorSchemes.darkMode ? 'dark' : 'light';
var colorScheme = Settings.data.colorSchemes.predefinedScheme
const darkLight = Settings.data.colorSchemes.darkMode ? 'dark' : 'light'
// Convert display names back to folder names
if (colorScheme === "Noctalia (default)") {
colorScheme = "Noctalia-default"
@@ -459,7 +461,7 @@ Singleton {
} else if (colorScheme === "Tokyo Night") {
colorScheme = "Tokyo-Night"
}
return `${Quickshell.shellDir}/Assets/ColorScheme/${colorScheme}/terminal/${terminal}/${colorScheme}-${darkLight}`
}
+12 -12
View File
@@ -6,7 +6,7 @@ import qs.Commons
// Central place to define which templates we generate and where they write.
// Users can extend it by dropping additional templates into:
// - Assets/ColorTemplates/Matugen/
// - Assets/MatugenTemplates/Matugen/
// - ~/.config/matugen/ (when enableUserTemplates is true)
Singleton {
id: root
@@ -20,28 +20,28 @@ Singleton {
// Only generate colors for Noctalia if the colors are wallpaper based
// or this will conflict with our predefined colors
lines.push("[templates.noctalia]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/noctalia.json"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/noctalia.json"')
lines.push('output_path = "' + Settings.configDir + 'colors.json"')
// Only generate colors for terminalk if the colors are wallpaper based
// predefined color schemes use a different approach for better result
if (Settings.data.templates.foot) {
lines.push("\n[templates.foot]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/Terminal/foot"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/Terminal/foot"')
lines.push('output_path = "~/.config/foot/themes/noctalia"')
lines.push(`post_hook = "${MatugenService.colorsApplyScript} foot"`)
}
if (Settings.data.templates.ghostty) {
lines.push("\n[templates.ghostty]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/Terminal/ghostty"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/Terminal/ghostty"')
lines.push('output_path = "~/.config/ghostty/themes/noctalia"')
lines.push(`post_hook = "${MatugenService.colorsApplyScript} ghostty"`)
}
if (Settings.data.templates.kitty) {
lines.push("\n[templates.kitty]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/Terminal/kitty.conf"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/Terminal/kitty.conf"')
lines.push('output_path = "~/.config/kitty/themes/noctalia.conf"')
lines.push(`post_hook = "${MatugenService.colorsApplyScript} kitty"`)
}
@@ -49,41 +49,41 @@ Singleton {
if (Settings.data.templates.gtk) {
lines.push("\n[templates.gtk3]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/gtk.css"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/gtk.css"')
lines.push('output_path = "~/.config/gtk-3.0/gtk.css"')
lines.push("\n[templates.gtk4]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/gtk.css"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/gtk.css"')
lines.push('output_path = "~/.config/gtk-4.0/gtk.css"')
}
if (Settings.data.templates.qt) {
lines.push("\n[templates.qt5]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/qtct.conf"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/qtct.conf"')
lines.push('output_path = "~/.config/qt5ct/colors/noctalia.conf"')
lines.push("\n[templates.qt6]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/qtct.conf"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/qtct.conf"')
lines.push('output_path = "~/.config/qt6ct/colors/noctalia.conf"')
}
if (Settings.data.templates.fuzzel) {
lines.push("\n[templates.fuzzel]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/fuzzel.conf"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/fuzzel.conf"')
lines.push('output_path = "~/.config/fuzzel/themes/noctalia"')
lines.push(`post_hook = "${MatugenService.colorsApplyScript} fuzzel"`)
}
if (Settings.data.templates.pywalfox) {
lines.push("\n[templates.pywalfox]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/pywalfox.json"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/pywalfox.json"')
lines.push('output_path = "~/.cache/wal/colors.json"')
lines.push(`post_hook = "${MatugenService.colorsApplyScript} pywalfox"`)
}
if (Settings.data.templates.vesktop) {
lines.push("\n[templates.vesktop]")
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/ColorTemplates/Matugen/vesktop.css"')
lines.push('input_path = "' + Quickshell.shellDir + '/Assets/MatugenTemplates/Matugen/vesktop.css"')
lines.push('output_path = "~/.config/vesktop/themes/noctalia.theme.css"')
}