views:

588

answers:

3

Is it possible to change the scrollbar color in emacs? (Note: Not XEmacs)

If it matters, I'm running emacs 22 on Ubuntu 8.10.

+1  A: 

Shamelessly taken from the FAQ for XEmacs

Here's a recap of how to use resources to change your scrollbar colors:

! Motif scrollbars

Emacs*XmScrollBar.Background: skyblue
Emacs*XmScrollBar.troughColor: lightgray

! Athena scrollbars

Emacs*Scrollbar.Foreground: skyblue
Emacs*Scrollbar.Background: lightgray

Note the capitalization of Scrollbar for the Athena widget.

Dan Esparza
That doesn't seem to work for me. I'm running the latest version of Ubuntu (8.10) and the latest version of emacs (22.2.1). Any other suggestions?
mike
Does that only work in XEmacs?
mike
Charlie asks a good question: What environment are you in? To answer your question -- yes, I think that only works for XEmacs (sorry for my assumption)
Dan Esparza
A: 

In what environment? In, eg, Carbon EMACS, the scrollbar widgets come from the carbon native set; if so, you can't really change the color.

Charlie Martin
A: 

See the Emacs Wiki Site for info about ScrollBars

To Quote from the site:

GnuEmacs can draw its own “native” scroll bars, which are quite customizable. In my opinion, this also gives the best results for users of ColorTheme. Details follow:

Build GnuEmacs with the following options passed to ./configure:

         --without-toolkit-scroll-bars --with-x-toolkit=no

Then try a ColorTheme, or:

M-x customize-face RET scroll-bar RET

You can set the foreground/background colors, border color/width, etc. There is a separate variable called scroll-bar-width.

Andrew Cox
But what if I am dealing with a pre-built emacs in an installation I can't control?
Arkadiy
try a `M-x describe-variable ret system-configuration-options ret` if it doesn't have the above the settings it doesn't look like you can!
Andrew Cox