akinomyoga / ble.sh

Bash Line Editor―a line editor written in pure Bash with syntax highlighting, auto suggestions, vim modes, etc. for Bash interactive sessions.
BSD 3-Clause "New" or "Revised" License
2.54k stars 81 forks source link

Muted or black and white colors #258

Closed auwsom closed 1 year ago

auwsom commented 1 year ago

I'm happy to find this great Auto-suggestion utility.

Is there anyway to get less colorful output? Either more muted colors lie Gruvbox theme, or just black and white?

I used the following to get more Fish-like colors: ble-color-setface auto_complete fg=242,bg=235

I realize this might lose information about the various states the suggestions is in, but it would be less visually distracting.

Thank you!

akinomyoga commented 1 year ago

Thank you for trying ble.sh! First, which version of ble do you use? If you are using 0.3, I think it is useful to switch to 0.4 in which there are additional color configurations.

(1) Have you checked the first item in README §2.2? There are color settings for different levels in ble.sh, but I think it is useful to first check README §2.2.

# blerc

bleopt highlight_syntax=

If that is not what you want, there are other options:

(2) If you want to turn off all the colors used by ble.sh, you can put the following lines in ~/.blerc:

# blerc

bleopt term_index_colors=2
_ble_term_colors=2

(3) If you want to change the settings of all the faces at once, you may find the answer in #223 useful.

# blerc

eval "$(ble-face | sed -En '/=ref:|(^|,)bold(,|$)/!s/$/,bold/p')"

(4) Or, of course, you can always configure the faces (listed by ble-face) one by one to a less colorful one.

$ ble-face     # <-- You can list faces by this command.

In that case, I'm also welcome for new themes, which configure colors using a set of calls of ble-face (a new name of ble-color-setface), as discussed in #210.

(5) Also, if your terminal has support for the 24-bit terminal colors, you might be interested in the contrib/colorglass module.

If these are all not what you want, I would appreciate it if you could explain what you exactly would like to achieve and how it is different from the above settings in order to help improve ble.sh. Thank you!

akinomyoga commented 1 year ago

Also, if your terminal has a support for the 24-bit terminal colors, you might be interested in the contrib/colorglass module.

I have newly added options bleopt colorglass_saturation and bleopt colorglass_brightness to the contrib/colorglass module.

(6) If your terminal has support for the 24-bit terminal colors, another option is to configure ble.sh in the following way:

# blerc

ble-import contrib/colorglass
bleopt colorglass_saturation=-50     # <-- decrease saturation by 50%

(7) If you would like to get the grayscale theme, another possible configuration is this:

# blerc

ble-import contrib/colorglass
bleopt colorglass_saturation=-100     # <-- decrease saturation by 100%
auwsom commented 1 year ago

That is great 👍. I will try that.

I'm really enjoying this utility. I've been telling a bunch of people about it on twitch. A couple mentioned the bright colors, so I think this will really help. Cheers

akinomyoga commented 1 year ago

Can I close the issue? Thank you.

auwsom commented 1 year ago

Yes, thanks.

akinomyoga commented 1 year ago

Thank you!

auwsom commented 1 year ago

@akinomyoga hi, when I use ble-color-setface auto_complete fg=242,bg=235, it removed the colors, however, I cant seem to get them back, even after setting ble-color-setface auto_complete=.

Where are these settings stored? in a config file? Thanks

akinomyoga commented 1 year ago

I might not understand the question. Are you asking for a way to restore the default colors? Or are you asking for a way to configure the color for all the sessions (instead of the temporary setting for the current session)?


In the former case, do you still use ble-0.3? If you have switched to ble-0.4, you can restore the original setting by

$ ble-face -r auto_complete

I recommend you switch to ble-0.4, but if you still use ble-0.3, there is no way to automatically restore the default setting by a command. You can directly specify the default setting (which is described in README):

$ ble-color-setface auto_complete fg=238,bg=254

In the latter case, you can put the setting in your ~/.blerc (or ~/.config/blesh/init.sh).

auwsom commented 1 year ago

@akinomyoga thanks for the quick reply. I'm trying to restore colors. I've used ble-update to the newest version. Unfortunately,the $ ble-face -r auto_complete command doesnt work.. the colors are still just black and white.

I just commented out the lines in my .blerc and the colors are back. That must have been it. Thanks

#bleopt term_index_colors=2
#_ble_term_colors=2
akinomyoga commented 1 year ago

Ah, OK. Great.

auwsom commented 1 year ago

sorry that was a silly question.. i skimmed past the ~/.blerc in the main GH page and in the Manual.

Quick question though.. since Blesh is autosuggesting some history, is there a way to get a tab-completion menu of just history? I see options for filenames, hostnames, username, commands and variable, but history would be awesome. It would likely be so much faster than ctrl-R search history line by line.

Kind of line this Hstr package, but as a tab completion menu: https://github.com/dvorka/hstr

akinomyoga commented 1 year ago

since Blesh is autosuggesting some history, is there a way to get a tab-completion menu of just history?

I once thought about it, but haven't yet implemented it. I'll put it on the to-do list.

auwsom commented 1 year ago

That's great :+1:

comment removed. figured it out.