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

Bat #66

Closed
hahuang65 opened this issue Feb 7, 2022 · 18 comments
Closed

Bat #66

hahuang65 opened this issue Feb 7, 2022 · 18 comments
Labels
port request Port Catppuccin to this app

Comments

@hahuang65
Copy link

Are you available to help in the creation of this port? 😄 (optional)
Maybe

Additional context 📷 (optional)
Add any other context or screenshots about the port request here.

https://github.com/sharkdp/bat

Looks like the theme is in a TextMate theme format. May be able to kill two birds with one stone on this one.
There are also some .tmTheme generators such as https://opensourcelibs.com/lib/code-theme-converter although I'm not sure that would preserve the integrity of the theme as the author might want.

@hahuang65 hahuang65 added the port request Port Catppuccin to this app label Feb 7, 2022
@hahuang65
Copy link
Author

I ran the VSCode port thru the converter I linked and it came up with the attached file. It looks decent in-use, but like I mentioned, it's not clear to me that the highlight groups / syntax is ideal.
Catppuccin.tmTheme.gz

@LudoPinelli
Copy link
Contributor

I was thinking of doing a port for bat (and so, everything that use the same format) too, but yes, the converter is not ideal, the highlight groups / syntax are off. It should follow what is done for catppuccin.nvim. It's already a lot better than having the default theme in a catppuccin surrounding though ^^

@VictorTennekes
Copy link

Reading through the documentation for Bat it seems like we could do this using our sublime text theme, all the themes they support are just sublime themes.

Their theme list.

@hahuang65
Copy link
Author

Reading through the documentation for Bat it seems like we could do this using our sublime text theme, all the themes they support are just sublime themes.

Their theme list.

This seems entirely reasonable and working fairly well. It's up to the maintainers if this configuration is up to their standards. I don't see why not, if it works well for Sublime.

I'm using it and pretty happy with it.

Thanks for discovering this. I didn't realize it worked with Sublime themes as well. I thought it was just the TextMate themes.

Feel free to close this ticket if this solution is acceptable.

@latipun7
Copy link
Contributor

I'm using it and pretty happy with it.

Thanks for discovering this. I didn't realize it worked with Sublime themes as well. I thought it was just the TextMate themes.

How to make it work? I tried to:

  • make new file in ~/.config/bat/themes/catppuccin/catppuccin.tmTheme
  • copy the contents of this raw sublime theme to that new file
  • run bat cache --build

But it didn't works, got this following messages:

❯ bat cache --build
Failed to load one or more themes from '/home/latipun/.config/bat/themes' (reason: 'Invalid syntax theme settings')
No syntaxes were found in '/home/latipun/.config/bat/syntaxes', using the default set.
Some referenced contexts could not be found!
- Syntax 'Svelte' with scope 'text.html.svelte' has unresolved context reference ByScope { scope: <source.postcss>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <source.postcss>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <source.sss>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <text.jade>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <text.pug>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <text.slm>, sub_context: None }
Writing theme set to /home/latipun/.cache/bat/themes.bin ... okay
Writing syntax set to /home/latipun/.cache/bat/syntaxes.bin ... okay
Writing metadata to folder /home/latipun/.cache/bat ... okay

Running bat --list-themes not showing catppuccin.

@VictorTennekes
Copy link

VictorTennekes commented Feb 22, 2022

Im guessing it's because our sublime theme isn't a tmTheme file, would have to look if we can convert it or need to rebuild it.

It's actually formatted differently it's not just a different extension.

@hahuang65
Copy link
Author

hahuang65 commented Feb 22, 2022

Im guessing it's because our sublime theme isn't a tmTheme file, would have to look if we can convert it or need to rebuild it.

It's actually formatted differently it's not just a different extension.

There's no need. You can put .tmTheme or .sublime color theme in the theme directory. Both will work. Check out github.com/hahuang65/bat-config to see what I did.

@hahuang65
Copy link
Author

hahuang65 commented Feb 22, 2022

I'm using it and pretty happy with it.

Thanks for discovering this. I didn't realize it worked with Sublime themes as well. I thought it was just the TextMate themes.

How to make it work? I tried to:

  • make new file in ~/.config/bat/themes/catppuccin/catppuccin.tmTheme
  • copy the contents of this raw sublime theme to that new file
  • run bat cache --build

But it didn't works, got this following messages:

❯ bat cache --build
Failed to load one or more themes from '/home/latipun/.config/bat/themes' (reason: 'Invalid syntax theme settings')
No syntaxes were found in '/home/latipun/.config/bat/syntaxes', using the default set.
Some referenced contexts could not be found!
- Syntax 'Svelte' with scope 'text.html.svelte' has unresolved context reference ByScope { scope: <source.postcss>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <source.postcss>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <source.sss>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <text.jade>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <text.pug>, sub_context: None }
- Syntax 'Vue Component' with scope 'text.html.vue' has unresolved context reference ByScope { scope: <text.slm>, sub_context: None }
Writing theme set to /home/latipun/.cache/bat/themes.bin ... okay
Writing syntax set to /home/latipun/.cache/bat/syntaxes.bin ... okay
Writing metadata to folder /home/latipun/.cache/bat ... okay

Running bat --list-themes not showing catppuccin.

Check out github.com/hahuang65/bat-config to see what I did.

@latipun7
Copy link
Contributor

@hahuang65 you have Catppuccin.tmTheme and formatted correctly, that's why. While I don't have the correct format, still the json like format sublime color, but the extension as .tmTheme

@hahuang65
Copy link
Author

@hahuang65 you have Catppuccin.tmTheme and formatted correctly, that's why. While I don't have the correct format, still the json like format sublime color, but the extension as .tmTheme

Wait, that .tmTheme I have shouldn't be there.

Have you tried with just the .sublime-theme-color file?

@hahuang65
Copy link
Author

Hmm maybe that doesn't work... I thought it did cuz I removed the tmTheme locally, but I guess it's in the cache.

@BrunDerSchwarzmagier
Copy link

I added a .tmTheme file to catppuccin/sublime-text. It's sublime's legacy format, and they only have a built-in way of converting from .tmTheme to .sublime-color-scheme so I wrote a quick python script to convert the other way.

I tested the new file in sublime and it seems correct. Lmk if it works for bat too.

@hahuang65
Copy link
Author

I added a .tmTheme file to catppuccin/sublime-text. It's sublime's legacy format, and they only have a built-in way of converting from .tmTheme to .sublime-color-scheme so I wrote a quick python script to convert the other way.

I tested the new file in sublime and it seems correct. Lmk if it works for bat too.

Thank you very much!

@latipun7
Copy link
Contributor

I tested the new file in sublime and it seems correct. Lmk if it works for bat too.

Tested in bat too, so far so good 👍

@WitherCubes
Copy link
Member

@hahuang65 sharkdp/bat#2124

@haunt98
Copy link

haunt98 commented May 23, 2022

Look like catppuccin theme is not merged to bat, @WitherCubes can you post the theme on gist/repo for us to try as custom theme of bat please?

@ghostx31
Copy link
Member

ghostx31 commented Aug 3, 2022

Ported bat to catppuccin 0.2.0.
Here is the repo: ghostx31/bat

This was referenced Aug 7, 2022
@nekowinston
Copy link
Member

Closed via 799e2f7, repo is now transferred to the org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port request Port Catppuccin to this app
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants