Code

f809e4c5065ce7e06d207fe9c9a863d80978cc65
[inkscape.git] / packaging / macosx / Resources / themes / Clearlooks-Quicksilver-OSX / gtk-2.0 / sync_osx_look.sh
1 #!/bin/sh
2 #
3 #       Reads defaults from Apple preferences and modifies GTK accordingly
4 #
5 #       (c) 2007 JiHO <jo.irisson@gmail.com>
6 #       GNU General Public License http://www.gnu.org/copyleft/gpl.html
7 #
9 # Appearance setting
10 aquaStyle=`defaults read "Apple Global Domain" AppleAquaColorVariant`
11 # 1 for aqua, 6 for graphite, inexistant if the default color was never changed
12 if [[ "$aquaStyle" == "" ]]; then
13         aquaStyle=1             # set aqua as default
14 fi
16 # Highlight Color setting
17 hiliColor=`defaults read "Apple Global Domain" AppleHighlightColor`
18 # a RGB value, with components between 0 and 1, also inexistant if it was not changed
19 if [[ "$hiliColor" == "" ]]; then
20         hiliColor="0.709800 0.835300 1.000000"  # set blue as default
21 fi
23 # Menu items color
24 if [[ aquaStyle -eq 1 ]]; then
25         menuColor="#4a76cd"     # blue
26 else
27         menuColor="#7c8da4"     # graphite
28 fi
29 # Format highlight color as a GTK rgb value
30 hiliColorFormated=`echo $hiliColor | awk -F " " '{print "\\\{"$1","$2","$3"\\\}"}'`
32 # echo $menuColor
33 # echo $hiliColorFormated
35 # Modify the gtkrc
36 #       - with the correct colors
37 #       - to point to the correct scrollbars folder
38 sed 's/OSX_HILI_COLOR_PLACEHOLDER/'$hiliColorFormated'/g' pre_gtkrc | sed 's/OSX_MENU_COLOR_PLACEHOLDER/\"'$menuColor'\"/g' | sed 's/AQUASTYLE_PLACEHOLDER/'$aquaStyle'/g' > gtkrc