add transparency support
This commit is contained in:
parent
b6b8c8f7fc
commit
0b8d55dac5
5
config.h
5
config.h
|
@ -12,6 +12,11 @@ static const char *url_regex = "(ftp|http)s?://[-a-zA-Z0-9.?$%&/=_~#.,:;+]*";
|
|||
static const char *url_command = "/usr/bin/firefox";
|
||||
#endif
|
||||
|
||||
//#define TRANSPARENCY
|
||||
#ifdef TRANSPARENCY
|
||||
static const double transparency_level = 0.2;
|
||||
#endif
|
||||
|
||||
static const char *font = "Monospace 9";
|
||||
static const long scrollback_lines = 1000;
|
||||
|
||||
|
|
10
termite.c
10
termite.c
|
@ -129,6 +129,16 @@ int main(int argc, char **argv) {
|
|||
vte_terminal_set_visible_bell(VTE_TERMINAL(vte), visible_bell);
|
||||
vte_terminal_set_mouse_autohide(VTE_TERMINAL(vte), mouse_autohide);
|
||||
|
||||
#ifdef TRANSPARENCY
|
||||
GdkScreen *screen = gtk_widget_get_screen(window);
|
||||
GdkColormap *colormap = gdk_screen_get_rgba_colormap(screen);
|
||||
if (colormap != NULL) {
|
||||
gtk_widget_set_colormap(window, colormap);
|
||||
}
|
||||
vte_terminal_set_background_saturation(VTE_TERMINAL(vte), transparency_level);
|
||||
vte_terminal_set_opacity(VTE_TERMINAL(vte), (guint16)(0xffff * (1 - transparency_level)));
|
||||
#endif
|
||||
|
||||
// set colors
|
||||
GdkColor foreground, background;
|
||||
gdk_color_parse(foreground_color, &foreground);
|
||||
|
|
Loading…
Reference in New Issue