Skip to content

Commit

Permalink
fix gtk assets not rendered properly
Browse files Browse the repository at this point in the history
  • Loading branch information
reorr committed Nov 12, 2018
1 parent b9c8b81 commit 441fac7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
13 changes: 4 additions & 9 deletions gtk/fantome/gtk-2.0/render-assets.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
#! /bin/bash
#!/bin/bash

INKSCAPE="/usr/bin/inkscape"
OPTIPNG="/usr/bin/optipng"

SRC_FILE="assets.svg"
ASSETS_DIR="assets"

INDEX="listassets.txt"
echo "Rendering gtk2 assets"

for i in `cat $INDEX`
do

if [ -f $ASSETS_DIR/$i.png ]; then
echo Rendering $ASSETS_DIR/$i.png
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 \
&& $OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png
fi

done

cp $ASSETS_DIR/entry-toolbar.png menubar-toolbar/entry-toolbar.png
Expand Down
10 changes: 5 additions & 5 deletions gtk/fantome/gtk-3.0/assets.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions gtk/fantome/gtk-3.0/render-assets.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#! /bin/bash
#!/bin/bash

INKSCAPE="/usr/bin/inkscape"
OPTIPNG="/usr/bin/optipng"

SRC_FILE="assets.svg"
ASSETS_DIR="assets"
INDEX="assets.txt"
echo "Rendering gtk3 assets"

for i in `cat $INDEX`
do
echo Rendering $ASSETS_DIR/$i.png
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 \
&& $OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png
echo Rendering $ASSETS_DIR/$i@2.png
echo "Rendering $ASSETS_DIR/$i@2.png"
$INKSCAPE --export-id=$i \
--export-dpi=180 \
--export-id-only \
Expand Down
19 changes: 13 additions & 6 deletions warnai
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash

dir=$HOME/.themes/colorizer/
dir=$HOME/.themes/warna/
pwd=/usr/bin/pwd
conf=$HOME/.config/
file=$HOME/.Xresources
arr=()
prog_dir=`$pwd`

fill_color(){
get_colors(){
Expand Down Expand Up @@ -42,7 +43,7 @@ ob_themer(){
for i in {1..8}; do
sed -i s/"color_$i"/"$(get_colors $i)"/g "$dir"openbox-3/*;
done
if [[ $(cat $HOME/.config/openbox/rc.xml | grep "colorize") ]]; then
if [[ $(cat $HOME/.config/openbox/rc.xml | grep "warna") ]]; then
openbox --reconfigure
elif [[ $(which obconf) ]]; then
obconf >/dev/null 2>&1
Expand All @@ -67,6 +68,7 @@ gtk_themer(){
find "$dir"gtk-2.0/ -type f -exec sed -i s/"color_bg"/"${get_colors_bg}"/g {} \;
find "$dir"gtk-2.0/menubar-toolbar/ -type f -exec sed -i s/"color_bg"/"${get_colors_bg}"/g {} \;
find "$dir"gtk-3.0/ -type f -exec sed -i s/"color_bg"/"${get_colors_bg}"/g {} \;

for i in {1..8}; do
find "$dir"gtk-2.0/ -type f -exec sed -i s/"color_$i"/"$(get_colors $i)"/g {} \;;
find "$dir"gtk-2.0/menubar-toolbar/ -type f -exec sed -i s/"color_$i"/"$(get_colors $i)"/g {} \;
Expand All @@ -77,9 +79,9 @@ gtk_themer(){
apply_theme(){
echo "Applying theme ..."
xfconf-query -c xfwm4 -p /general/theme -s "adwaita"
xfconf-query -c xfwm4 -p /general/theme -s "colorizer"
xfconf-query -c xfwm4 -p /general/theme -s "warna"
xfconf-query -c xsettings -p /Net/ThemeName -s "adwaita"
xfconf-query -c xsettings -p /Net/ThemeName -s "colorizer"
xfconf-query -c xsettings -p /Net/ThemeName -s "warna"
echo "Done"
notify-send "Done changing theme :)"
}
Expand Down Expand Up @@ -204,8 +206,8 @@ while [[ "$#" -gt 0 ]]; do
done

main() {
if [[ ! -d $HOME/.themes/colorizer ]]; then
mkdir $HOME/.themes/colorizer
if [[ ! -d $HOME/.themes/warna ]]; then
mkdir $HOME/.themes/warna
fi
echo "Generating theme ..."
fill_color
Expand All @@ -218,6 +220,11 @@ main() {
gtk )
#echo "$gtk"
$(gtk_themer $gtk)
cd "$dir"gtk-2.0/
sh "$dir"gtk-2.0/render-assets.sh
cd "$dir"gtk-3.0/
sh "$dir"gtk-3.0/render-assets.sh
cd $prog_dir
;;
tint2 )
#echo "$tint2"
Expand Down

0 comments on commit 441fac7

Please sign in to comment.