7

I am using Ubuntu 22.10 Desktop. I have only the default themes installed on my system. Currently, I am using Adwaita (default) which does not have arrows at the two ends of vertical or horizontal window scrollbars.

I have tested the other themes; only HighContrast and HighContrastInverse seem to provide the arrows I need. However, these high contrast themes are not appropriate for me. Adwaita (default) is just fine, except for the missing arrows in scrollbars.

I have tried a few solutions provided on the Internet (like this) that try to create a file like ~/.config/gtk-3.0/gtk.css and put the necessary CSS declarations, but these do not work.

What is the recommended method to locally modify a theme for GTK2 applications and add these scrollbar arrows?

Update

Actually, it turns out that the above-mentioned action does work for GTK3 applications. But, my application that needs these arrows uses GTK2.

I tried locations like ~/.config/gtk-2.0/gtkrc, ~/.gtkrc, and ~/.gtkrc-2.0, but it didn't help.

Editing directly the file /usr/share/themes/Adwaita/gtk-2.0/main.rc and commenting out the lines:

GtkScrollbar::has-backward-stepper = 0
GtkScrollbar::has-forward-stepper = 0

seems to help, but I want to do it on user basis (by setting their values to 1).

FedKad
  • 13,420

1 Answers1

1

If you have put your custom settings in .gtkrc-2.0.mine, but your .gtkrc-2.0 is not including .gtkrc-2.0.mine (or is being overwritten by your DE), then instead include .gtkrc-2.0.mine near the bottom of /usr/share/themes/Adwaita/gtk-2.0/gtkrc

e.g

.
.
# local settings
include "/home/username/.gtkrc-2.0.mine"

And hand over the control to the theme files

include "main.rc" include "apps.rc" include "hacks.rc"

Alternatively, for a global solution, you can change any scroll related settings in /usr/share/themes/Adwaita/gtk-2.0/main.rc

e.g

GtkScrollbar::slider-width = 20
GtkRange::stepper-size = 20
GtkScrollbar::stepper-size         = 20
GtkScrollbar::has-backward-stepper = 1
GtkScrollbar::has-forward-stepper  = 1

Also, comment out the block beneath;

# Disable arrows for qt in scrollbars

otherwise the arrow graphics will be blocked.

Humpity
  • 188
  • 13