def loonix(): try: first_connect() while True: if not args.nodistro and sysosid.lower() != "macos": cycle0() rpc_tryclear() if not args.nohardware: cycle1() rpc_tryclear() if not args.noshell: cycle2() rpc_tryclear() if not args.nohost and sysosid.lower() != "macos": cycle3() rpc_tryclear() if sysosid.lower() == "macos": runmac() rpc_tryclear() if args.pause_cycle: pause() rpc_tryclear() except KeyboardInterrupt: print("Closing connection.") sys.exit(0)
def loonix(loop): try: if args.poll_rate: rate = int(args.poll_rate) else: rate = 3 if loop == 0: first_connect() while loop < rate: if not args.nodistro and sysosid.lower() != "macos": cycle0() if sysosid.lower() == "macos": runmac() if not args.nohardware: cycle1() if not args.noshell: cycle2() if not args.nohost and sysosid.lower() != "macos": cycle3() if args.pause_cycle: pause() loop += 1 if not args.nohardware or not args.nodistro or not args.nohost: loop = 1 check_change(loop) else: loop = 1 loonix(loop) except (KeyboardInterrupt, ConnectionResetError): if KeyboardInterrupt: print("Closing connection.") sys.exit(0) else: rpc_tryconnect(RPC)
def check_change(loop): neofetch(loop) from fetch_cord.out import diskline, nvidiagpuline, \ memline, cpuline, gpuinfo from fetch_cord.checks import get_cpuinfo, check_diskline, check_batteryline, check_memline if baseinfo: from fetch_cord.checks import check_batteryline from fetch_cord.out import lapordesk, batteryline, packagesline, check_batteryline, get_gpuinfo, cirrusgpuline, virtiogpuline, vmwaregpuline, intelgpuline, amdgpuline, primeoffload, sysosid, amdgpurenderlist global packagesline, cpuinfo, gpuinfo, memline, diskline, batteryline memline = check_memline(memline) cpuinfo = get_cpuinfo(cpuline, baseinfo) diskline = check_diskline(diskline, cpuinfo) if baseinfo: batteryline = check_batteryline(batteryline, hostline) packagesline = packagesline if baseinfo and nvidiagpuline and sysosid.lower() != "macos": from fetch_cord.out import gpuinfo gpuinfo = get_gpuinfo(cirrusgpuline, vmwaregpuline, virtiogpuline, amdgpuline, nvidiagpuline,\ intelgpuline, primeoffload, amdgpurenderlist,sysosid, loop) loop = 1 if not neofetchwin: return loonix(loop) else: return wandowz(loop)
def macos(): global product, devicetype, bigicon, ver if sysosid.lower() == "macos": devicetype = "none" bigicon = "none" ver = os.popen("sw_vers -productVersion").read() product = os.popen("sysctl -n hw.model").read() try: versions[ver[0:5]]() except IndexError: bigicon = "bigslurp" except KeyError: print("Unsupported MacOS version") laporp()
def get_appid(distros, sysosid): return distros[sysosid.lower()]
return cpuappid def get_gpuid(gpuvendor): gpuvendor = gpuvendor.lower() if gpuvendor in gpus: gpuid = gpuvendor elif gpuvendor in multigpus: gpuid = multigpus[gpuvendor.lower()] else: print("Unknown GPU, contact us on github to resolve this.") gpuid = 'unknown' return gpuid if sysosid.lower() == "macos": devicetype = "N/A" bigicon = "unknown" ver = get_ver() bigicon = get_icon(ver) product = get_product() devicetype = laporp(product) gpuid = get_gpuid(gpuvendor) desktopid = get_desktopid(deid, wmid) if baseinfo: shellid = get_shell_id(shells, shellid) moboid = "N/A" try: hostappid = get_hostappid(hosts) except KeyError:
# bunch of try except blocks to catch keyerrors and tell the enduser that thier distro/others arent supported if os.name != "nt": try: terminals[termid.lower()]() except KeyError: print("Unsupported Terminal. contact me on github to resolve this.(Keyerror)") Unknown_term() try: shells[shellid.lower()]() except KeyError: print("Unsupported Shell, contact me on guthub to resolve this.(Keyerror)") Unknown_shell() try: if sysosid.lower() != "macos": hosts[hostid.lower()]() except KeyError: print("Unknown Host, contact us on github to resolve this.(Keyerror)") Unknown_host() try: if deid != "N/A" and sysosid.lower() != "macos": desktops[deid.lower()]() except KeyError: print("Unsupported De contact me on github to resolve this.(Keyerror)") Unknown_de_wm() try: if deid == "N/A" and sysosid.lower() != "macos": windowmanagers[wmid.lower()]()
terminals[termid.lower()]() except KeyError: print( "Unsupported Terminal. contact us on github to resolve this.(Keyerror)" ) Unknown_term() try: shells[shellid.lower()]() except KeyError: print( "Unsupported Shell, contact us on guthub to resolve this.(Keyerror)" ) Unknown_shell() try: if sysosid.lower() != "macos": hosts[hostid.lower()]() except KeyError: print("Unknown Host, contact us on github to resolve this.(Keyerror)") Unknown_host() try: if deid != "N/A" and sysosid.lower() != "macos": desktops[deid.lower()]() except KeyError: print("Unsupported De contact us on github to resolve this.(Keyerror)") Unknown_de_wm() try: if deid == "N/A" and sysosid.lower() != "macos": windowmanagers[wmid.lower()]()