Skip to content

Commit

Permalink
added linux compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
epicX67 committed Apr 13, 2020
1 parent 213be1b commit 2a8f4b1
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 67 deletions.
27 changes: 0 additions & 27 deletions cleanup.cpp

This file was deleted.

16 changes: 16 additions & 0 deletions cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
#Deleting out dir
if [ -d "out/" ]
then
rm -rf out
fi
#Deleting theme
if [ -f "theme.stheme" ]
then
rm -rf theme.stheme
fi
#Deleting theme.zip if accidentally created
if [ -f "theme.zip" ]
then
rm -rf theme.zip
fi
3 changes: 0 additions & 3 deletions final.cmd

This file was deleted.

9 changes: 9 additions & 0 deletions final.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
dir="$(pwd)"
cd out
zip -r theme.zip *
mv theme.zip $dir/theme.stheme

#7za a $dir/t.zip *
#7za a theme.zip ./out/*
#mv theme.zip theme.stheme
30 changes: 16 additions & 14 deletions src/main/java/com/shrp/themes/Operation.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,40 +133,42 @@ boolean genarateResource()throws IOException{
}
void finalTask() throws IOException{
Runtime run = Runtime.getRuntime();
run.exec("x.exe");
run.exec("final.cmd");
String cmd[]={"sh","x.sh"};
String cmd2[]={"sh","final.sh"};
run.exec(cmd);
run.exec(cmd2);
}
void buildEnv()throws IOException{//Creates Build Env
File dir=new File("out");
dir.mkdir();
dir=new File("out\\res\\");
dir=new File("out/res/");
dir.mkdir();
FileWriter mData = new FileWriter("out\\st.prop");
FileWriter mData = new FileWriter("out/st.prop");
mData.write("themeName="+themeName+"\nbgColor="+backgroundColor+"\naccColor="+primaryAccentColor+"\ntextColor="+textColor+"\nsTextColor="+stextColor);
mData.flush();
mData.close();
}
void patchStockFile()throws IOException{
PngTinter p=new PngTinter("files\\accRes\\","out\\res\\");
PngTinter p=new PngTinter("files/accRes/","out/res/");
if(gradientType!=0){
p.applyTint(accColor1,accColor2,gradientType);
}else{
p.applyTint(accColor1);
}
p=new PngTinter("files\\bgRes\\","out\\res\\");
p=new PngTinter("files/bgRes/","out/res/");
p.applyTint(backgroundColor);
switch(dashType){
case 1:
p=new PngTinter("files\\dIco\\dt1\\","out\\res\\");
p=new PngTinter("files/dIco/dt1/","out/res/");
break;
case 2:
p=new PngTinter("files\\dIco\\dt2\\","out\\res\\");
p=new PngTinter("files/dIco/dt2/","out/res/");
break;
case 3:
p=new PngTinter("files\\dIco\\dt3\\","out\\res\\");
p=new PngTinter("files/dIco/dt3/","out/res/");
break;
case 4:
p=new PngTinter("files\\dIco\\dt4\\","out\\res\\");
p=new PngTinter("files/dIco/dt4/","out/res/");
break;
}
if(rMode==1&&gradientType!=0){
Expand All @@ -180,16 +182,16 @@ void patchStockFile()throws IOException{
}
switch(navType){
case 1:
p=new PngTinter("files\\nIco\\nt1\\","out\\res\\");
p=new PngTinter("files/nIco/nt1/","out/res/");
break;
case 2:
p=new PngTinter("files\\nIco\\nt2\\","out\\res\\");
p=new PngTinter("files/nIco/nt2/","out/res/");
break;
case 3:
p=new PngTinter("files\\nIco\\nt3\\","out\\res\\");
p=new PngTinter("files/nIco/nt3/","out/res/");
break;
case 4:
p=new PngTinter("files\\nIco\\nt4\\","out\\res\\");
p=new PngTinter("files/nIco/nt4/","out/res/");
break;
}
if(gradientType!=0){
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/shrp/themes/main.java
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,8 @@ boolean genarateTheme()throws IOException{
}
void cleanupTask() throws IOException{
Runtime run = Runtime.getRuntime();
run.exec("cleanup.exe");
String cmd[]={"sh","cleanup.sh"};
run.exec(cmd);
}
void colorParse(String color){
if(color.length()>8){
Expand Down
22 changes: 0 additions & 22 deletions x.cpp

This file was deleted.

2 changes: 2 additions & 0 deletions x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
cp -r in/* out/

0 comments on commit 2a8f4b1

Please sign in to comment.