diff --git a/LibreGaming/LibreGaming.py b/LibreGaming/LibreGaming.py index 8c87a34..afa84f8 100755 --- a/LibreGaming/LibreGaming.py +++ b/LibreGaming/LibreGaming.py @@ -1,240 +1,231 @@ import os, subprocess, argparse, wget, requests - - -#TODO make an option to install specifc packages. - -global distro -distro = ["apt","yay", "paru", "pacman", "dnf", "zypper"] -global PackageManager -dir = os.path.dirname(__file__) -PKGmanScript = os.path.join(dir, 'getPackageManager.sh') # get the path to the package manager script -PackageManager = subprocess.getoutput("sh "+PKGmanScript) # run the script - -rootScript = os.path.join(dir, 'getRoot.sh') # get the path to the root script -global rootCommand -rootCommand = subprocess.getoutput("sh "+rootScript) # gets the rootCommand like sudo doas if both dont exist it will fall back to su - - -def installAllPkgs(): - BasicPkgs() - Lutris() - Heroic() - Overlays() - itch() - - -def BasicPkgs(): - if PackageManager == distro[0]: #packages for Ubuntu and Ubuntu based distros - print("\nNow installing Ubuntu Gaming Packages") - ReleaseCodename = subprocess.getoutput("lsb_release -cs") - Ubuntu = [ - rootCommand + " dpkg --add-architecture i386", - "wget -nc https://dl.winehq.org/wine-builds/winehq.key", - rootCommand + " apt-key add winehq.key", - rootCommand + " add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ " + ReleaseCodename + " main' -y", - rootCommand + " add-apt-repository multiverse -y", - rootCommand + " apt update", - rootCommand + " apt install --install-recommends winehq-staging -y", - rootCommand + " apt install steam winetricks python3-pip gawk curl meson libsystemd-dev pkg-config ninja-build git libdbus-1-dev libinih-dev dbus-user-session libgnutls30:i386 libldap-2.4-2:i386 libgpg-error0:i386 libxml2:i386 libasound2-plugins:i386 libsdl2-2.0-0:i386 libfreetype6:i386 libdbus-1-3:i386 libsqlite3-0:i386 -y" - ] - for i in Ubuntu: - os.system(i) #running each element in Ubuntu array - - elif PackageManager == distro[1] or PackageManager == distro[2]: #packages for Arch and Arch based distros - print("\nNow installing Arch Gaming Packages") #for those who have AUR(yay or paru) enabled - Arch = PackageManager + " -Syu python-pip wine-staging winetricks steam gamemode giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo sqlite lib32-sqlite libxcomposite lib32-libxcomposite libxinerama lib32-libgcrypt libgcrypt lib32-libxinerama ncurses lib32-ncurses opencl-icd-loader lib32-opencl-icd-loader libxslt lib32-libxslt libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs vulkan-icd-loader lib32-vulkan-icd-loader -y --needed --noconfirm" - os.system(Arch) - elif PackageManager == distro[3]: - print("\nNow installing Arch Gaming Packages") - Arch = rootCommand + " pacman -Syu python-pip wine-staging winetricks steam gamemode giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo sqlite lib32-sqlite libxcomposite lib32-libxcomposite libxinerama lib32-libgcrypt libgcrypt lib32-libxinerama ncurses lib32-ncurses opencl-icd-loader lib32-opencl-icd-loader libxslt lib32-libxslt libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs vulkan-icd-loader lib32-vulkan-icd-loader -y --needed --noconfirm" - os.system(Arch) - elif PackageManager == distro[4]: #packages for Fedora - print("\nNow installing Fedora Gaming Packages") - os.system(rootCommand + " dnf install redhat-lsb-core -y") - ReleaseNumber = int(subprocess.getoutput("lsb_release -rs")) - if ReleaseNumber >= 33: - Fedora = [ - "wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks", #installing winetricks here - "chmod +x winetricks", - rootCommand + " mv winetricks /usr/local/bin/", - rootCommand + " dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/"+ str(ReleaseNumber) +"/winehq.repo", - rootCommand + " dnf update -y", - rootCommand + " dnf install python3-pip wine-staging gamemode steam alsa-plugins-pulseaudio.i686 glibc-devel.i686 glibc-devel libgcc.i686 libX11-devel.i686 freetype-devel.i686 libXcursor-devel.i686 libXi-devel.i686 libXext-devel.i686 libXxf86vm-devel.i686 libXrandr-devel.i686 libXinerama-devel.i686 mesa-libGLU-devel.i686 mesa-libOSMesa-devel.i686 libXrender-devel.i686 libpcap-devel.i686 ncurses-devel.i686 libzip-devel.i686 lcms2-devel.i686 zlib-devel.i686 libv4l-devel.i686 libgphoto2-devel.i686 cups-devel.i686 libxml2-devel.i686 openldap-devel.i686 libxslt-devel.i686 gnutls-devel.i686 libpng-devel.i686 flac-libs.i686 json-c.i686 libICE.i686 libSM.i686 libXtst.i686 libasyncns.i686 liberation-narrow-fonts.noarch libieee1284.i686 libogg.i686 libsndfile.i686 libuuid.i686 libva.i686 libvorbis.i686 libwayland-client.i686 libwayland-server.i686 llvm-libs.i686 mesa-dri-drivers.i686 mesa-filesystem.i686 mesa-libEGL.i686 mesa-libgbm.i686 nss-mdns.i686 ocl-icd.i686 pulseaudio-libs.i686 sane-backends-libs.i686 tcp_wrappers-libs.i686 unixODBC.i686 samba-common-tools.x86_64 samba-libs.x86_64 samba-winbind.x86_64 samba-winbind-clients.x86_64 samba-winbind-modules.x86_64 mesa-libGL-devel.i686 fontconfig-devel.i686 libXcomposite-devel.i686 libtiff-devel.i686 openal-soft-devel.i686 mesa-libOpenCL-devel.i686 opencl-utils-devel.i686 alsa-lib-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 pulseaudio-libs-devel.i686 pulseaudio-libs-devel gtk3-devel.i686 libattr-devel.i686 libva-devel.i686 libexif-devel.i686 libexif.i686 glib2-devel.i686 mpg123-devel.i686 mpg123-devel.x86_64 libcom_err-devel.i686 libcom_err-devel.x86_64 libFAudio-devel.i686 libFAudio-devel.x86_64 -y" - ] +from LibreGaming.distro_pkgs.Arch import Arch +from LibreGaming.distro_pkgs.Fedora import Fedora +from LibreGaming.distro_pkgs.OpenSUSE import OpenSUSE +from LibreGaming.distro_pkgs.Ubuntu import Ubuntu +from LibreGaming.distro_pkgs.Common_Pkgs import Common_Pkgs + +class LibreGaming: + """ + Here is where all the magic gets done. + """ + + PackageManager = "" + distro = ["apt","yay", "paru", "pacman", "dnf", "zypper"] + + # Initialize objects + Arch_Object = Arch(None) + Fedora_Object = Fedora() + OpenSUSE_Object = OpenSUSE() + Ubuntu_Object = Ubuntu() + Common_Pkgs_Object = Common_Pkgs() + + # Initialize the Program + def __init__(self): + self.PackageManager = self.getPackageManager() + self.Arch_Object = Arch(self.PackageManager) + + # Gets the package manager + def getPackageManager(self): + if subprocess.getoutput("$(command -v dnf)"): + self.PackageManager = "dnf" + elif subprocess.getoutput("$(command -v yay)"): + self.PackageManager = "yay" + elif subprocess.getoutput("$(command -v paru)"): + self.PackageManager = "paru" + elif subprocess.getoutput("$(command -v pacman)"): + self.PackageManager = "pacman" + elif subprocess.getoutput("$(command -v apt)"): + self.PackageManager = "apt" + elif subprocess.getoutput("$(command -v zypper)"): + self.PackageManager = "zypper" + else: + print("Could not know your distro based on your Package Manager!") + return self.PackageManager + + # To check if LibreGaming is executed with root or not + def whoami(self, authorize): + whoami = str(subprocess.getoutput("whoami")) + if whoami == "root" and authorize == False: + print("\nPlease run LibreGaming without sudo or doas command for this flag") + exit(0) + elif whoami != "root" and authorize == True: + print("\nPlease run LibreGaming with sudo or doas command for this flag") + exit(0) + + # Used to install all packages + def installAllPkgs(self): + self.BasicPkgs() + self.Lutris() + self.Heroic() + self.Overlays() + + #Used to install Steam, Wine-Staging, Gamemode + def BasicPkgs(self): + if self.PackageManager == self.distro[0]: #packages for Ubuntu and Ubuntu based distros + self.whoami(True) + print("\n\tNow Installing Ubuntu Gaming Packages") + for i in self.Ubuntu_Object.Ubuntu_Basics(): + os.system(i) #running each element in Ubuntu array + elif self.PackageManager == self.distro[1] or self.PackageManager == self.distro[2]: #packages for Arch and Arch based distros + self.whoami(False) + print("\n\tNow Installing Arch Gaming Packages") #for those who have AUR(yay or paru) enabled + os.system(self.Arch_Object.Arch_AUR_Basics()) + elif self.PackageManager == self.distro[3]: + self.whoami(True) + print("\n\tNow Installing Arch Gaming Packages") + os.system(self.Arch_Object.Arch_Basics) + elif self.PackageManager == self.distro[4]: #packages for Fedora + self.whoami(True) + os.system("dnf install redhat-lsb-core -y") # used to get the release version of Fedora using "lsb_release -rs" + ReleaseNumber = subprocess.getoutput("lsb_release -rs") + print("\n\tNow Installing Fedora " + ReleaseNumber +" Gaming Packages") + if ReleaseNumber >= '33': + for i in self.Fedora_Object.Fedora_33_Basics: + os.system(i) #running each element in Fedora array from distro_pkgs/Fedora + else: + print("can't install wine-staging because your fedora version is less than 33. installing wine from fedora repo") + for i in self.Fedora_Object.Fedora_32_Basics: + os.system(i) #running each element in Fedora array + elif self.PackageManager == self.distro[5]: #packages for OpenSUSE + self.whoami(True) + print("\n\nNow Installing OpenSUSE Gaming Packages") + for i in self.OpenSUSE_Object.OpenSUSE_Basics: + os.system(i) #running each element in OpenSUSE array + else: + print("\n\tYour distro is not supported or was not found :(") + exit() + + #Used to install Lutris + def Lutris(self): + if self.PackageManager == self.distro[0]: #packages for Ubuntu and Ubuntu based distros + self.whoami(True) + print("\n\tInstalling Lutris for Ubuntu") + for i in self.Ubuntu_Object.Ubuntu_Lutris: + os.system(i) #running each element in Ubuntu array + elif self.PackageManager == self.distro[1] or self.PackageManager == self.distro[2]: + self.whoami(False) + print("\n\tInstalling Lutris for Arch using an AUR helper") + os.system(self.Arch_Object.Arch_Lutris()) + elif self.PackageManager == self.distro[3]: + self.whoami(True) + print("\n\tInstalling Lutris for Arch") + os.system(self.Arch_Object.Arch_Lutris()) + elif self.PackageManager == self.distro[4]: #packages for Fedora + self.whoami(True) + print("\n\tInstalling Lutris for Fedora") + os.system(self.Fedora_Object.Fedora_Lutris) #running each element in Fedora array + elif self.PackageManager == self.distro[5]: #packages for OpenSUSE + self.whoami(True) + print("\n\tInstalling Lutris for OpenSUSE") + os.system(self.OpenSUSE_Object.OpenSUSE_Lutris) + else: + print("\n\tYour distro is not supported or was not found :(") + exit() + + #Used to install Heroic + def Heroic(self): + if self.PackageManager == self.distro[0]: #packages for Ubuntu and Ubuntu based distros + self.whoami(True) + self.Ubuntu_Object.Ubuntu_Heroic() #running each element in Ubuntu array + elif self.PackageManager == self.distro[1] or self.PackageManager == self.distro[2]: #packages for Arch and Arch based distros + self.whoami(False) + print("\n\tInstalling Heroic for Arch") + os.system(self.Arch_Object.Arch_AUR_Heroic()) + elif self.PackageManager == self.distro[3]: + self.whoami(True) + print("\n\tYou need to have AUR helpers like yay,paru to install Heroic") + elif self.PackageManager == self.distro[4]: #packages for Fedora + self.whoami(True) + for i in self.Fedora_Object.Fedora_Heroic: + os.system(i) #running each element in Fedora array + elif self.PackageManager == self.distro[5]: #packages for OpenSUSE + self.OpenSUSE_Object.OpenSUSE_Heroic() #running each element in OpenSUSE array + else: + print("\n\tYour distro is not supported or was not found :(") + exit() + + #Used to install MangoHud and Goverlay + def Overlays(self): + if self.PackageManager == self.distro[0]: #packages for Ubuntu and Ubuntu based distros + self.whoami(True) + print("\n\tinstalling Mangohud and Goverlay for Ubuntu") + for i in self.Ubuntu_Object.Ubuntu_Overlay: + os.system(i) #running each element in Ubuntu array + elif self.PackageManager == self.distro[1] or self.PackageManager == self.distro[2]: #packages for Arch and Arch based distros + self.whoami(False) + print("\n\tinstalling Mangohud and Goverlay for Arch") + os.system(self.Arch_Object.Arch_AUR_Overlays()) + elif self.PackageManager == self.distro[3]: + self.whoami(True) + print("\n\tYou need to have AUR helpers like yay,paru to install Mangohud and Goverlay") + elif self.PackageManager == self.distro[4]: #packages for Fedora + self.whoami(True) + print("\n\tinstalling Mangohud and Goverlay for Fedora") + os.system(self.Fedora_Object.Fedora_Overlays) #running each element in Fedora array + elif self.PackageManager == self.distro[5]: #packages for OpenSUSE + self.whoami(True) + print("\n\tinstalling Mangohud and Goverlay for OpenSUSE") + os.system(self.OpenSUSE_Object.OpenSUSE_Overlays) else: - print("Can't install wine-staging Because your Fedora version is less than 33. Installing wine from Fedora repo") - Fedora = [ - "wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks", #installing winetricks here - "chmod +x winetricks", - rootCommand + " mv winetricks /usr/local/bin/", - rootCommand + " dnf update -y", - rootCommand + " dnf install python3-pip wine gamemode steam alsa-plugins-pulseaudio.i686 glibc-devel.i686 glibc-devel libgcc.i686 libX11-devel.i686 freetype-devel.i686 libXcursor-devel.i686 libXi-devel.i686 libXext-devel.i686 libXxf86vm-devel.i686 libXrandr-devel.i686 libXinerama-devel.i686 mesa-libGLU-devel.i686 mesa-libOSMesa-devel.i686 libXrender-devel.i686 libpcap-devel.i686 ncurses-devel.i686 libzip-devel.i686 lcms2-devel.i686 zlib-devel.i686 libv4l-devel.i686 libgphoto2-devel.i686 cups-devel.i686 libxml2-devel.i686 openldap-devel.i686 libxslt-devel.i686 gnutls-devel.i686 libpng-devel.i686 flac-libs.i686 json-c.i686 libICE.i686 libSM.i686 libXtst.i686 libasyncns.i686 liberation-narrow-fonts.noarch libieee1284.i686 libogg.i686 libsndfile.i686 libuuid.i686 libva.i686 libvorbis.i686 libwayland-client.i686 libwayland-server.i686 llvm-libs.i686 mesa-dri-drivers.i686 mesa-filesystem.i686 mesa-libEGL.i686 mesa-libgbm.i686 nss-mdns.i686 ocl-icd.i686 pulseaudio-libs.i686 sane-backends-libs.i686 tcp_wrappers-libs.i686 unixODBC.i686 samba-common-tools.x86_64 samba-libs.x86_64 samba-winbind.x86_64 samba-winbind-clients.x86_64 samba-winbind-modules.x86_64 mesa-libGL-devel.i686 fontconfig-devel.i686 libXcomposite-devel.i686 libtiff-devel.i686 openal-soft-devel.i686 mesa-libOpenCL-devel.i686 opencl-utils-devel.i686 alsa-lib-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 pulseaudio-libs-devel.i686 pulseaudio-libs-devel gtk3-devel.i686 libattr-devel.i686 libva-devel.i686 libexif-devel.i686 libexif.i686 glib2-devel.i686 mpg123-devel.i686 mpg123-devel.x86_64 libcom_err-devel.i686 libcom_err-devel.x86_64 libFAudio-devel.i686 libFAudio-devel.x86_64 -y" - ] - for i in Fedora: - os.system(i) #running each element in Fedora array - elif PackageManager == distro[5]: #packages for OpenSUSE - print("\nNow installing OpenSUSE Gaming Packages") - OpenSUSE = rootCommand + " zypper install steam wine-staging gamemode -y" - os.system(rootCommand + " zypper update -y") - os.system(OpenSUSE) - else: - print("Your distro is not supported or was not found :(") - exit() - -def Lutris(): - if PackageManager == distro[0]: #packages for Ubuntu and Ubuntu based distros - print("\ninstalling Lutris for Ubuntu") - Ubuntu = [ - rootCommand + " dpkg --add-architecture i386", - rootCommand + " add-apt-repository ppa:lutris-team/lutris -y", - rootCommand + " apt update", - rootCommand + " apt install lutris -y" - ] - for i in Ubuntu: - os.system(i) #running each element in Ubuntu array - elif PackageManager == distro[1] or PackageManager == distro[2] or PackageManager == distro[3]: - print("\ninstalling Lutris for Arch") - Arch = rootCommand + " pacman -S python-evdev lutris -y --needed --noconfirm" - os.system(Arch) - elif PackageManager == distro[4]: #packages for Fedora - print("\ninstalling Lutris for Fedora") - Fedora = rootCommand + " dnf install lutris -y" - os.system(Fedora) #running each element in Fedora array - elif PackageManager == distro[5]: #packages for OpenSUSE - print("\ninstalling Lutris for OpenSUSE") - OpenSUSE = rootCommand + " zypper install lutris -y" - os.system(OpenSUSE) - else: - print("Your distro is not supported or was not found :(") - exit() - -def Heroic(): - if PackageManager == distro[0]: #packages for Ubuntu and Ubuntu based distros - print('Downloading Heroic latest dpkg') - url = 'https://api.github.com/repos/Heroic-Games-Launcher/HeroicGamesLauncher/releases/latest' - r = requests.get(url).json() - for i in r['assets']: - if i['name'].endswith('.deb'): - url= i['browser_download_url'] - wget.download(url, "heroic.deb") - os.system(rootCommand + " dpkg -i heroic.deb") - - elif PackageManager == distro[1] or PackageManager == distro[2]: #packages for Arch and Arch based distros - print("\ninstalling Heroic for Arch") - Arch = PackageManager + " -S heroic-games-launcher-bin -y --needed --noconfirm" - os.system(Arch) - elif PackageManager == distro[3]: - print("\nYou need to have AUR helpers like yay,paru to install Heroic") - elif PackageManager == distro[4]: #packages for Fedora - Fedora = [ - rootCommand + " dnf copr enable atim/heroic-games-launcher -y", - rootCommand + " dnf update -y", - rootCommand + " dnf install heroic-games-launcher-bin -y" - ] - for i in Fedora: - os.system(i) #running each element in Fedora array - elif PackageManager == distro[5]: #packages for OpenSUSE - print('Downloading Heroic latest AppImage') - url = 'https://api.github.com/repos/Heroic-Games-Launcher/HeroicGamesLauncher/releases/latest' - r = requests.get(url).json() - for i in r['assets']: - if i['name'].endswith('.AppImage'): - url= i['browser_download_url'] - wget.download(url, "heroic.AppImage") - os.system("chmod +x heroic.AppImage && mv heroic.AppImage ~/Downloads && cd ~/Downloads && ./heroic.AppImage") - else: - print("Your distro is not supported or was not found :(") - exit() - -def Overlays(): - if PackageManager == distro[0]: #packages for Ubuntu and Ubuntu based distros - print("\ninstalling Mangohud and Goverlay for Ubuntu") - Ubuntu = [ - rootCommand + " dpkg --add-architecture i386", - rootCommand + " add-apt-repository ppa:flexiondotorg/mangohud -y", - rootCommand + " apt update", - rootCommand + " apt install goverlay -y" - ] - for i in Ubuntu: - os.system(i) #running each element in Ubuntu array - elif PackageManager == distro[1] or PackageManager == distro[2]: #packages for Arch and Arch based distros - print("\ninstalling Mangohud and Goverlay for Arch") - Arch = PackageManager + " -S goverlay-bin -y --needed --noconfirm" - os.system(Arch) - elif PackageManager == distro[3]: - print("\nYou need to have AUR helpers like yay,paru to install Mangohud and Goverlay") - elif PackageManager == distro[4]: #packages for Fedora - print("\ninstalling Mangohud and Goverlay for Fedora") - Fedora = rootCommand + " dnf install goverlay -y" - os.system(Fedora) #running each element in Fedora array - elif PackageManager == distro[5]: #packages for OpenSUSE - print("\ninstalling Mangohud and Goverlay for OpenSUSE") - OpenSUSE = rootCommand + " zypper install goverlay -y" - os.system(OpenSUSE) - else: - print("Your distro is not supported or was not found :(") - exit() - -def itch(): - print('Downloading itch.io') - os.system("wget 'https://itch.io/app/download?platform=linux' -O itch-setup") - os.system("chmod +x itch-setup && ./itch-setup && wget 'https://itch.io/app/download?platform=linux' -o itch-setup") - -def parse_arguments(): - #Parse commandline arguments - parser = argparse.ArgumentParser(usage="%(prog)s ", description="Install Gaming Packages with ease", - epilog="GPLv3 - Repo : https://github.com/Ahmed-Al-Balochi/LibreGaming.git") - parser.add_argument('-g', '--gaming', action='store_true', help='Install Gaming Packages ') - parser.add_argument('-b', '--basic', action='store_true', help='Install Basic Gaming Packages') - parser.add_argument('-ath', '--athenaeum', action='store_true', help='Install Athenaeum Launcher') - parser.add_argument('-o', '--overlays', action='store_true', help='Install Mangohud & Goverlay') - parser.add_argument('-p', '--proton', action='store_true', help='Install/Update ProtonGE(You must run Steam once before installing ProtonGE)') - parser.add_argument('-l', '--list', action='store_true', help='List installed ProtonGE Releases') - parser.add_argument('-t', '--tag', action='store',type=str, default=None, help='Install a specific ProtonGE Release') - parser.add_argument('-r', '--rem', action='store', type=str, default=None, metavar='TAG', help='remove a specific ProtonGE Release') - parser.add_argument('--releases', action='store_true', help='List ProtonGE Releases') - parser.add_argument('--tui', action='store_true', help='use a Terminal User Interface to install Packages ') - parser.add_argument('--heroic', action='store_true', help='Install Heroic Launcher') - parser.add_argument('--lutris', action='store_true', help='Install lutris Launcher') - parser.add_argument('--itch', action='store_true', help='Install itch.io Launcher') - parser.add_argument('--stl', action='store_true', help='Install Steam Tinker Launch(For Arch Linux only)') - return parser.parse_args() - -def main(): - args = parse_arguments() - if args.tui: - dir = os.path.dirname(__file__) - tui = os.path.join(dir, 'TUI.py') # get the path to the package manager script - os.system("python3 "+tui) - if args.proton: + print("\n\tYour distro is not supported or was not found :(") + exit() + + #Used to install Minigalaxy + def Minigalaxy(self): + if self.PackageManager == self.distro[0]: #packages for Ubuntu and Ubuntu based distros + self.whoami(True) + print("\n\tinstalling Minigalaxy for Ubuntu") + os.system(self.Ubuntu_Object.Ubuntu_Minigalaxy) + elif self.PackageManager == self.distro[1] or self.PackageManager == self.distro[2]: #packages for Arch and Arch based distros + self.whoami(False) + print("\n\tinstalling Minigalaxy for Arch") + os.system(self.Arch_Object.Arch_AUR_Minigalaxy()) + elif self.PackageManager == self.distro[3]: + self.whoami(True) + print("\n\tYou need to have AUR helpers like yay,paru to install Minigalaxy") + elif self.PackageManager == self.distro[4]: #packages for Fedora + self.whoami(True) + print("\n\tinstalling Minigalaxy for Fedora") + os.system(self.Fedora_Object.Fedora_Minigalaxy) #running each element in Fedora array + elif self.PackageManager == self.distro[5]: #packages for OpenSUSE + self.whoami(True) + print("\n\tinstalling Minigalaxy for OpenSUSE") + os.system(self.OpenSUSE_Object.OpenSUSE_Minigalaxy) + else: + print("\n\tYour distro is not supported or was not found :(") + exit() + + #Used to install Steam Tinker Lanuch for Arch Linux(AUR) + def STL(self): + self.whoami(False) + if self.PackageManager == self.distro[1] or self.PackageManager == self.distro[2]: #packages for Arch and Arch based distros + print("\n\tinstalling Steam Tinker Lanuch for Arch") + os.system(self.Arch_Object.Arch_AUR_STL()) + elif self.PackageManager == self.distro[3]: + print("\n\tYou need to have AUR helpers like yay,paru to install Heroic") + + #Used to install to install the latest ProtonGE release + def protonup_Install_Latest(self): + self.whoami(False) os.system("protonup") - if args.releases: + + #Used to install to show the ProtonGE releases + def protonup_Show_Releases(Self): + self.whoami(False) os.system("protonup --releases") - if args.list: + + #Used to install to list all installed ProtonGE on your system + def protonup_List(Self): + self.whoami(False) os.system("protonup -l") - if args.tag: + + #Used to install a specific ProtonGE + def protonup_Install_Specific(Self): + self.whoami(False) os.system("protonup -t " + args.tag) - if args.rem: + + #Used to remove a specific ProtonGE + def protonup_Remove(Self): + self.whoami(False) os.system("protonup -r " + args.rem) - if args.gaming: - installAllPkgs() - if args.basic: - BasicPkgs() - if args.overlays: - Overlays() - if args.lutris: - Lutris() - if args.heroic: - Heroic() - if args.itch: - itch() - if args.stl: - if PackageManager == distro[1] or PackageManager == distro[2]: #packages for Arch and Arch based distros - print("\ninstalling Heroic for Arch") - os.system(PackageManager + " -S steamtinkerlaunch -y --needed --noconfirm") - elif PackageManager == distro[3]: - print("\nYou need to have AUR helpers like yay,paru to install Heroic") - if args.athenaeum: - os.system("flatpak install flathub com.gitlab.librebob.Athenaeum -y") - -if __name__ == "__main__": - main() diff --git a/LibreGaming/TUI.py b/LibreGaming/TUI.py index ce1cfbf..42dda35 100644 --- a/LibreGaming/TUI.py +++ b/LibreGaming/TUI.py @@ -56,19 +56,19 @@ def installingApps(installApps): for i in installApps: if i == "1": print("\n==>> Executing Option " + str(i) + "\n") - os.system("libregaming -b") + os.system("pkexec libregaming -b") continue elif i == "2": print("\n==>> Executing Option " + str(i) + "\n") - os.system("libregaming --lutris") + os.system("pkexec libregaming --lutris") continue elif i == "3": print("\n==>> Executing Option " + str(i) + "\n") - os.system("libregaming --heroic") + os.system("pkexec libregaming --heroic") continue elif i == "4": print("\n==>> Executing Option " + str(i) + "\n") - os.system("libregaming -o") + os.system("pkexec libregaming -o") continue elif i == "5": print("\n==>> Executing Option " + str(i) + "\n") @@ -84,7 +84,7 @@ def installingApps(installApps): continue elif i == "8": print("\n==>> Executing Option " + str(i) + "\n") - os.system("libregaming --stl") + os.system("pkexec libregaming --stl") continue elif i == "9": MainForm() @@ -98,11 +98,11 @@ def MainForm(): for i in installOption: if i == "1": print("\n==>> Executing Option " + str(i) + "\n") - os.system("libregaming -g") + os.system("pkexec libregaming -g") continue elif i == "2": print("\n==>> Executing Option " + str(i) + "\n") - os.system("libregaming -b") + os.system("pkexec libregaming -b") continue elif i == "3": print("\n==>> Executing Option " + str(i) + "\n") @@ -118,7 +118,7 @@ def MainForm(): continue elif i == "6": print("\n==>> Executing Option " + str(i) + "\n") - os.system("libregaming --stl") + os.system("pkexec libregaming --stl") continue elif i == "7": installApps= (npyscreen.wrapper_basic(WizardScreen)) diff --git a/LibreGaming/__init__.py b/LibreGaming/__init__.py index 2880eec..4635c92 100644 --- a/LibreGaming/__init__.py +++ b/LibreGaming/__init__.py @@ -1,3 +1,3 @@ def main(): - from .LibreGaming import main + from .__main__ import main return main() \ No newline at end of file diff --git a/LibreGaming/__main__.py b/LibreGaming/__main__.py index a3bec3a..08b01bd 100644 --- a/LibreGaming/__main__.py +++ b/LibreGaming/__main__.py @@ -1,2 +1,64 @@ -from .LibreGaming import main -main() \ No newline at end of file +from .LibreGaming import LibreGaming +import os, argparse + +#Parse commandline arguments +def parse_arguments(): + parser = argparse.ArgumentParser(usage="%(prog)s ", description="Install Gaming Packages with ease", + epilog="GPLv3 - Repo : https://github.com/Ahmed-Al-Balochi/LibreGaming.git") + parser.add_argument('-g', '--gaming', action='store_true', help='Install all the Gaming Packages(Steam,Wine-Staging,Gamemode,Lutris,Heroic,MangoHud & Goverlay)') + parser.add_argument('-b', '--basic', action='store_true', help='Install Basic Gaming Packages(Steam,Wine-Staging,Gamemode)') + parser.add_argument('-ath', '--athenaeum', action='store_true', help='Install Athenaeum Launcher') + parser.add_argument('-o', '--overlays', action='store_true', help='Install Mangohud & Goverlay') + parser.add_argument('-p', '--proton', action='store_true', help='Install/Update ProtonGE(You must run Steam once before installing ProtonGE)') + parser.add_argument('-l', '--list', action='store_true', help='List installed ProtonGE Releases') + parser.add_argument('-t', '--tag', action='store',type=str, default=None, help='Install a specific ProtonGE Release') + parser.add_argument('-r', '--rem', action='store', type=str, default=None, metavar='TAG', help='remove a specific ProtonGE Release') + parser.add_argument('--releases', action='store_true', help='List ProtonGE Releases') + parser.add_argument('--tui', action='store_true', help='use a Terminal User Interface to install Packages ') + parser.add_argument('--heroic', action='store_true', help='Install Heroic Launcher') + parser.add_argument('--lutris', action='store_true', help='Install Lutris Launcher') + parser.add_argument('--minigalaxy', action='store_true', help='Install Minigalaxy Launcher') + parser.add_argument('--itch', action='store_true', help='Install itch.io Launcher') + parser.add_argument('--stl', action='store_true', help='Install Steam Tinker Launch(For Arch Linux only)') + return parser.parse_args() + +# Main execution +def main(): + LibreGaming_Object = LibreGaming() + args = parse_arguments() + if args.tui: + dir = os.path.dirname(__file__) + # Gets the path to the TUI.py file + tui = os.path.join(dir, 'TUI.py') + os.system("python3 "+tui) + if args.proton: + LibreGaming_Object.protonup_Install_Latest() + if args.releases: + LibreGaming_Object.protonup_Show_Releases() + if args.list: + LibreGaming_Object.protonup_List() + if args.tag: + LibreGaming_Object.protonup_Install_Specific() + if args.rem: + LibreGaming_Object.protonup_Remove() + if args.gaming: + LibreGaming_Object.installAllPkgs() + if args.basic: + LibreGaming_Object.BasicPkgs() + if args.overlays: + LibreGaming_Object.Overlays() + if args.lutris: + LibreGaming_Object.Lutris() + if args.minigalaxy: + LibreGaming_Object.Minigalaxy() + if args.heroic: + LibreGaming_Object.Heroic() + if args.itch: + LibreGaming_Object.Common_Pkgs_Object.itch() + if args.stl: + LibreGaming_Object.STL() + if args.athenaeum: + LibreGaming_Object.Common_Pkgs_Object.Athenaeum() + +if __name__ == "__main__": + main() diff --git a/LibreGaming/distro_pkgs/Arch.py b/LibreGaming/distro_pkgs/Arch.py new file mode 100644 index 0000000..95fd61b --- /dev/null +++ b/LibreGaming/distro_pkgs/Arch.py @@ -0,0 +1,53 @@ +import subprocess + +class Arch: + """ + Here are all the pkgs that LibreGaming installs for Arch Linux + """ + +# Saves the Arch package manager or AUR helpers. For example: pacman, yay + PackageManager = "" + +# For installing Basic Packages like Steam, Wine, Gamemode. For those not using an AUR Helper + Arch_Basics = " pacman -Syu python-pip wine-staging winetricks steam gamemode giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo sqlite lib32-sqlite libxcomposite lib32-libxcomposite libxinerama lib32-libgcrypt libgcrypt lib32-libxinerama ncurses lib32-ncurses opencl-icd-loader lib32-opencl-icd-loader libxslt lib32-libxslt libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs vulkan-icd-loader lib32-vulkan-icd-loader -y --needed --noconfirm" + +# For installing Lutris + def Arch_Lutris(self): + Install_Lutris = self.PackageManager + " -S python-evdev lutris -y --needed --noconfirm" + return Install_Lutris + + # The PackageManager variable uses the updated PackageManager only in functions. otherwise its values will be blank + def Arch_AUR_Basics(self): + AUR_Basics = self.PackageManager + " -Syu python-pip wine-staging winetricks steam gamemode giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo sqlite lib32-sqlite libxcomposite lib32-libxcomposite libxinerama lib32-libgcrypt libgcrypt lib32-libxinerama ncurses lib32-ncurses opencl-icd-loader lib32-opencl-icd-loader libxslt lib32-libxslt libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs vulkan-icd-loader lib32-vulkan-icd-loader -y --needed --noconfirm" + return AUR_Basics + +# For installing Minigalaxy + def Arch_AUR_Minigalaxy(self): + AUR_Minigalaxy = self.PackageManager + " -S minigalaxy -y --needed --noconfirm" + return AUR_Minigalaxy + +# For installing Heroic + def Arch_AUR_Heroic(self): + AUR_Heroic = self.PackageManager + " -S heroic-games-launcher-bin -y --needed --noconfirm" + return AUR_Heroic + +# For installing The FPS programs and overlays + def Arch_AUR_Overlays(self): + AUR_Overlays = self.PackageManager + " -S pkg-config cmake goverlay-bin -y --needed --noconfirm" + return AUR_Overlays + +# For installing Steam Tinker Lanuch + def Arch_AUR_STL(self): + AUR_STL = self.PackageManager + " -S steamtinkerlaunch -y --needed --noconfirm" + return AUR_STL + + def __init__(self, PackageManager): + if PackageManager == "yay" or PackageManager == "paru": + whoami = str(subprocess.getoutput("whoami")) + if whoami == "root": + print("\n\tPlease run LibreGaming without the sudo or doas command if you use an AUR Helper\n") + exit(0) + else: + self.PackageManager = PackageManager + else: + self.PackageManager = PackageManager \ No newline at end of file diff --git a/LibreGaming/distro_pkgs/Common_Pkgs.py b/LibreGaming/distro_pkgs/Common_Pkgs.py new file mode 100644 index 0000000..17877e6 --- /dev/null +++ b/LibreGaming/distro_pkgs/Common_Pkgs.py @@ -0,0 +1,28 @@ +import os, subprocess + +class Common_Pkgs: + """ + Here are all the pkgs that are distro agnostic + """ + + # TO check if LibreGaming is executed with root or not + def whoami(self, authorize): + whoami = str(subprocess.getoutput("whoami")) + if whoami == "root" and authorize == False: + print("\n\tPlease run LibreGaming without sudo or doas command for this flag\t") + exit(0) + elif whoami != "root" and authorize == True: + print("\n\tPlease run LibreGaming with sudo or doas command for this flag\n") + exit(0) + + # installation for Itch.io store + def itch(self): + self.whoami(False) + print('Downloading itch.io') + os.system("wget 'https://itch.io/app/download?platform=linux' -O itch-setup") + os.system("chmod +x itch-setup && ./itch-setup") + + # installation for Athenaeum store For FOSS games + def Athenaeum(self): + self.whoami(False) + os.system("flatpak install flathub com.gitlab.librebob.Athenaeum -y") diff --git a/LibreGaming/distro_pkgs/Fedora.py b/LibreGaming/distro_pkgs/Fedora.py new file mode 100644 index 0000000..3a4bf6d --- /dev/null +++ b/LibreGaming/distro_pkgs/Fedora.py @@ -0,0 +1,43 @@ +import subprocess + +class Fedora: + """ + Here are all the pkgs that LibreGaming installs for Fedora + """ + +# For installing Minigalaxy + Fedora_Minigalaxy = " dnf install minigalaxy -y" + +# For fedora 33 and above +# For installing Basic Packages like Steam, Wine, Gamemode +# ReleaseNumber Saves the Fedora release number. For example: Fedora 35 + Fedora_33_Basics = [ + "wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks", #installing winetricks here + "chmod -744 winetricks", + "mv winetricks /usr/local/bin/", + "dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/"+ str(subprocess.getoutput("lsb_release -rs")) +"/winehq.repo", + "dnf update -y", + "dnf install python3-pip wine-staging gamemode steam alsa-plugins-pulseaudio.i686 glibc-devel.i686 glibc-devel libgcc.i686 libX11-devel.i686 freetype-devel.i686 libXcursor-devel.i686 libXi-devel.i686 libXext-devel.i686 libXxf86vm-devel.i686 libXrandr-devel.i686 libXinerama-devel.i686 mesa-libGLU-devel.i686 mesa-libOSMesa-devel.i686 libXrender-devel.i686 libpcap-devel.i686 ncurses-devel.i686 libzip-devel.i686 lcms2-devel.i686 zlib-devel.i686 libv4l-devel.i686 libgphoto2-devel.i686 cups-devel.i686 libxml2-devel.i686 openldap-devel.i686 libxslt-devel.i686 gnutls-devel.i686 libpng-devel.i686 flac-libs.i686 json-c.i686 libICE.i686 libSM.i686 libXtst.i686 libasyncns.i686 liberation-narrow-fonts.noarch libieee1284.i686 libogg.i686 libsndfile.i686 libuuid.i686 libva.i686 libvorbis.i686 libwayland-client.i686 libwayland-server.i686 llvm-libs.i686 mesa-dri-drivers.i686 mesa-filesystem.i686 mesa-libEGL.i686 mesa-libgbm.i686 nss-mdns.i686 ocl-icd.i686 pulseaudio-libs.i686 sane-backends-libs.i686 tcp_wrappers-libs.i686 unixODBC.i686 samba-common-tools.x86_64 samba-libs.x86_64 samba-winbind.x86_64 samba-winbind-clients.x86_64 samba-winbind-modules.x86_64 mesa-libGL-devel.i686 fontconfig-devel.i686 libXcomposite-devel.i686 libtiff-devel.i686 openal-soft-devel.i686 mesa-libOpenCL-devel.i686 opencl-utils-devel.i686 alsa-lib-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 pulseaudio-libs-devel.i686 pulseaudio-libs-devel gtk3-devel.i686 libattr-devel.i686 libva-devel.i686 libexif-devel.i686 libexif.i686 glib2-devel.i686 mpg123-devel.i686 mpg123-devel.x86_64 libcom_err-devel.i686 libcom_err-devel.x86_64 libFAudio-devel -y" + ] + +# For fedora 32 and less +# For installing Basic Packages like Steam, Wine, Gamemode + Fedora_32_Basics = [ + "wget https://raw.githubusercontent.com/winetricks/winetricks/master/src/winetricks", #installing winetricks here + "chmod -744 winetricks", + "mv winetricks /usr/local/bin/", + "dnf update -y", + "dnf install python3-pip wine gamemode steam alsa-plugins-pulseaudio.i686 glibc-devel.i686 glibc-devel libgcc.i686 libx11-devel.i686 freetype-devel.i686 libxcursor-devel.i686 libxi-devel.i686 libxext-devel.i686 libxxf86vm-devel.i686 libxrandr-devel.i686 libxinerama-devel.i686 mesa-libglu-devel.i686 mesa-libosmesa-devel.i686 libxrender-devel.i686 libpcap-devel.i686 ncurses-devel.i686 libzip-devel.i686 lcms2-devel.i686 zlib-devel.i686 libv4l-devel.i686 libgphoto2-devel.i686 cups-devel.i686 libxml2-devel.i686 openldap-devel.i686 libxslt-devel.i686 gnutls-devel.i686 libpng-devel.i686 flac-libs.i686 json-c.i686 libice.i686 libsm.i686 libxtst.i686 libasyncns.i686 liberation-narrow-fonts.noarch libieee1284.i686 libogg.i686 libsndfile.i686 libuuid.i686 libva.i686 libvorbis.i686 libwayland-client.i686 libwayland-server.i686 llvm-libs.i686 mesa-dri-drivers.i686 mesa-filesystem.i686 mesa-libegl.i686 mesa-libgbm.i686 nss-mdns.i686 ocl-icd.i686 pulseaudio-libs.i686 sane-backends-libs.i686 tcp_wrappers-libs.i686 unixodbc.i686 samba-common-tools.x86_64 samba-libs.x86_64 samba-winbind.x86_64 samba-winbind-clients.x86_64 samba-winbind-modules.x86_64 mesa-libgl-devel.i686 fontconfig-devel.i686 libxcomposite-devel.i686 libtiff-devel.i686 openal-soft-devel.i686 mesa-libopencl-devel.i686 opencl-utils-devel.i686 alsa-lib-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 pulseaudio-libs-devel.i686 pulseaudio-libs-devel gtk3-devel.i686 libattr-devel.i686 libva-devel.i686 libexif-devel.i686 libexif.i686 glib2-devel.i686 mpg123-devel.i686 mpg123-devel.x86_64 libcom_err-devel.i686 libcom_err-devel.x86_64 libFAudio-devel -y" + ] + +# For installing Lutris + Fedora_Lutris = "dnf install lutris -y" + +# For installing Heroic + Fedora_Heroic = [ + "dnf copr enable atim/heroic-games-launcher -y", + "dnf update -y", + "dnf install heroic-games-launcher-bin -y" + ] +# For installing The FPS programs and overlays + Fedora_Overlays = "dnf install goverlay -y" diff --git a/LibreGaming/distro_pkgs/OpenSUSE.py b/LibreGaming/distro_pkgs/OpenSUSE.py new file mode 100644 index 0000000..d117b79 --- /dev/null +++ b/LibreGaming/distro_pkgs/OpenSUSE.py @@ -0,0 +1,36 @@ +import os, subprocess, wget, requests + +class OpenSUSE: + """ + Here are all the pkgs that LibreGaming installs for OpenSUSE + """ + +# For installing Basic Packages like Steam, Wine, Gamemode + OpenSUSE_Basics = [ + " zypper install -y steam wine-staging gamemoded libgamemode0 libgamemode0-32bit", + " zypper update -y" + ] + +# For installing Minigalaxy + OpenSUSE_Minigalaxy = " zypper install -y minigalaxy" + +# For installing Lutris + OpenSUSE_Lutris = " zypper install -y lutris" + +# For installing The FPS programs and overlays + OpenSUSE_Overlays = " zypper install -y goverlay" + +# For installing Heroic + def OpenSUSE_Heroic(self): + whoami = str(subprocess.getoutput("whoami")) + if whoami == "root": + print("\n\tPlease run LibreGaming for OpenSUSE Heroic without sudo or doas command, so that it installs correctly\n") + else: + print('Downloading Heroic latest AppImage') + url = 'https://api.github.com/repos/Heroic-Games-Launcher/HeroicGamesLauncher/releases/latest' + r = requests.get(url).json() + for i in r['assets']: + if i['name'].endswith('.AppImage'): + url= i['browser_download_url'] + wget.download(url, "heroic.AppImage") + os.system("chmod +x heroic.AppImage && mv heroic.AppImage ~/Downloads && cd ~/Downloads && ./heroic.AppImage") \ No newline at end of file diff --git a/LibreGaming/distro_pkgs/Ubuntu.py b/LibreGaming/distro_pkgs/Ubuntu.py new file mode 100644 index 0000000..80f9567 --- /dev/null +++ b/LibreGaming/distro_pkgs/Ubuntu.py @@ -0,0 +1,62 @@ +import os, subprocess, wget, requests + +class Ubuntu: + """ + Here are all the pkgs that LibreGaming installs for Ubuntu + """ + +# Saves the Ubuntu release codename. For example: focal fossa + ReleaseCodename = "" + +# For installing Minigalaxy + Ubuntu_Minigalaxy = " apt install minigalaxy -y" + +# For installing Lutris + Ubuntu_Lutris = [ + " dpkg --add-architecture i386", + " add-apt-repository ppa:lutris-team/lutris -y", + " apt update", + " apt install lutris -y" + ] + +# For installing The FPS programs and overlays + Ubuntu_Overlay = [ + " dpkg --add-architecture i386", + " add-apt-repository ppa:flexiondotorg/mangohud -y", + " apt update", + " apt install goverlay -y" + ] + +# For installing Basic Packages like Steam, Wine, Gamemode + def Ubuntu_Basics(self): + basic_pkgs = [ + " dpkg --add-architecture i386", + "wget -nc https://dl.winehq.org/wine-builds/winehq.key", + " apt-key add winehq.key", + " add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ "+ self.ReleaseCodename +" main' -y", + " add-apt-repository multiverse -y", + " apt update", + " apt install --install-recommends winehq-staging -y", + " apt install steam winetricks python3-pip gawk curl meson libsystemd-dev zstd pkg-config ninja-build git libdbus-1-dev libinih-dev dbus-user-session libgnutls30:i386 libldap-2.5-0:i386 libgpg-error0:i386 libxml2:i386 libasound2-plugins:i386 libsdl2-2.0-0:i386 libfreetype6:i386 libdbus-1-3:i386 libsqlite3-0:i386 -y" + ] + return basic_pkgs + +# For installing Heroic + def Ubuntu_Heroic(self): + print('Downloading Heroic latest dpkg') + url = 'https://api.github.com/repos/Heroic-Games-Launcher/HeroicGamesLauncher/releases/latest' + r = requests.get(url).json() + for i in r['assets']: + if i['name'].endswith('.deb'): + url= i['browser_download_url'] + wget.download(url, "heroic.deb") + os.system(" dpkg -i heroic.deb") + + def __init__(self): + distroName = str(subprocess.getoutput("lsb_release -is")) + if distroName == "Ubuntu": + self.ReleaseCodename = str(subprocess.getoutput("lsb_release -cs")) + if distroName == "Pop": + self.ReleaseCodename = str(subprocess.getoutput("lsb_release -cs")) + else: + self.ReleaseCodename = str(subprocess.getoutput("grep -oP '(?<=DISTRIB_CODENAME=)\w+' /etc/upstream-release/lsb-release")) \ No newline at end of file diff --git a/LibreGaming/distro_pkgs/__pycache__/Fedora.cpython-310.pyc b/LibreGaming/distro_pkgs/__pycache__/Fedora.cpython-310.pyc new file mode 100644 index 0000000..3bb28c2 Binary files /dev/null and b/LibreGaming/distro_pkgs/__pycache__/Fedora.cpython-310.pyc differ diff --git a/LibreGaming/getPackageManager.sh b/LibreGaming/getPackageManager.sh deleted file mode 100755 index 7922c9a..0000000 --- a/LibreGaming/getPackageManager.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -if [ -x "$(command -v dnf)" ]; then echo "dnf" -elif [ -x "$(command -v yay)" ]; then echo "yay" -elif [ -x "$(command -v paru)" ]; then echo "paru" -elif [ -x "$(command -v pacman)" ]; then echo "pacman" -elif [ -x "$(command -v apt)" ]; then echo "apt" -elif [ -x "$(command -v zypper)" ]; then echo "zypper" -else echo "FAILED TO INSTALL PACKAGE: Package manager not found."; fi \ No newline at end of file diff --git a/LibreGaming/getRoot.sh b/LibreGaming/getRoot.sh deleted file mode 100755 index b951209..0000000 --- a/LibreGaming/getRoot.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -if [ -x "$(command -v doas)" ]; then echo 'doas' -elif [ -x "$(command -v sudo)" ]; then echo 'sudo' -else echo "su -"; fi diff --git a/MANIFEST.in b/MANIFEST.in index 9f31d17..484e276 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ -include LibreGaming/*.sh include LibreGaming/TUI.py +include LibreGaming/distro_pkgs/*.py diff --git a/README.md b/README.md index 025ac94..5989b26 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Table of contents # Distributions: * I tested this script on these distributions. but it should also work on their derivatives too. -1. Ubuntu. +1. Ubuntu(Tested also on Linux Mint, Pop_OS!). 2. Arch Linux. 3. Fedora. 4. OpenSUSE Tumbleweed. @@ -116,17 +116,17 @@ sudo zypper install python3-pip # Installation: * You can install LibreGaming using pip if you have it installed. click [Here](https://github.com/Ahmed-Al-Balochi/LibreGaming#dependencies) to install pip3: ``` -pip3 install LibreGaming +sudo pip3 install LibreGaming ``` * Or you can install LibreGaming script by entering these commands: ``` git clone https://github.com/Ahmed-Al-Balochi/LibreGaming.git LibreGaming/ cd LibreGaming/ -python3 setup.py install --user +sudo python3 setup.py install --user ``` * To update LibreGaming when there is a new release enter this command: ``` -pip3 install LibreGaming -U +sudo pip3 install LibreGaming -U ``` * LibreGaming: command not found. @@ -145,31 +145,35 @@ fi * Note: you can also run this script using ```libregaming``` command if you don't like ```LibreGaming```. Both can be used, so choose what you prefer. * To install all the Gaming packages mentioned in the packages section enter this command: ``` -LibreGaming -g +sudo LibreGaming -g ``` * To install Basic Packages(Wine, Steam, Gamemode): ``` -LibreGaming -b +sudo LibreGaming -b ``` -* To install ProtonGE enter this command: +* To install Lutris Launcher enter this command: ``` -LibreGaming -p +sudo LibreGaming --lutris ``` -* To install Athenaeum Launcher enter this command: +* To install Heroic Launcher enter this command (Don't use sudo if you are using OpenSUSE): ``` -LibreGaming -ath +sudo LibreGaming --heroic ``` -* To install Lutris Launcher enter this command: +* To install Minigalaxy Launcher enter this command (For Arch Don't use sudo. Use yay or paru): ``` -LibreGaming --lutris +sudo LibreGaming --minigalaxy ``` -* To install Heroic Launcher enter this command: +* To install MangoHud & Goverlay enter this command: ``` -LibreGaming --heroic +sudo LibreGaming -o ``` -* To install MangoHud & Goverlay enter this command: +* To install ProtonGE enter this command: +``` +LibreGaming -p +``` +* To install Athenaeum Launcher enter this command: ``` -LibreGaming -o +LibreGaming -ath ``` * To install itch.io Launcher enter this command: ``` @@ -179,10 +183,6 @@ LibreGaming --itch ``` LibreGaming --stl ``` -* You can mix options to install packages. For example, To install gaming packages, ProtonGE, and Athenaeum Launcher enter this command: -``` -LibreGaming -g -p -ath -``` ## TUI ![TUI image](/pics/tui.png "TUI")