Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify theme script to parse toml #551

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ A theme has three main components: `name` (the theme's name), `palette` (the the

### Use script to add theme

[a `theme_parse` python script](../scripts/theme_parse) (require `pyaml` and `requests` libraries) can be used to parse [Iterm2 alacritty's color schemes](https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/alacritty) into a `spotify_player` compatible theme format.
[a `theme_parse` python script](../scripts/theme_parse) (require `toml` and `requests` libraries) can be used to parse [Iterm2 alacritty's color schemes](https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/alacritty) into a `spotify_player` compatible theme format.

For example, you can run

Expand Down
6 changes: 3 additions & 3 deletions scripts/theme_parse
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sys
import requests
import yaml
import toml

if len(sys.argv) > 1:
name = sys.argv[1]
Expand All @@ -15,7 +15,7 @@ else:
print("Usage: theme_parse `theme_name` `theme_saved_name`", file=sys.stderr)
exit(1)

url = f"https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/alacritty/{name}.yml"
url = f"https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/alacritty/{name}.toml"

req = requests.get(url)

Expand All @@ -25,7 +25,7 @@ if req.status_code != 200:
)
exit(1)

data = yaml.safe_load(req.content)
data = toml.loads(req.text)

print(
f"""[[themes]]
Expand Down
Loading