| Andrew Stacey | |
|
|
home :: HowDidIDoThat :: Unix :: Transparent_Emacs Thu, 7th Dec 2006 (HowDidIDoThat :: Unix) Make Emacs Transparent I found that I spent ages deciding exactly which picture to have as my backdrop but then never saw it as there were too many windows on top. However, those windows tended to be Emacs or Xterms and so thanks to this version of Emacs and to Mrxvt I can make both of those transparent. This is not true transparency but only pseudo-transparency. That is, if there is another window behind the Emacs one then it does not "shine through". I prefer this as my main reason for having transparency is not so that I can see the other windows but so that I can see the background image. There is an experimental line of the XWindow system which does true transparency but it was really slow on my system the last time I tried it. This version of emacs is a development one and so has to be obtained from the source. The first step is to install the arch tools. On Ubuntu, the relevant package is called tla To get the source code of emacs use the following commands:
The middle line is not strictly necessary. It lists the available emacs packages at savannah and so you can check that emacs-tiling--0 is still there. Obviously, change the share/src/emacs to wherever you want to put it. Next step, compile it. This is the usual:
If something goes wrong -- as it inevitably will -- email the maintainer and not me. After the configure stage it is worth checking the list of enabled features. Most desirable features are enabled by default so if they're not there it's because you didn't have the right libraries. To get the full benefit it may be worth getting hold of those libraries (they're probably all standard) and redoing this step before going on to compile it. Do a make distclean in between. Now comes the fun part ... fixing the background. This is reasonably straightforward but there are one or two things that can catch you out. The main thing is that the background pixmap has to be the right size. Often the program which sets the desktop background can rescale on the fly but Emacs won't do this. So scale your background first. The second thing is that you probably want to tint the background for Emacs; I tend to go for about 70%. So you need two copies of the background image, one for the desktop and one for Emacs. Once you have that, the rest is easy. Either do it via the customisation, or put the following lines in your .emacs:
You may want to put other things like foreground and background colours as well. Or this can go in a separate file to make it easier to customise when changing the background image. All sorts of things are possible. I had a bit of trouble with this on the Mac because it didn't like resizing the initial frame. I don't have all those menu bars and so forth, but if you put these options in the .emacs file then it draws them in and then deletes them. This caused Emacs to crash. The solution was to put these options in the .Xdefaults file whereupon they never got drawn in the first place.
[Full link] |