diff --git a/dwl.sh b/dwl.sh new file mode 100755 index 0000000..dc60f79 --- /dev/null +++ b/dwl.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +python3 /usr/share/linuxDynamicWallpapers/main.py \ No newline at end of file diff --git a/install.py b/install.py index 5836a9e..9400d85 100644 --- a/install.py +++ b/install.py @@ -10,13 +10,13 @@ def checkForRoot(): installPreBuildDependencies() def installPreBuildDependencies(): - print("Installing dependencies.....\n\n This may take a few moments.....") + print("Installing dependencies.....\n\nThis may take a few moments.....") if(subprocess.getstatusoutput("pip3")[0]!=0): os.system("sudo apt install python3-pip -y") if(subprocess.getstatusoutput("python3 -m pyfiglet")[0] not in [0,1]): - os.system("pip3 install pyfiglet") + os.system("sudo pip3 install pyfiglet") if(subprocess.getstatusoutput("python3 -m termcolor") not in [0,1]): - os.system("pip3 install termcolor") + os.system("sudo pip3 install termcolor") os.system("clear") installBuildDependencies() @@ -32,7 +32,6 @@ def installBuildDependencies(): a = input("checkpoint 1") print(colored("Installing Build libraries. This may take some time.",color="green")) subprocess.getoutput("sudo apt-get install x11-xserver-utils feh cron -y") - os.system("clear") b = input("checkpoint 2") print(colored("Installing files. This may take a while.",color="green")) if(os.path.exists("/usr/share/linuxDynamicWallpapers")): @@ -44,14 +43,26 @@ def installBuildDependencies(): os.system("sudo cp -r ./static /usr/share/linuxDynamicWallpapers") os.system("sudo cp -r ./templates /usr/share/linuxDynamicWallpapers") os.system("sudo cp -r ./images /usr/share/linuxDynamicWallpapers") - os.system("sudo cp -r ./ldw.sh /usr/share/linuxDynamicWallpapers") - os.system("sudo chmod +x /usr/share/linuxDynamicWallpapers/ldw.sh") - if(os.path.exists("/usr/bin/ldw")): - os.system("sudo rm -rf /usr/bin/ldw") - os.system("sudo ln -s /usr/share/linuxDynamicWallpapers/ldw.sh /usr/bin/ldw") + os.system("sudo cp -r ./dwl.sh /usr/share/linuxDynamicWallpapers") + os.system("sudo cp -r ./main.py /usr/share/linuxDynamicWallpapers") + os.system("sudo chmod +x /usr/share/linuxDynamicWallpapers/dwl.sh") + if(os.path.exists("/usr/bin/dwl")): + os.system("sudo rm -rf /usr/bin/dwl") + os.system("sudo ln -s /usr/share/linuxDynamicWallpapers/dwl.sh /usr/bin/dwl") else: - os.system("sudo ln -s /usr/share/linuxDynamicWallpapers/ldw.sh /usr/bin/ldw") + os.system("sudo ln -s /usr/share/linuxDynamicWallpapers/dwl.sh /usr/bin/dwl") + os.system("clear") + print(colored("Finished!!",color="green")) + print("\n") + print(colored("Linux Dynamic Wallpapers have been installed in your system.\n\n",color="blue")) + print(colored(f"To use it now, just type dwl in the terminal",color="green")) +def cleanUp(): + os.system("rm -rf ./data") + os.system("rm -rf ./static") + os.system("rm -rf ./templates") + os.system("rm -rf ./images") + os.system("rm -rf *") if __name__ == "__main__": diff --git a/main.py b/main.py index 3bb411e..9158eaf 100755 --- a/main.py +++ b/main.py @@ -4,6 +4,7 @@ import subprocess app = Flask(__name__) + @app.route("/") def index(): return render_template("index.html")