diff --git a/Assets/Matugen/Matugen.qml b/Assets/Matugen/Matugen.qml index 0385b32..b6e2d2c 100644 --- a/Assets/Matugen/Matugen.qml +++ b/Assets/Matugen/Matugen.qml @@ -46,6 +46,12 @@ Singleton { lines.push('output_path = "~/.config/kitty/themes/noctalia.conf"') lines.push("post_hook = 'kitty +kitten themes --reload-in=all noctalia'") } + if (Settings.data.matugen.ghostty) { + lines.push("\n[templates.ghostty]") + lines.push('input_path = "' + Quickshell.shellDir + '/Assets/Matugen/templates/ghostty.conf"') + lines.push('output_path = "~/.config/ghostty/themes/noctalia"') + lines.push("post_hook = \"grep -q '^theme *= *' ~/.config/ghostty/config; and sed -i 's/^theme *= *.*/theme = noctalia/' ~/.config/ghostty/config; or echo 'theme = noctalia' >> ~/.config/ghostty/config\"") + } return lines.join("\n") + "\n" } diff --git a/Assets/Matugen/templates/ghostty.conf b/Assets/Matugen/templates/ghostty.conf new file mode 100644 index 0000000..ca3d662 --- /dev/null +++ b/Assets/Matugen/templates/ghostty.conf @@ -0,0 +1,23 @@ +palette = 0={{colors.surface.default.hex}} +palette = 1={{colors.error.default.hex}} +palette = 2={{colors.tertiary.default.hex}} +palette = 3={{colors.secondary.default.hex}} +palette = 4={{colors.primary.default.hex}} +palette = 5={{colors.primary.default.hex}} +palette = 6={{colors.secondary.default.hex}} +palette = 7={{colors.on_background.default.hex}} +palette = 8={{colors.outline.default.hex}} +palette = 9={{colors.secondary_fixed_dim.default.hex}} +palette = 10={{colors.tertiary_container.default.hex}} +palette = 11={{colors.surface_container.default.hex}} +palette = 12={{colors.primary_container.default.hex}} +palette = 13={{colors.on_primary_container.default.hex}} +palette = 14={{colors.surface_variant.default.hex}} +palette = 15={{colors.on_background.default.hex}} + +cursor-color = {{colors.primary.default.hex}} +cursor-text = {{colors.on_surface.default.hex}} +foreground = {{colors.on_surface.default.hex}} +background = {{colors.surface.default.hex}} +selection-foreground = {{colors.on_secondary.default.hex}} +selection-background = {{colors.secondary_fixed_dim.default.hex}} diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 8f8c65f..df47f95 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -266,6 +266,7 @@ Singleton { property bool qt6: false property bool qt5: false property bool kitty: false + property bool ghostty: false } // night light diff --git a/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml b/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml index ee2f739..5cde84d 100644 --- a/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml +++ b/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml @@ -418,5 +418,16 @@ ColumnLayout { MatugenService.generateFromWallpaper() } } + + NCheckbox { + label: "Ghostty" + description: "Write ~/.config/ghostty/themes/noctalia and reload" + checked: Settings.data.matugen.ghostty + onToggled: checked => { + Settings.data.matugen.ghostty = checked + if (Settings.data.colorSchemes.useWallpaperColors) + MatugenService.generateFromWallpaper() + } + } } }