diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/archfetch.iml b/.idea/archfetch.iml new file mode 100644 index 0000000..74d515a --- /dev/null +++ b/.idea/archfetch.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a1c049a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..bbddac5 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Hack-Regular.ttf b/Hack-Regular.ttf new file mode 100644 index 0000000..92a90cb Binary files /dev/null and b/Hack-Regular.ttf differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..53df224 --- /dev/null +++ b/main.py @@ -0,0 +1,62 @@ +import platform +import psutil +class bcolors: + HEADER = '\033[95m' + OKBLUE = '\033[94m' + OKCYAN = '\033[96m' + OKGREEN = '\033[92m' + WARNING = '\033[93m' + FAIL = '\033[91m' + ENDC = '\033[0m' + BOLD = '\033[1m' + UNDERLINE = '\033[4m' + RESET = '\033[39m' + BLINK = '\x1b[5m' + +def greet(): + art = """ + _ _ __ _ _ + / \ _ __ ___| |__ / _| ___| |_ ___| |__ + / _ \ | '__/ __| '_ \ | |_ / _ \ __/ __| '_ \ + / ___ \| | | (__| | | | | _| __/ || (__| | | | +/_/ \_\_| \___|_| |_| |_| \___|\__\___|_| |_| +""" + + print(f"{bcolors.OKCYAN}{art}") + +def sys_info(): + try: + info = platform.freedesktop_os_release() + return info + except OSError: + print("Error getting sys.info()") + +def sys_platform(): + try: + info = platform.uname() + return info + except OSError: + print("Error getting sys.info()") + +def display_info(sys_dict,sys_platform,sys_usage): + print(f"{bcolors.HEADER} System Details ") + print(f"{bcolors.OKCYAN}Distro: {bcolors.RESET}{sys_dict.get('NAME')}") + print(f"{bcolors.OKCYAN}Site-URL: {bcolors.RESET}{sys_dict.get('HOME_URL')}") + print(f"{bcolors.OKCYAN}Host: {bcolors.RESET}{sys_platform.node.capitalize()} {sys_platform.system} {sys_platform.machine} Release - {sys_platform.release}") + load, mem, disk = sys_usage + print(f"{bcolors.OKCYAN}Cpu load: {bcolors.RESET}{load[0]:.2f} {load[1]:.2f} {load[2]:.2f}") + print(f"{bcolors.OKCYAN}Memory: {bcolors.RESET}Total={mem.total} Used={mem.total}") + print(f"{bcolors.OKCYAN}Disk: {bcolors.RESET}Total={disk.total} Free={disk.free}") + + +def sys_usage(): + load = psutil.getloadavg() + mem = psutil.virtual_memory() + disk = psutil.disk_usage('/') + return load,mem,disk + +def init(): + greet() + display_info(sys_info(),sys_platform(),sys_usage()) + +init()