summaryrefslogtreecommitdiffstats
path: root/scripts/gtk3/theme-adwaita
blob: 30f2feed14e2e000fa28a8619c45c43d8c5322a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# vim: ft=sh
THEME_DIR="/usr/share/themes/Adwaita"
THEME_BASEROOT="/org/gnome/adwaita/"

# tested with
# adwaita-gtk3-theme-3.10.0-1.fc20.x86_6 + gtk3-3.10.6-1.fc20.x86_64
#
# TODO:
# menus eligibility still suboptimal
# pcmanfm: text under file/dir icons also not eligible as well

theme_customize() {
	local gr_files=$1

	local src=${gr_files}/gtk-main-dark.css
	local dst=~/.config/gtk-3.0/gtk.css
	local fg_color='#cccccc'
	# local tooltip_fg_color='#eeeeec'  # does not seem to have any effect
	local tooltip_bg_color='@menu_bg_color'  # change this instead

	# first backup existing per-user gtk.css
	mv -f --backup=t ${dst}{,.backup} 2>/dev/null || :
	cat \
	  <(sed "${src}" \
	    -e "s|\(\s*@define-color\s\+theme_fg_color\s\+\).*;|\1${fg_color};|") \
          <(echo "@define-color theme_tooltip_fg_color ${tooltip_bg_color};") \
	  > "${dst}"
}

## when settings.ini was still fully-fledged tool (before 3.8)...
#theme_customize() {
#    local gr_files=$1
#
#    local src=${THEME_DIR}/gtk-3.0/settings.ini
#    local dst=~/.config/gtk-3.0/settings.ini
#    local fg_color='#cccccc'
#    local tooltip_fg_color='#eeeeec'
#
#    # first backup existing per-user gtk.css
#    mv -f --backup=t "${dst}{,.backup}" 2>/dev/null || :
#    sed "${src}" \
#      -e "s|^\(\s*gtk-color-scheme\s\+=.*\\\\nfg_color:\)[^;\\]\+\([;\\].*\)$|\1${fg_color}\2|" \
#      -e "s|^\(\s*gtk-color-scheme\s\+=.*\\\\ntooltip_fg_color:\)[^;\\]\+\([;\\].*\)$|\1${tooltip_fg_color}\2|" \
#      > "${dst}"
#}