146

It looks like Ubuntu 11.04 will come with overlay scrollbars by default. I do like them, but I don't like the current mix of scrollbar types as many applications don't yet use those overlay scrollbars.

Is there a way to disable overlay scrollbars (without removing the overlay-scrollbar package)?

Jorge Castro
  • 71,754
htorque
  • 64,798

12 Answers12

137

In 12.04 LTS there's a slightly cleaner way to do it. Just run

gsettings set org.gnome.desktop.interface ubuntu-overlay-scrollbars false

in a terminal. Apps opened afterwards will have the non-ayatana scrollbar.

To get the default behavior back, run

gsettings reset org.gnome.desktop.interface ubuntu-overlay-scrollbars

If you are using 12.10 or later, run

gsettings set com.canonical.desktop.interface scrollbar-mode normal

And to return to the default, run

gsettings reset com.canonical.desktop.interface scrollbar-mode
iBelieve
  • 5,384
Erigami
  • 4,476
68

You can disable the scrollbars either

htorque
  • 64,798
  • 11
    Just one user: echo export LIBOVERLAY_SCROLLBAR=0 >> ~/.xprofile (note that the double '>>' is important, it means "append"). To add for all users: echo export LIBOVERLAY_SCROLLBAR=0 | sudo tee -a /etc/X11/Xsession.d/99disable-overlay-scrollbars – sladen Jun 23 '11 at 12:17
  • While this seems to have no effect for me (Ubuntu 12.04 with LXDE -- and yes, X was restarted after that change), Erigami's variant worked excellent. Just as a hint to try the other if one doesn't work :) – Izzy Jun 25 '13 at 06:14
  • For 15.10 and 16.04 the variable is named differently. – Ruslan May 23 '17 at 14:23
  • I remember that when I still used Unity desktop environment, I had to use this workaround to fix a scrollbar bug on Geany: alias geany="LIBOVERLAY_SCROLLBAR=0 geany" – baptx Oct 23 '18 at 14:50
30

You can remove the scrollbars completely by typing

sudo apt-get remove overlay-scrollbar liboverlay-scrollbar
Oli
  • 293,335
18

Just disabling or removing the overlay-scrollbars as described by the other answers will get you back the scroll bars, but they will be missing the stepper buttons at the end of the bars because they have been disabled in the Ambiance theme. To re-enable them, put the following in the ~/.gtkrc-2.0 file:

style "default" {
  engine "murrine" {
    stepperstyle = 0
  }
}

and the following into the file ~/.config/gtk-3.0/gtk.css:

.scrollbar {
  -GtkScrollbar-has-backward-stepper: 1;
  -GtkScrollbar-has-forward-stepper: 1;
}

Usually, restarting the applications is enough for the changes to apply.

Michael Wild
  • 1,719
  • To make the stepper buttons better-looking, add this to .scrollbar: -GtkRange-slider-width: 16; -GtkRange-stepper-size: 17; – Håkon A. Hjortland Aug 21 '12 at 07:56
  • Thanks, this restores the steppers for me, but is there an easy way to fix the contrast on the scrollbars so they're not a totally unusable black on black? – Joseph Garvin Sep 22 '12 at 14:34
  • That worked for me. I'm just surprised by the "murrine". Wondering whether that really applies to me. I thought I had metacity, or is metacity yet something else than the "engine"? – Alexis Wilke Oct 14 '12 at 02:27
  • This doesn't seem to have done anything for me. Is it because I'm running Cinnamon? Or do I need to restart for it to take effect? – Paul Brannan May 06 '14 at 18:20
  • @PaulBrannan Uhh, that is a really old answer. I would be surprised if it was directly applicable, in particular to the Cinnamon desktop... – Michael Wild May 09 '14 at 20:39
5

Simply use utility dconf-editor or gconf-editor. If it is not already present you can install this from Ubuntu Software Center.

This utility is like Windows registry-editor where you can tweak system settings. From entry org > gnome > Desktop > Applications.you find an item named ubuntu-overlay-scrollbars. Toggle the item off, logout/login and you're ready.

Salem
  • 19,744
Marcel
  • 51
4

Maybe you're talking about ayatana scrollbar!

in the case that you want to have the old scrollbar style you only need to use the next command:

sudo apt-get remove overlay-scrollbar liboverlay-scrollbar liboverlay-scrollbar3

enter image description here

Zanna
  • 70,465
Kesymaru
  • 341
4

In Ubuntu 12.04 you can just install Ubuntu Tweak and the option to disable the vertical overlay scrollbar is in Tweaks -> Miscellaneous. You'll need to log-off or reboot for the changes to take effect.

If you want the overlay scrollbar back at some point, you just go and enable it back again in the app. In addition you get a large number of tweaks at your disposition. I'd say this is the easiest way to achieve this.

Gabriel
  • 2,453
  • 7
  • 32
  • 52
3

Try the following:

echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80overlayscrollbars

You'll probably need to log off once.

More information / ideas can be found here.

jokerdino
  • 41,320
Pavlos G.
  • 8,844
  • pavlos G. beat me to it. The info is also confirmed here and here – Nitin Venkatesh Jun 07 '11 at 11:38
  • Thanks for this, guys. As I absolutely despise the overlay scrollbars, I'll accept the answer that removes the packages, but I'm sure this info will be useful to others. – Josh Glover Jun 07 '11 at 11:44
  • 1
    Careful with the single >, it will cause the file to be overwritten if it already exists (and thus destroy all previous changes). Better use >> instead to append the new setting. – Izzy Jun 25 '13 at 06:21
3

On 15.10 wily (libgtk-3-0) this worked for me:

export GTK_OVERLAY_SCROLLING=0
  • 1
    I tried this and it doesn't work for me, though I inserted this into .xprofile as well. Does it really work for you? In which application you can see it take effect? – Nicolas Mar 09 '16 at 23:29
  • Where should this code be put? – A.L Apr 22 '16 at 23:48
  • This still works well for me on Xubuntu 18.04. To disable overlay scrollbars globally, put this line into a (new) file like /etc/X11/Xsession.d/99disable-overlay-scrollbars. – Ruslan Jun 11 '19 at 10:21
1

When you try to uninstall liboverlay-scrollbar doesn't find it! To get rid of the transparent bars was easily fixed. I use leafpad.

Open a terminal :

  1. gksudo leafpad /etc/X11/Xsession.d/99disable-overlay-scrollbars
  2. Put your password in.
  3. Type export LIBOVERLAY_SCROLLBAR=0
  4. Save, Exit and reboot.

No more overlay slidebars or transparent slidebars.

Binarylife
  • 16,442
freebird
  • 386
0

Enabling classic/old style scrollbars

For Ubuntu 14.x there are two ways:

Just use command:

gsettings set com.canonical.desktop.interface scrollbar-mode normal

Or install Unity Tweak Tool.

sudo apt-get install unity-tweak-tool

Go to System > Scrollbars and set to Legacy.

Changing colors and appearance

After one of these two steps, you can further enhance the look of scrollbars if you are using default Ambiance theme. To do this, fire up (if you don't have sublime editor then replace it with whatever editor you are using like nano or gedit).

sudo subl /usr/share/themes/Ambiance/gtk-3.0/gtk-widgets.css

Press Ctrl+F and type .scrollbar to find style section for scrollbars. Mine looks like below (annotated with /* MODIFIED ... / comments below):

.scrollbar,
.scrollbar.vertical {
    /* MODIFIED: next 3 lines */
    -GtkScrollbar-has-backward-stepper: 1;
    -GtkScrollbar-has-forward-stepper: 1;
    -GtkScrollbar-stepper_size = 14;
    -GtkRange-slider-width: 14;
    border-radius: 20px;
    border-image: none;
}

.scrollbar.trough,
.scrollbar.trough.vertical {
    border-color: shade (@bg_color, 0.8);
}

.scrollbar.slider,
.scrollbar.slider:hover,
.scrollbar.button,
.scrollbar.slider.vertical,
.scrollbar.slider.vertical:hover,
.scrollbar.button.vertical {
    border-width: 1px;
    border-style: solid;
    border-color: shade (@bg_color, 0.86);
    /* MODIFIED: next 1 line */
    background-image: -gtk-gradient (linear, left top, right top,
                                     from (shade (@dark_bg_color, 1.08)),
                                     color-stop (0.5, @dark_bg_color),
                                     to (shade (@dark_bg_color, 0.94)));
    box-shadow: inset 1px 0 shade (@bg_color, 1.1),
                inset -1px 0 shade (@bg_color, 1.01),
                inset 0 1px shade (@bg_color, 1.1),
                inset 0 -1px shade (@bg_color, 1.1);
}

Final result:

enter image description here

-1

I was able to get rid of the overlay scrollbars using dconf-editor, by setting:

com.canonical.desktop.interface.scrollbar-mode='normal'

(Caveat, not sure about stepper buttons.)

Intuitively, if 'off' is normal, shouldn't it be the default? Someone deemed 'overlay-auto' the default. Just thankful to be rid of this horrifically unhelpful 'feature'. It cost me about two hours to find a solution. Hope to resolve the stepper-buttons issue based on the above information (thank you).