Skip to content

Instantly share code, notes, and snippets.

@Chaspen
Created August 18, 2020 19:39
Show Gist options
  • Save Chaspen/fd02b7be51c82e2b0ec3c392244a187f to your computer and use it in GitHub Desktop.
Save Chaspen/fd02b7be51c82e2b0ec3c392244a187f to your computer and use it in GitHub Desktop.
import os, re
def main():
userEnter = input("What distro do you use?: ")
distrosDeb = ["ubuntu", "kubuntu", "lubuntu",
"xubuntu", "debian", "deepin",
"raspbian", "parrot", "sparky",
"mint", "popos", "elementaryos"]
distrosArch = ["arch", "manjaro", "chakra",
"archbang", "parabola",
"endeavouros", "archlabs"]
distrosFed = ["fedora", "centos", "redhat"]
pacmanPackages = ["i3", "polybar", "go", "lua", ""]
pkgArch = " ".join(pacmanPackages)
#ubuntu
if userEnter in distrosDeb:
print("Your distro uses APT, is that correct?")
yn = input()
if yn == "y":
print("Ok, downloading packages...")
os.system("sudo pacman -S " + pkgArch )
elif yn == "n":
print("Canceling...")
os.system("clear")
main()
#arch
elif userEnter in distrosArch:
print("Your distro uses Pacman, is that correct?")
yn = input()
if yn == "y":
print("Ok, downloading packages...")
os.system("sudo apt-get install " + pkgDeb )
elif yn == "n":
print("Canceling...")
os.system("clear")
main()
#fedora
elif userEnter in distrosFed:
print("Your distro uses RPM, is that correct?")
yn = input()
if yn == "y":
print("Ok, downloading packages...")
os.system("rpm -i " + pkgFed )
elif yn == "n":
print("Canceling...")
os.system("clear")
main()
#others
elif userEnter == "void":
print("Your distro is Void, is that correct?")
yn = input()
if yn == "y":
print("Ok, downloading packages...")
os.system("rpm -i " + pkgVoid )
elif yn == "n":
print("Canceling...")
os.system("clear")
main()
#solus
elif userEnter == "solus":
print("Your distro is Solus, is that correct?")
yn = input()
if yn == "y":
print("Ok, downloading packages...")
os.system("rpm -i " + pkgVoid )
elif yn == "n":
print("Canceling...")
os.system("clear")
main()
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment