zzrough/gs-extensions-drop-down-terminal

Feature Request: Use theme from GNOME terminal

Opened this issue · 19 comments

I love drop down terminals but I also like them to use consistent fonts and color schemes from my default terminal. Would it be possible to add the ability to import the theme from GNOME terminal or maybe customize the theme a little bit so it is more consistent with my other terminal windows?

I love the idea of keeping the plugin simple and it already works better than guake does with multiple monitors.

I originally planned to do just that, but it's quite a challenge to support all configuration of a gnome terminal profile. I'm leaning towards adding all the "standard" settings directly in the preferences instead.

The problem is I can't customize the colors (see #26). The intended default palette is the tango one, which is the same as gnome terminal's default. Only the background is black. I tried a month ago and I can't make vte (the terminal widget) take the argb colors I want. I'd need debug vte's and gjs code to understand why the colors are received as pure garbage by the lib.

I'd be fine with the default colors (I prefer green on black) but so far
the extension has already worked better than most alternatives I've found.
I also like that it always opens wherever the top bar is for multi monitor
support.

On Thursday, October 24, 2013, Stéphane Démurget wrote:

I originally planned to do just that, but it's quite a challenge to
support all configuration of a gnome terminal profile. I'm leaning towards
adding all the "standard" settings directly in the preferences instead.

The problem is I can't customize the colors (see #26#26).
The intended default palette is the tango one, which is the same as gnome
terminal's default. Only the background is black. I tried a month ago and I
can't make vte (the terminal widget) take the argb colors I want. I'd need
debug vte's and gjs code to understand why the colors are received as pure
garbage by the lib.


Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-26982922
.

Justin Garrison
1n73r.net

Hi, and thanks for a great extension!

I would also like to see the use of the theme from gnome-terminal (even though I understand that it's probably complicated to do). I'm using the Zenburn theme for lower contrast, as my eyes are a bit sensitive these days...

Take care!

+1 for this request too :)

I would very much like to see a proper integration with the scheme from Gnome Terminal as well.

Many thanks for your extension!

I can't do that at the moment, see my previous comment.

The intended default palette is the tango one, which is the same as gnome terminal's default
I tried a month ago and I can't make vte (the terminal widget) take the argb colors I want

That means it is also not possible to change the default color scheme Tango to another, e.g. Solarized?

No, it's worse: it means it can not even be Tango, Solarized. Just the defaults which are neither one of those.

@zzrough If I read through the issues correct, the issue seems to be with https://github.com/zzrough/gs-extensions-drop-down-terminal/blob/master/drop-down-terminal%40gs-extensions.zzrough.org/terminal.js#L65 and the fact that this does not provide proper color objects for your pallet (https://github.com/zzrough/gs-extensions-drop-down-terminal/blob/master/drop-down-terminal%40gs-extensions.zzrough.org/terminal.js#L89-L106) so that you can set the terminal colors (https://github.com/zzrough/gs-extensions-drop-down-terminal/blob/master/drop-down-terminal%40gs-extensions.zzrough.org/terminal.js#L307-L309). Is this correct? Would this not be a bug with the Gdk.RGBA().parse('HEX') function then?

I ask because I see no such bug, with GDK nor do I see a parse function so .. I might just be missing this.

@sferich888 I debugged that a long time ago but could not come up with a patch. The problem is that the Gdk.RGBA structure is correctly parsed, but when it's passed to the VTE library using VteTerminal.set_colors (I debugged at C level at the time), the received structure is completely hosed. So I suppose this is a problem with this type of objects.

@zzrough the only thing I see close to a VTE issue like what your describing is https://bugzilla.gnome.org/show_bug.cgi?id=372743 but that has to do with the pallet lenght, and according to https://developer.gnome.org/vte/unstable/VteTerminal.html#vte-terminal-set-colors you can't have 24 anymore anyways.

In short this does not seem to be even close to what you are describing. I wonder if what we are seeing could be reproduced simply, just using an 8 or 16 bit pallet so that a bug against VTE could be submitted.

@sferich888 From my memory, this really had nothing to do with the way I used the API. I tried with different palettes, with or without RGBA... To make it simple, the problem comes from a GJS marshalling error between JS and the native lib (VTE) for the Gdk.RGBA array type (it is not a GType but an opaque value). The foreground and background colors (two first arguments) are working great actually!

The bug you mention is almost ten years old, was fixed and the doc was updated for a long time, this is a different issue indeed.

@zzrough my quest here is shouldn't others using VTE also be seeing the same issue this plugin is seeing when they try and define a pallet?

This seems like it would be a common issue on VTE.

@sferich888 From what I remember, I did a Python test program where everything worked like a charm. Are there any other application using a terminal being written in Javascript using GJS?

frol commented

I have tried terminal.set_colors() again and it still doesn't work. The pallete schema just goes black for all colors. Interestingly, if I pass 8-element pallete, only "dark" colors go black, but "light" colors are left default ones.

Nevertheless, I have found a workaround, which works for me. I use tput initc to override the colors for a shell config (i.e., ~/.bashrc, ~/.config/fish/config.fish). I just put the following lines into the config:

# Dark colors
tput initc 0 172 196 200
tput initc 1 776 0 0
tput initc 2 298 568 19
tput initc 3 749 592 0
tput initc 4 200 372 800
tput initc 5 447 294 376
tput initc 6 23 560 470
tput initc 7 815 835 800

# Light colors
tput initc 8 329 337 313
tput initc 9 929 160 156
tput initc 10 537 878 196
tput initc 11 980 905 298
tput initc 12 380 600 1000
tput initc 13 992 243 886
tput initc 14 203 878 854
tput initc 15 905 909 901

NOTE: tput initc "color_id" "red" "green" "blue">, where red/green/blue is an integer in range 0-1000. I have used a color picker to get the colors from my gnome-terminal and then converted HEX values to 0-1000 values by a simple python script.

NOTE2: Also, you need to have export TERM=xterm-256color (put it into the ~/.bashrc or ~/.profile as well)

Here is a screenshot with the colors pallete before the workaround:
screenshot from 2016-01-09 13-35-16

And here is after:
screenshot from 2016-01-09 13-34-23

@zzrough Hi ! Is this issue still unsolvable ? Thanks.

The workaround by @frol works for me, but requires TERM=xterm-235color.

Ho crap! I never saw yor workaround @frol, it's great! I was checking on set_colors at each release. I'll try to put that as an option or hardcoded in the upcoming release.

works for me, and my colors:

export TERM=xterm-256color

# Dark colors
tput initc 0 179 203 210
tput initc 1 796 0 0
tput initc 2 304 601 23
tput initc 3 765 625 0
tput initc 4 203 394 640
tput initc 5 457 312 480
tput initc 6 23 593 601
tput initc 7 824 839 808
# Light colors
tput initc 8 550 566 539
tput initc 9 933 160 160
tput initc 10 539 882 203
tput initc 11 984 910 308
tput initc 12 445 621 808
tput initc 13 675 496 656
tput initc 14 203 882 882
tput initc 15 929 929 921