6

I'd like to change the colours of the menu bar and the scroll bar of emacs 24.

The instructions of EmacsWiki (the above links) do not work. This might be because I am using emacs 24.

According to the page ColorTheme on EmacsWiki, emacs 24 has a new colour system, so I tried some colour themes and to modify them. (Menu bar→Options→Customize Emacs→Custom Themes) But I could not find the faces which I should customise.

Could you tell me how to change the colours of the menu bar and the scroll bar of emacs 24?

Environment: openSUSE 12.3, KDE 4.10.5, Emacs 24.2.1 (x86_64-suse-linux-gnu, GTK+ Version 3.6.4)

3
  • 1
    I'd been wondering about this myself actually. I've gotten as far as finding this. I'm pretty sure Emacs uses GTK 3 now, and it seems to want people to edit some CSS file to set specific properties. Commented Oct 20, 2013 at 19:45
  • I've prepared gtk.css file, but emacs does not seem to read the file. (I've tried several file locations which are given in the page.) Where do you put gtk.css?
    – H. Shindoh
    Commented Oct 25, 2013 at 22:29
  • 2
    On Linux easiest way to find the location where emacs looks for the gtk.css file is to just use strace . See superuser.com/questions/1115820/… (answer detailing this procedure).
    – FooF
    Commented Sep 20, 2016 at 11:38

3 Answers 3

3
  1. Emacs 24 does not have a new color system. What it has that is new is a Customize interface for custom themes, which are different from but similar to the color themes of library color-theme.el.

  2. I think you mean the mode line and not the menu bar. (To change menu-bar appearance I think the only recourse might be Xresources.)

  3. The faces to customize are these:

    • scroll-bar

    • mode-line

    • mode-line-inactive

    • mode-line-emphasis

    • mode-line-buffer-id

    • mode-line-highlight

You can customize any of these using M-x customize-face. Or you can define a color theme or a custome theme that uses them.

1

Following the steps which Foof showed, I found the correct path for gtk.css.

1) start emacs by the following command, and quit it.

$ strace -o strace.log emacs &

2) following command will show the path

$ grep gtk.css strace.log | grep config
stat("/home/username/.config/gtk-3.0/gtk.css", 0x7fffc9981d50) = -1 ENOENT (No such file or directory)

So I put gtk.css at ~/.config/gtk-3.0/.

0

As suggested, adding gtk.css to ~/.config/gtk-3.0/ also worked for me. But it was not obvious (to me) what lines to put in that file. After browsing another gtk.css file for a theme on my system (Pocillo), I used this:

scrollbar slider {
  background-color: rgba(128, 128, 128, 0.5);
}
scrollbar slider:hover {
    background-color: rgba(128, 128, 128, 0.6);
}
scrollbar slider:active {
    background-color: rgba(128, 128, 128, 0.7);
}
scrollbar slider:disabled {
    background-color: rgba(128, 128, 128, 0.3);
}

This is on Ubuntu Budgie 21.10.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .