Update: Fixing GTK3 Scrollbars 2022-01-14
It seems a lot of people don't like GTK's idea of scrollbars. Thanks to mirabilos for providing an updated alternative to what CrispyFPGA and I have here. You can find it here at edugit.org. Maybe give it a try and let me know what ya think eh.
PS: Also thanks to mirabilos for letting me know the link to my about page at the bottom needed to be updated. :-)
Update: Fixing GTK3 Scrollbars 2020-12-30
A while back CrispyFPGA sent me an email about this post and included his own fix that some would consider better than what I have here. This was the email:
I came across your web page about GTK scrollbars after my recent move from Debian Wheezy to Debian Buster. I too was appalled by the horrible scrollbar in the terminal when I first saw it, and immediately tried to find a way to change it. Of course, it wasn't simply a matter of changing a setting somewhere, so I had to roll up my sleeves, and dive into the murky water that is GTK3 CSS.
I finally came up with a scrollbar that is almost identical to the one rendered by GTK2. It's not exactly the same because I can't figure out how to apply a grip image along with a background image, but in every other respect it's the same. I also tried including scroll buttons, but they were mostly useless because the scroll speed was so slow. I ended up leaving them out.
Anyway, I've attached a zip file to this email that contains my CSS and a couple of screenshots of the new terminal with the scrollbar fix. I use the default Xfce theme, so my scrollbars aren't exactly what you want. However, you may find something in my CSS that will give you an idea of how to get what you want.
I used border images to mimic the border and bevel effects of the Xfce GTK2 theme. They're a little tricky at first, but once you understand border slices, then it all makes sense. Here's a link to some info on border slices: https://developer.mozilla.org/en-US/docs/Web/CSS/border-image-slice
I really appreciated the email and asked if I could include the zip file here. He agreed, but life got in the way and I was distracted by all kinds of crap. So, after much too long, here is the zip file! :-)
Fixing GTK3 Scrollbars 2019-03-06
I have been mostly using Debian Jessie and Ubuntu Xenial when setting up desktops lately, both of which are a little older and the GTK+ applications in their repositories are typically GTK+2. I also like to use a very basic desktop environment with just openbox and a few parts of the xfce4 environment. It is very light and it "runs applications", that's all I need a DE to do. Since everyone and their dog seem to think that higher numbers are better I figured I'd try out Buster and see what the fuss is about. The problem is, many of the applications I use are GTK+3 in Buster, and the scrollbars in GTK+3 are just plain crap. Have a look at these two images (click for full size)... the picture on the left shows what scrollbars should look like, and the picture on the right shows the thin weak disappearing garbage that GTK+3 uses by default.
What's worse is that they made it a heinous pain in the ass to switch back to regular scrollbars. With a little help from someone on Snoonet IRC I was able to eventually get my scrollbars to suck less. They're not perfect, but they will probably do the job. Basically I needed to create and/or modify five files to just configure scrollbars. Thanks GTK+ developers. Anyways, here are the problems that need to be fixed, and how to fix them:
- Thin rounded bars with no buttons: To fix this I needed to modify:
- Bars disappear when not in use: ~/.config/openbox/environment
- Bars jump when clicking in trough: ~/.config/gtk-3.0/settings.ini (again)
The .gtkrc-2.0 file is a basic theme setup that was actually made with lxappearance. The gtkrc and gtk.css files are the ones I got some help with on IRC. They basically define the style of the scrollbars. My settings.ini file was also made by lxappearance and the last line is the one that makes the scrollbars stop warping to the place you click (instead they just scroll one page at a time). Finally the environment file is used to make the the scrollbars show even when the window is not currently being scrolled and the mouse is not hovering over it. Rather than screwing with this stuff manually I figured I'd make a script that I can use to quickly fix my scrollbars on new installations. You're welcome to use it, just be aware that it overwrites your existing theme configuration eh. Now... isn't that better?
To be honest, I don't think the buttons at the ends of the scrollbars are quite right, so if anyone knows how to modify the colours of the arrows on the buttons or how to make the arrows appear when the window content is not long enough to activate the scrollbar, I'd love to hear about it.