4

Is there some way to fill background of Emacs' windows (not frames) using some CSS rules rather than one solid color?

Solid color fill is very unnatural for eyes (at least of mine). There is an amazing cicada principle1 in the wild, and it will be very great to fill background using several low opacity gradient layers to make some slightly visible noise. I believe this also helps to follow scrolling.

7
  • 2
    No, you cannot use CSS rules. Remember that Emacs existed long before CSS was invented. That doesn't necessarily mean you can't have a varied background, however, you may need to use some other method, like images or overlays.
    – PythonNut
    Jun 9, 2015 at 3:06
  • Well, one way of doing this I can think about is to run Emacs in some console terminal which can be configured to have a background image or to be transparent... (there are many such terminals on Linux systems), but, frankly, I don't think it's such a great idea for an almost exclusively textual interface.
    – wvxvw
    Jun 9, 2015 at 7:54
  • 1
    @wvxvw running Emacs in a console terminal makes you lose lost of nice features, such as image/PDF display or certain key combinations. I always suggest running a graphical Emacs frame.
    – user2005
    Jun 9, 2015 at 11:49
  • 3
    Emacs is not a Browser, so I don't know why you expect to be able to make use of CSS to style it.
    – wasamasa
    Jun 9, 2015 at 11:58
  • 2
    Google(image background gnu emacs) -> stackoverflow.com/questions/2010158/… -> umiushi.com/~wac/bgex -> github.com/wachikun/emacs_bgex Jun 9, 2015 at 12:27

1 Answer 1

4

Via StackOverflow → Setting an Emacs background image, I found https://github.com/wachikun/emacs_bgex which will allow you to set background images. Although it's an indirect method, if you can generate the image with CSS rules then you can now include it in Emacs BGex (i.e. a patched version of Emacs). For the image generating step, there's a tip posted at StackOverflow → CSS: Creating textured backgrounds, which points to http://lea.verou.me/css3patterns/, where some images are specified like this:

background-color:silver;
background-image: 
radial-gradient(circle at 100% 150%, silver 24%, white 25%, white 28%, silver 29%, silver 36%, white 36%, white 40%, transparent 40%, transparent),
radial-gradient(circle at 0    150%, silver 24%, white 25%, white 28%, silver 29%, silver 36%, white 36%, white 40%, transparent 40%, transparent),
radial-gradient(circle at 50%  100%, white 10%, silver 11%, silver 23%, white 24%, white 30%, silver 31%, silver 43%, white 44%, white 50%, silver 51%, silver 63%, white 64%, white 71%, transparent 71%, transparent),
radial-gradient(circle at 100% 50%, white 5%, silver 6%, silver 15%, white 16%, white 20%, silver 21%, silver 30%, white 31%, white 35%, silver 36%, silver 45%, white 46%, white 49%, transparent 50%, transparent),
radial-gradient(circle at 0    50%, white 5%, silver 6%, silver 15%, white 16%, white 20%, silver 21%, silver 30%, white 31%, white 35%, silver 36%, silver 45%, white 46%, white 49%, transparent 50%, transparent);
background-size:100px 50px;

You'd have to convert that to an image format that emacs_bgex understands, for example by taking a screenshot:

possible emacs background

2
  • 1
    That's a crazy cool CSS gradient.
    – PythonNut
    Jun 23, 2015 at 14:21
  • it's cool but it does seem to have a slight glitch ... Jun 23, 2015 at 21:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.