Skip to content

Commit 480c856

Browse files
committed
Remove GTK styling support
1 parent 57e3017 commit 480c856

22 files changed

Lines changed: 693 additions & 401 deletions

File tree

‎app.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ func newSeededState() *theme.ThemeState {
111111
func (a *App) startup(ctx context.Context) {
112112
a.ctx = ctx
113113
_ = platform.EnsureAllDirs()
114+
if err := theme.RetireLegacyGTKStylesheets(); err != nil {
115+
log.Printf("retire legacy GTK stylesheets: %v", err)
116+
}
114117
if err := installDefaultWallpapers(); err != nil {
115118
log.Printf("install default wallpapers: %v", err)
116119
}
@@ -889,7 +892,7 @@ type ExportThemeRequest struct {
889892
// allExportableApps is the full set of app names that can be exported.
890893
var allExportableApps = map[string]bool{
891894
"alacritty": true, "btop": true, "chromium": true, "colors": true,
892-
"foot": true, "ghostty": true, "gtk": true, "hyprland": true, "hyprlock": true,
895+
"foot": true, "ghostty": true, "hyprland": true, "hyprlock": true,
893896
"icons": true, "kitty": true, "mako": true, "neovim": true,
894897
"swayosd": true, "vencord": true, "vscode": true, "walker": true,
895898
"warp": true, "waybar": true, "wofi": true, "zed": true,
@@ -946,7 +949,6 @@ func (a *App) ExportTheme(req ExportThemeRequest) (string, error) {
946949
}
947950

948951
settings := theme.Settings{
949-
IncludeGtk: included["gtk"],
950952
IncludeZed: included["zed"],
951953
IncludeVscode: included["vscode"],
952954
IncludeNeovim: included["neovim"],

‎cli/cli.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ Theme generation:
133133
--light-mode Generate light variant
134134
--no-apply Render templates without activating
135135
--output <path> Output dir (defaults to ~/.config/aether/theme)
136-
--gtk Also render and install GTK CSS (default off)
137136
--no-zed Skip Zed extension (default on)
138137
--no-vscode Skip VSCode integration (default on)
139138
--no-neovim Skip Neovim template (default on)

‎cli/generate.go‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ import (
1010
)
1111

1212
func runGenerate(args []string, templatesFS embed.FS) int {
13+
for _, arg := range args {
14+
if arg == "--gtk" || arg == "--no-gtk" {
15+
fmt.Fprintf(os.Stderr, "Error: Unknown option: %s\n", arg)
16+
return 1
17+
}
18+
}
19+
1320
// Parse flags
1421
mode, args := parseFlag(args, "--extract-mode")
1522
if mode == "" {
@@ -19,23 +26,16 @@ func runGenerate(args []string, templatesFS embed.FS) int {
1926
noApply, args := hasFlag(args, "--no-apply")
2027
outputPath, args := parseFlag(args, "--output")
2128

22-
// App include toggles. GTK is opt-in because it rewrites ~/.config/gtk-*/
23-
// which many users have customised by hand. Everything else (zed, vscode,
24-
// neovim) is opt-out and matches the GUI's default behaviour when those
25-
// integrations are present.
26-
includeGtk, args := hasFlag(args, "--gtk")
27-
noGtk, args := hasFlag(args, "--no-gtk")
29+
// Editor integrations are opt-out and match the GUI defaults.
2830
noZed, args := hasFlag(args, "--no-zed")
2931
noVscode, args := hasFlag(args, "--no-vscode")
3032
noNeovim, args := hasFlag(args, "--no-neovim")
31-
_ = noGtk // gtk default is already off; flag exists for symmetry
3233

3334
if len(args) == 0 {
3435
fmt.Fprintln(os.Stderr, "Error: Wallpaper path is required")
35-
fmt.Fprintln(os.Stderr, "Usage: aether --generate <wallpaper> [--extract-mode <mode>] [--light-mode] [--no-apply] [--output <path>] [--gtk] [--no-zed] [--no-vscode] [--no-neovim]")
36+
fmt.Fprintln(os.Stderr, "Usage: aether --generate <wallpaper> [--extract-mode <mode>] [--light-mode] [--no-apply] [--output <path>] [--no-zed] [--no-vscode] [--no-neovim]")
3637
return 1
3738
}
38-
3939
wallpaperPath := args[0]
4040

4141
// Validate mode
@@ -100,7 +100,6 @@ func runGenerate(args []string, templatesFS embed.FS) int {
100100
}
101101

102102
settings := theme.Settings{
103-
IncludeGtk: includeGtk,
104103
IncludeZed: !noZed,
105104
IncludeVscode: !noVscode,
106105
IncludeNeovim: !noNeovim,

‎cli/generate_test.go‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package cli
2+
3+
import (
4+
"embed"
5+
"io"
6+
"os"
7+
"strings"
8+
"testing"
9+
)
10+
11+
func TestRunGenerateRejectsRemovedGTKOptions(t *testing.T) {
12+
for _, args := range [][]string{
13+
{"wallpaper.png", "--gtk"},
14+
{"wallpaper.png", "--no-gtk"},
15+
{"--gtk", "wallpaper.png"},
16+
{"wallpaper.png", "--output", "--gtk"},
17+
} {
18+
got, stderr := captureGenerateStderr(t, func() int {
19+
return runGenerate(args, embed.FS{})
20+
})
21+
if got != 1 {
22+
t.Errorf("runGenerate(%q) = %d, want 1", args, got)
23+
}
24+
if !strings.Contains(stderr, "Error: Unknown option:") {
25+
t.Errorf("runGenerate(%q) stderr = %q, want unknown option error", args, stderr)
26+
}
27+
}
28+
}
29+
30+
func captureGenerateStderr(t *testing.T, run func() int) (int, string) {
31+
t.Helper()
32+
r, w, err := os.Pipe()
33+
if err != nil {
34+
t.Fatal(err)
35+
}
36+
original := os.Stderr
37+
os.Stderr = w
38+
defer func() { os.Stderr = original }()
39+
40+
code := run()
41+
if err := w.Close(); err != nil {
42+
t.Fatal(err)
43+
}
44+
output, err := io.ReadAll(r)
45+
if err != nil {
46+
t.Fatal(err)
47+
}
48+
if err := r.Close(); err != nil {
49+
t.Fatal(err)
50+
}
51+
return code, string(output)
52+
}

‎docs/blueprints.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ Blueprints are JSON files at:
6464
"contrast": 5
6565
},
6666
"settings": {
67-
"includeNeovim": true,
68-
"includeGtk": false
67+
"includeNeovim": true
6968
}
7069
}
7170
```

‎docs/standalone.md‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ When you click "Apply Theme", Aether generates all theme files to:
2121
├── hyprland.conf # Hyprland color config
2222
├── kitty.conf # Kitty terminal theme
2323
├── waybar.css # Waybar stylesheet
24-
├── gtk.css # GTK theme (if enabled)
2524
├── colors.toml # Palette source (read by Aether's own UI)
2625
├── neovim.lua # Neovim colorscheme (if enabled)
2726
├── vscode.json # VSCode color theme (if enabled)
@@ -91,14 +90,6 @@ Or add to your Hyprland config:
9190
exec-once = swaybg -i ~/.config/aether/theme/backgrounds/wallpaper.jpg -m fill
9291
```
9392

94-
## GTK Theming
95-
96-
If you enable "GTK Theme" in settings, Aether copies `gtk.css` to:
97-
- `~/.config/gtk-3.0/gtk.css`
98-
- `~/.config/gtk-4.0/gtk.css`
99-
100-
This applies the color scheme to GTK applications system-wide.
101-
10293
## Automatic Reload
10394

10495
For applications that support live reload, changes apply immediately. Others may require:

‎examples/custom/demo.txt‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,7 @@ wallpaper_path = {wallpaper}
100100
# background = "0x{background.strip}"
101101
# foreground = "0x{foreground.strip}"
102102

103-
# GTK CSS Example
104-
/*
105-
@define-color background {background};
106-
@define-color foreground {foreground};
107-
@define-color accent {magenta};
108-
109-
window {
110-
background-color: alpha(@background, 0.95);
111-
color: @foreground;
112-
}
113-
*/
114-
115103
# Kitty Example (uses RGB format)
116104
# background {background.rgb}
117105
# foreground {foreground.rgb}
118106
# black {black.rgb}
119-

‎frontend/src/lib/components/layout/ActionBar.svelte‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@
102102
{
103103
label: 'Desktop',
104104
apps: [
105-
{key: 'gtk', name: 'GTK'},
106105
{key: 'hyprland', name: 'Hyprland'},
107106
{key: 'hyprlock', name: 'Hyprlock'},
108107
{key: 'icons', name: 'Icons'},

‎frontend/src/lib/components/sidebar/TemplateToggles.svelte‎

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
1919
const specialToggles = [
2020
{key: 'includeNeovim', label: 'Neovim'},
21-
{
22-
key: 'includeGtk',
23-
label: 'GTK',
24-
description:
25-
'Writes ~/.config/gtk-{3,4}.0/gtk.css. Switching themes outside Aether leaves this applied — click Revert to undo.',
26-
},
2721
{key: 'includeZed', label: 'Zed'},
2822
{key: 'includeVscode', label: 'VS Code'},
2923
] as const;
@@ -48,21 +42,9 @@
4842
});
4943
</script>
5044

51-
{#snippet toggleRow(
52-
label: string,
53-
on: boolean,
54-
onflip: () => void,
55-
description?: string
56-
)}
45+
{#snippet toggleRow(label: string, on: boolean, onflip: () => void)}
5746
<label class="flex cursor-pointer items-center justify-between gap-3">
58-
<div class="min-w-0">
59-
<span class="text-fg-secondary text-[11px]">{label}</span>
60-
{#if description}
61-
<p class="text-fg-dimmed text-[9px] leading-snug">
62-
{description}
63-
</p>
64-
{/if}
65-
</div>
47+
<span class="text-fg-secondary text-[11px]">{label}</span>
6648
<button
6749
class="relative h-4 w-8 shrink-0 transition-colors duration-150
6850
{on ? 'bg-accent' : 'bg-bg-surface border-border border'}"
@@ -82,14 +64,10 @@
8264
<ExpandableSection title="Templates" bind:expanded={templatesOpen}>
8365
<div class="flex flex-col gap-2">
8466
{#each specialToggles as toggle}
85-
{@render toggleRow(
86-
toggle.label,
87-
!!getSettings()[toggle.key],
88-
() =>
89-
updateSettings({
90-
[toggle.key]: !getSettings()[toggle.key],
91-
}),
92-
'description' in toggle ? toggle.description : undefined
67+
{@render toggleRow(toggle.label, !!getSettings()[toggle.key], () =>
68+
updateSettings({
69+
[toggle.key]: !getSettings()[toggle.key],
70+
})
9371
)}
9472
{/each}
9573

‎frontend/src/lib/constants/apps.ts‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import type {Settings} from '$lib/types/theme';
22

33
// App keys that have a dedicated boolean flag in Settings. Toggling these
4-
// drives apply-side install steps (ApplyGTKTheme, ApplyZedTheme,
5-
// ApplyVSCodeTheme, SelectedNeovimConfig), not just template writing —
4+
// drives apply-side install steps (ApplyZedTheme, ApplyVSCodeTheme,
5+
// SelectedNeovimConfig), not just template writing —
66
// they cannot be collapsed into the generic excludedApps list.
77
export const SPECIAL_APP_FLAGS: Record<string, keyof Settings> = {
8-
gtk: 'includeGtk',
98
zed: 'includeZed',
109
vscode: 'includeVscode',
1110
neovim: 'includeNeovim',
@@ -14,12 +13,7 @@ export const SPECIAL_APP_FLAGS: Record<string, keyof Settings> = {
1413
export const SPECIAL_APP_KEYS = new Set(Object.keys(SPECIAL_APP_FLAGS));
1514

1615
// Order in which specials should appear in UI lists.
17-
export const SPECIAL_APP_ORDER: readonly string[] = [
18-
'neovim',
19-
'gtk',
20-
'zed',
21-
'vscode',
22-
];
16+
export const SPECIAL_APP_ORDER: readonly string[] = ['neovim', 'zed', 'vscode'];
2317

2418
// Templates that are always written and never user-togglable. Hidden from
2519
// the Apps sidebar and the Targets strip. colors.toml is the canonical
@@ -30,7 +24,6 @@ export const ALWAYS_INCLUDED_APPS = new Set(['colors']);
3024
// Pretty labels for known templates. Anything not listed falls back to a
3125
// title-cased version of the key.
3226
const APP_LABELS: Record<string, string> = {
33-
gtk: 'GTK',
3427
zed: 'Zed',
3528
vscode: 'VS Code',
3629
neovim: 'Neovim',

0 commit comments

Comments
 (0)