feat: bundle Terebi Sunset as a selectable local theme

This commit is contained in:
hl-valdemar
2026-10-23 11:07:22 +02:00
parent 90cf08729e
commit 08135a407b
8 changed files with 176 additions and 12 deletions
+13 -11
View File
@@ -51,18 +51,20 @@ func currentScheme() (tintyScheme, error) {
if err != nil {
return tintyScheme{}, err
}
output, err := exec.Command("tinty", "list", "--json").Output()
if err != nil {
return tintyScheme{}, err
}
var schemes []tintyScheme
if err := json.Unmarshal(output, &schemes); err != nil {
return tintyScheme{}, err
}
id := strings.TrimSpace(string(current))
for _, scheme := range schemes {
if scheme.ID == id {
return scheme, nil
for _, args := range [][]string{{"list", "--json"}, {"list", "--json", "--custom-schemes"}} {
output, err := exec.Command("tinty", args...).Output()
if err != nil {
return tintyScheme{}, err
}
var schemes []tintyScheme
if err := json.Unmarshal(output, &schemes); err != nil {
return tintyScheme{}, err
}
for _, scheme := range schemes {
if scheme.ID == id {
return scheme, nil
}
}
}
return tintyScheme{}, fmt.Errorf("scheme not found: %s", id)