summaryrefslogtreecommitdiffstats
path: root/scripts/gtk3/gtk3-fix.sh
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-04-11 19:11:33 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-04-11 19:12:38 +0200
commited587b4b935f8956407df4f718ebf6a35daafaa3 (patch)
tree5c5a770b2f66071838262fc09e17e99c5a568c8f /scripts/gtk3/gtk3-fix.sh
parent23297186eb781079c4bf576e6563b62ec6fd9a16 (diff)
downloaddotfiles-ed587b4b935f8956407df4f718ebf6a35daafaa3.tar.gz
dotfiles-ed587b4b935f8956407df4f718ebf6a35daafaa3.tar.xz
dotfiles-ed587b4b935f8956407df4f718ebf6a35daafaa3.zip
Adjust gkt-3.0 theme customization incl. script for automation
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'scripts/gtk3/gtk3-fix.sh')
-rwxr-xr-xscripts/gtk3/gtk3-fix.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/gtk3/gtk3-fix.sh b/scripts/gtk3/gtk3-fix.sh
new file mode 100755
index 0000000..acc55b1
--- /dev/null
+++ b/scripts/gtk3/gtk3-fix.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+# credit:
+# http://tacticalvim.wordpress.com/2013/01/05/using-the-adwaita-gtk3-theme-with-xfce-and-lightdm/
+#
+# to be run as root, not user related
+
+GR_FILE="/usr/share/themes/Adwaita/gtk-3.0/gtk.gresource"
+GR_BASEDIR="$(dirname "${GR_FILE}")"
+GR_BASEROOT="/org/gnome/adwaita/"
+GR_FILES="${GR_BASEDIR}/files"
+
+mkdir "${GR_FILES}"
+pushd "${GR_FILES}" >/dev/null || exit
+
+for RSRC in $(gresource list $GR_FILE); do
+ RSRC_FILE="$(echo "${RSRC#$GR_BASEROOT}")"
+ mkdir -p "$(dirname "$RSRC_FILE")" ||:
+ gresource extract "$GR_FILE" "$RSRC" > "$RSRC_FILE"
+done
+
+find "${GR_BASEDIR}" -maxdepth 1 -name '*.css' -print0 | xargs -0 -I '{}' \
+ sed -i.bck \
+ -e "s|^\(@import\s\+url\s*(\s*\"\)resource://${GR_BASEROOT}\(.*\)|\1file:///${GR_FILES}/\2|" \
+ '{}'
+
+popd >/dev/null