Accepted icon indicating copy to clipboard operation
Accepted copied to clipboard

Transparent background in editor

Open dontlaugh opened this issue 5 years ago • 12 comments

I have a transparent terminal. I like the way it looks.

In the acc editor, the line numbers have a transparent background, but the editor area does not.

image

Is there a way to configure a transparent background for both?

dontlaugh avatar Feb 01 '20 23:02 dontlaugh

Thanks for your issue! :smile:

Is there a way to configure a transparent background for both?

No, now. But it can be implemented.

Could you share your environment(OS, terminal software)?

It looks good in macOS + iTerm2. ____________________________2020-02-02_16 10 25

hatoo avatar Feb 02 '20 07:02 hatoo

My OS is Manjaro Linux with the Xfce desktop.

Here are a two terminals:

Kitty https://sw.kovidgoyal.net/kitty/ image

Xfce Terminal image

The Kitty terminal is capable of transparent background colors, since the status bar can do it. For example:

image

dontlaugh avatar Feb 02 '20 15:02 dontlaugh

So, unfortunately, that status bar is a part of kitty terminal's internal UI. It's not really a terminal program. All other terminal programs I've run in linux have opaque background colors. :thinking:

dontlaugh avatar Feb 02 '20 22:02 dontlaugh

https://github.com/kovidgoyal/kitty/blob/f9e8a4050ce5b502754934908d0e1691cc7ffc05/kitty/config_data.py#L843

So I think my only path forward is to not set a background color at all in acc. I'll try it out.

dontlaugh avatar Feb 03 '20 01:02 dontlaugh

I don't know if it is possible to do this with edits to the .tmTheme file only. :(

dontlaugh avatar Feb 03 '20 02:02 dontlaugh

I confirmed that it is not applied transparency if the background color is different from the terminal's default color on Kitty with mac.

I think it can be resolved by adding a config that not to render background-color on editors' screen.

How do you think?

hatoo avatar Feb 03 '20 07:02 hatoo

That might work. I could not figure out how to do that with edits to the xml file (and rebuilding). Maybe there is another command we can use from the syntax library.

dontlaugh avatar Feb 03 '20 13:02 dontlaugh

Currently, acc uses Solarized (dark) which is hardcoded in syntect as the theme. and it's not configuable note: assets/One Dark.tmTheme is not used now. https://github.com/hatoo/Accepted/blob/615885d6943a47bde703ad24ea1f9b24f63e86ca/src/syntax.rs#L55-L63

Maybe we should just make a syntax file configurable. Is it enough for you?

hatoo avatar Feb 04 '20 06:02 hatoo

Runtime configuration would be good!

dontlaugh avatar Feb 04 '20 15:02 dontlaugh

I've succeeded to draw transparent background on kitty on macOS by setting a theme whose background is #000000.

Could you share your screenshot?

Screen Shot 2020-02-19 at 19 07 14

hatoo avatar Feb 19 '20 10:02 hatoo

It works! This is a new computer, but for some reason it's working here. I am traveling, I will try it on my other devices when I get home in a few days.

Environment: Manjaro Linux, Xfce Desktop, Kitty v 1.16

On my other desktop I did have an older version of Kitty, because it is a Ubuntu-based machine and the package manager is not up to date. But the good news is this is my new main laptop! :)

image

dontlaugh avatar Feb 19 '20 22:02 dontlaugh

I used the path-based configuration you provided as an option in #15 and copied the OneDark theme into a new file at $HOME/.config/acc/themes/Test.tmTheme, and provided the full path to that theme. And edited the background config to 00000.

Theme in a gist: https://gist.github.com/dontlaugh/62e7cc4b325638adc36d7155f4c9f0df#file-test-tmtheme-L17

dontlaugh avatar Feb 19 '20 22:02 dontlaugh