-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Easy way to adopt fish colours? #344
Comments
Of course, you can manually convert the configuration one by one and apply it to the corresponding faces of ble.sh. The list of faces is provided in README §2.6. The detailed way of specifying the colors and styles are described in Manual §2.1. There is currently no automated conversion from the fish spec to the ble.sh spec. I think one of the problems in automating the conversion is that there is no one-to-one correspondence between fish specifications and ble.sh faces, so the desired correspondence can depend on the personal preferences of each user. Also, ble.sh has a larger number of faces, i.e., more detailed distinctions of the syntax components and the contexts, so simply applying the setting of the closest one to a ble.sh's face would degenerate the detailed distinction by ble.sh. Maybe it is still useful to have a converter for the users who do not care about it so much. Another way to automatically "generate a color theme" might be to use the |
I searched for some materials to understand the fish color schemes. We can find the bundled color schemes of fish in the directory
|
First, some quick background: Fish themes are a relatively new feature to Fish. Previously, if you ran the As to > fish_config theme dump | grep -e '--'
fish_color_history_current --bold
fish_color_match --background=brblue
fish_color_search_match --background=33467c
fish_color_selection --background=33467c
fish_color_valid_path --underline
fish_pager_color_selected_background --background=33467c From bash, you can call into Fish and get at its themes with commands like so: # Show the themes available
$ fish -c 'fish_config theme list'
ayu Dark
ayu Light
...
Tomorrow Night
Tomorrow
# Show the colors of a theme
$ theme="Tomorrow Night"
$ fish -c 'fish_config theme choose $argv; fish_config theme dump' "$theme"
fish_color_autosuggestion 969896
fish_color_cancel -r
fish_color_command b294bb
fish_color_comment f0c674
fish_color_cwd green
fish_color_cwd_root red
...
fish_pager_color_selected_background --background=brblack
fish_pager_color_selected_completion
fish_pager_color_selected_description
fish_pager_color_selected_prefix All that background to say - I'm willing to pitch in and help here if you can get me started. The main blocker is that I would need a reasonable mapping from Fish's color variables to the ones ble.sh uses to get started. |
Thank you for the details. Then, I guess we would want to parse the version without
Yeah, that is the non-trivial part. Once we settle the mapping, we want to create an automated conversion script. The conversion of the Fish themes wouldn't be a one-time conversion, but we would like to update them occasionally to keep track of the upstream Fish themes. We do not want to rework the entire conversion manually every time we update the themes originating from Fish's, so we need an automated way. As described above, the categories of the colors from Fish and ble.sh are not in one-to-one correspondence. Then, a non-trivial question is how to adjust a blesh-specific face (i.e., ble.sh's face that doesn't have a corresponding Fish theme color):
|
I was thinking a much simpler approach would be sufficient - namely, if Fish didn't define a color for a feature then don't colorize it in ble.sh either (ie:
This is the simplest and most reasonable implementation - namely that you are truly just copying Fish's theming as-is. If the output of the theme converter could group all the undefined colorizations at the bottom, it would also then let users coming from Fish see what other things are possible with ble.sh and change those themselves. It also lets you keep the utility simple and reduces future maintenance. And, it's a pretty reasonable position to say the utility only supports theming elements as close as possible to the way Fish does and nothing more, while still letting the user have control of additional theming elements if they want them. |
I'm not sure if I understand it correctly, but I think mostly everything loses the style if you simply do that because most ble faces do not seem to have corresponding Fish color variables (as far as I look at the output of
Please check §2.1. It's ble-face @=none and then run |
Fish has an amazing web UI where I can set its prompt/completion colors. I like pastel theme which generates the following variables and I wonder how can I convert to ble.sh configuration. Any ideas/docos?
The text was updated successfully, but these errors were encountered: