Page 1 of 1

Enable classic scrollbars (add steppers and disable overlay)

Posted: Mon May 28, 2018 3:08 pm
by rich
edit - Woops, should have searched before posting! A similar guide has already been posted here: viewtopic.php?f=95&t=44128

edit -June 7, 2018 - Upon further inspection the QT theme seems to have steppers (invisible or not) regardless of gtk theme options

Do you prefer classic scrollbars with buttons to click at the top and bottom? The kind that doesn't hide when you're not looking? I do, especially because the trackpad on my laptop makes it hard to click and drag. Here we'll see how to add the buttons at the top and bottom of the scrollbar and how to make the scrollbars stop disappearing when you move your mouse.

1.) Add scrollbar steppers
MX, for the most part, uses three different toolkits - gtk2, gtk3, and qt5. qt5, by default, will mimic gtk2, so we only need to talk to gtk2 and gtk3 here to get our scrollbar "steppers" (buttons). For gtk2, we can add this file:

~/.gtkrc-2.0

Code: Select all

style "scrollbar-steppers"
{
    GtkRange::stepper-size      = 13
    GtkScrollbar::stepper-size  = 13
    GtkScrollbar::has-backward-stepper      = 1  
    GtkScrollbar::has-forward-stepper       = 1
}
class "GtkScrollbar" style "scrollbar-steppers"
This will make it so whatever our theme is, gtk2 and qt5 will try to show scrollbar steppers. For gtk3, we can add this file:

~/.config/gtk-3.0/gtk.css

Code: Select all

.scrollbar,
scrollbar {
    -GtkScrollbar-has-backward-stepper: 1;
    -GtkScrollbar-has-forward-stepper: 1;
}
This will make it so whatever our theme is, gtk3 will try to show scrollbar steppers. But in gtk3 applications like Catfish or Transmission, why does the scrollbar keep trying to hide when you move the mouse away? This is because of the "gtk overlay scrolling" setting.

2.) Disable scrollbar overlay
To disable this behavior we need to set an environmental variable. This can be done in a number of ways, for consistency here I've decided to do so with a little config file in Xsession.d. As root, add the following file:

/etc/X11/Xsession.d/97scrollbars

Code: Select all

export GTK_OVERLAY_SCROLLING=0
Log out and back in and you're golden!

You may notice qt applications like Featherpad won't actually show the steppers under certain themes such as the default Greybird-mx17, whereas in others like Numix they will. They work either way by clicking where the button is or should be.

Default -
default.png
Default theme with steppers and disabled scrollbar overlay -
mod1.png
Numix theme with steppers and disabled scrollbar overlay -
mod2.png

Re: Enable classic scrollbars (add steppers and disable overlay)

Posted: Mon Aug 06, 2018 8:36 am
by thomasl
@rich: Thanks for that from a Windows exilé. I could not find a theme that I liked and that had classic scrollbars... this helped!