Make the GTK2 include self-installing and $HOME-relative
Browse files at this commit377311fc997c3bcabd5d386843a41785798ca6f8Parent: df703de- fix
- make the GTK2 include self-installing and $HOME-relative
1 changed file +10 -6
.config/scripts/shared/theme_colors.shmodified+10 -6
| @@ -6,13 +6,17 @@ | |||
| 6 | # Configure ~/.gtkrc-2.0: | 6 | # Configure ~/.gtkrc-2.0: |
| 7 | # - Force gtk-theme-name to Raleigh (minimal, no pixmap engine, lets our colors through) | 7 | # - Force gtk-theme-name to Raleigh (minimal, no pixmap engine, lets our colors through) |
| 8 | # - Ensure our include is parsed LAST so our styles win | 8 | # - Ensure our include is parsed LAST so our styles win |
| 9 | +# | ||
| 10 | +# nwg-look owns this file when it is installed, but GTK2 will not read our | ||
| 11 | +# generated .mine without the include, and on a fresh machine (or without | ||
| 12 | +# nwg-look) the file does not exist at all — so create it instead of bailing out. | ||
| 9 | GTKRC="$HOME/.gtkrc-2.0" | 13 | GTKRC="$HOME/.gtkrc-2.0" |
| 10 | -MINE_INC='include "/home/tahinli/.gtkrc-2.0.mine"' | 14 | +MINE_INC="include \"$HOME/.gtkrc-2.0.mine\"" |
| 11 | -if [ -f "$GTKRC" ] && grep -qF "$MINE_INC" "$GTKRC"; then | 15 | +[ -f "$GTKRC" ] || : > "$GTKRC" |
| 12 | - grep -vF "$MINE_INC" "$GTKRC" | sed 's/^gtk-theme-name=.*/gtk-theme-name="Raleigh"/' > "$GTKRC.tmp" | 16 | +grep -q '^gtk-theme-name=' "$GTKRC" || echo 'gtk-theme-name="Raleigh"' >> "$GTKRC" |
| 13 | - echo "$MINE_INC" >> "$GTKRC.tmp" | 17 | +grep -vF "$MINE_INC" "$GTKRC" | sed 's/^gtk-theme-name=.*/gtk-theme-name="Raleigh"/' > "$GTKRC.tmp" |
| 14 | - mv "$GTKRC.tmp" "$GTKRC" | 18 | +echo "$MINE_INC" >> "$GTKRC.tmp" |
| 15 | -fi | 19 | +mv "$GTKRC.tmp" "$GTKRC" |
| 16 | 20 | ||
| 17 | # Convert hex colors to KDE's R,G,B integer format in kdeglobals | 21 | # Convert hex colors to KDE's R,G,B integer format in kdeglobals |
| 18 | KDEGLOBALS="$HOME/.config/kdeglobals" | 22 | KDEGLOBALS="$HOME/.config/kdeglobals" |