This repository has been archived by the owner on Dec 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
color.sh
executable file
·113 lines (95 loc) · 4.01 KB
/
color.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
directory=$HOME'/.themes/xfcolorize/'
new_window_color=$1
new_ancent_color=$2
new_ancent2_color=$3
INKSCAPE=/usr/bin/inkscape
SVG="$directory"gtk-2.0/assets_fix.svg
LISTFILE="$directory"gtk-2.0/assets.txt
SRC_FILE="$directory"gtk-3.0/assets_fix.svg
ASSETS_DIR="$directory"gtk-3.0/assets
ASSETS_DIR20="$directory"gtk-3.20/assets
ASSETS_DIR22="$directory"gtk-3.22/assets
INDEX="$directory"gtk-3.0/assets.txt
WM_LIST="$directory"xfwm4/list.txt
RM_ASSETS_GTK_3="$directory"gtk-3.0/rm_assets.txt
RM_ASSETS_GTK_2="$directory"gtk-2.0/rm_assets.txt
echo Removing Theme Files
rm -rf $directory
echo Copying Theme Files
cp -r dotfiles/.themes/xfcolorize/ $HOME'/.themes/'
cp -r dotfiles/.config/termite/ $HOME'/.config/'
echo Changing window color
find "$directory"xfwm4/ -type f -exec sed -i s/"window_color"/"$new_window_color"/g {} \;
echo Changing GTK ancent color
find "$directory"gtk-2.0/ -type f -exec sed -i s/"window_color"/"$new_window_color"/g {} \;
sed -i s/"window_color"/"$new_window_color"/g "$directory"gnome-shell/gnome-shell.css
sed -i s/"ancent_color"/"$new_window_color"/g "$directory"gnome-shell/gnome-shell.css
sed -i s/"ancent_color"/"$new_ancent_color"/g "$directory"gtk-3.0/gtk.css
sed -i s/"ancent_color"/"$new_ancent_color"/g "$directory"gtk-3.20/gtk.css
sed -i s/"ancent_color"/"$new_ancent_color"/g "$directory"gtk-3.22/gtk.css
sed -i s/"window_color"/"$new_window_color"/g "$directory"gtk-3.0/gtk.css
sed -i s/"window_color"/"$new_window_color"/g "$directory"gtk-3.20/gtk.css
sed -i s/"window_color"/"$new_window_color"/g "$directory"gtk-3.22/gtk.css
sed -i s/"ancent_color"/"$new_ancent_color"/g "$directory"gtk-2.0/assets_fix.svg
sed -i s/"ancent_color"/"$new_ancent_color"/g "$directory"gtk-2.0/3rd-party.rc
sed -i s/"ancent_color"/"$new_ancent_color"/g "$directory"gtk-3.0/assets_fix.svg
echo Changing termite background color
sed -i s/"window_color"/"$new_window_color"/g "$HOME"/.config/termite/config
echo Changing wishker menu color
sed -i s/"window_color"/"$new_window_color"/g "$HOME"/.gtkrc-2.0.mine
sed -i s/"ancent_color"/"$new_ancent_color"/g "$HOME"/.gtkrc-2.0.mine
echo Changing notification color
find "$directory"xfce-notify-4.0/ -type f -exec sed -i s/"window_color"/"$new_window_color"/g {} \;
find "$directory"xfce-notify-4.0/ -type f -exec sed -i s/"ancent_color"/"$new_ancent_color"/g {} \;
find "$directory"xfce-notify-4.0/ -type f -exec sed -i s/"ancent2_color"/"$new_ancent2_color"/g {} \;
for wmwm in `cat $WM_LIST`
do
sed -i s/"window_color"/"$new_window_color"/g "$directory"xfwm4/$wmwm
done
echo Rendering assets
for assets_del in `cat $RM_ASSETS_GTK_3`
do
rm "$ASSETS_DIR"/"$assets_del".png
rm "$ASSETS_DIR"/"$assets_del"@2.png
rm "$ASSETS_DIR20"/"$assets_del".png
rm "$ASSETS_DIR20"/"$assets_del"@2.png
rm "$ASSETS_DIR22"/"$assets_del".png
rm "$ASSETS_DIR22"/"$assets_del"@2.png
done
for del_assets in `cat $RM_ASSETS_GTK_2`
do
rm "$directory"gtk-2.0/$del_assets.png
done
for filename in `cat $LISTFILE`
do
DIR=`echo $filename | cut -f1 -d '/'`
echo Rendering "$directory"gtk-2.0/"$filename".png
ID=`echo $filename | tr '/' '_'`
$INKSCAPE $SVG --export-id=$ID -e "$directory"gtk-2.0/"$filename".png &>/dev/null
#fi
done
rm -rf "$ASSETS_DIR20"/*
rm -rf "$ASSETS_DIR22"/*
for i in `cat $INDEX`
do
echo Rendering $ASSETS_DIR/$i.png
$INKSCAPE --export-id=$i \
--export-id-only \
--export-png=$ASSETS_DIR/$i.png $SRC_FILE &>/dev/null #\
echo Rendering $ASSETS_DIR/$i@2.png
$INKSCAPE --export-id=$i \
--export-dpi=180 \
--export-id-only \
--export-png=$ASSETS_DIR/$i@2.png $SRC_FILE &>/dev/null #\
done
cp "$ASSETS_DIR"/* "$ASSETS_DIR20"/
cp "$ASSETS_DIR"/* "$ASSETS_DIR22"/
echo Applying theme
xfconf-query -c xfwm4 -p /general/theme -s "adwaita"
xfconf-query -c xfwm4 -p /general/theme -s "xfcolorize"
xfconf-query -c xsettings -p /Net/ThemeName -s "adwaita"
xfconf-query -c xsettings -p /Net/ThemeName -s "xfcolorize"
xfconf-query -c xfce4-notifyd -p /theme -s "xfcolorize"
echo Restarting panel
xfce4-panel -r &> /dev/null