Posts

Showing posts with the label background

Zen Emacs

Image
Here's a quick patch to set a pleasant background (PNG image) in Emacs. This needs GTK with cairo build (you need the cairo API cairo_image_surface_create_from_png()).       modified   src/xterm.c @@ -408,6 +408,8 @@ x_end_cr_clip (struct frame *f)      x_mark_frame_dirty (f);  }   +static cairo_surface_t *image; +  void  x_set_cr_source_with_gc_foreground (struct frame *f, GC gc)  { @@ -432,6 +434,10 @@ x_set_cr_source_with_gc_background (struct frame *f, GC gc)    x_query_colors (f, &color, 1);    cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0,              color.green / 65535.0, color.blue / 65535.0); + +  if (!image) +     image = cairo_image_surface_create_from_png ( "/home/anand/back.png" ); +  cairo_set_source_surface(FRAME_CR_CONTEXT (f), image, 0, 0);  }    static const cairo...