Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
M1ngos committed Oct 17, 2023
0 parents commit 6481752
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/archfetch.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Hack-Regular.ttf
Binary file not shown.
62 changes: 62 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 6481752

Please sign in to comment.