예제 #1
0
def XDG_Symlink(home):
    try:
        print("Symlinking XDG_RUNTIME_DIR path for Flatpak Discord.")
        exec_bash(
            "cd %s/.var && ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-0 "
            % home)
    except BashError as e:
        print("Could not symlink XDG_RUNTIME_DIR Error: %s" % str(e))
        return
예제 #2
0
def check_primeoffload():
    # only show the GPU in use with optimus, show both if prime render offload
    primeoffload = False
    try:
        primeoffload = exec_bash(
            "xrandr --listproviders | grep -o \"NVIDIA-0\"")
        return True
    except BashError:
        return False
예제 #3
0
파일: checks.py 프로젝트: kjay23/FetchCord
def get_nvidia_gpu(nvidiagpuline, loop):
        for n in range(len(nvidiagpuline)):
            nvidiagpuinfo = nvidiagpuline[n]
        try:
            gputemp = exec_bash("nvidia-smi -q | awk '/GPU Current Temp/{print $5}'\
                    | sed 's/^/[/;s/$/°C]/'")
            nvidiagpuinfo += gputemp
        except BashError:
            pass
        return nvidiagpuinfo
예제 #4
0
파일: checks.py 프로젝트: kjay23/FetchCord
def check_primeoffload(laptop, loop):
    # only show the GPU in use with optimus, show both if prime render offload
    primeoffload = False
    if args.debug and loop == 0:
        print("laptop: %s" % laptop)
    try:
        primeoffload = exec_bash("xrandr --listproviders | grep -o \"NVIDIA-0\"")
        return True
    except BashError:
        return False
예제 #5
0
def nvidia_gpu_temp(gpuline):
    nvidiagpu = ""

    try:
        gputemp = exec_bash(
            "nvidia-smi -q | awk '/GPU Current Temp/{print $5}'\
                    | sed 's/^/[/;s/$/°C]/'")
        for t in range(len(gpuline)):
            if "NVIDIA" in gpuline[t].split():
                nvidiagpu = gpuline[t] + gputemp
    except BashError:
        pass
    print(nvidiagpu)

    return nvidiagpu
예제 #6
0
파일: checks.py 프로젝트: kjay23/FetchCord
def get_amdgpurender(amdgpuline, intelgpuline, laptop):
    amdgpurenderlist = []
    try:
        # amd GPUs
        for i in range(len(amdgpuline)):
            # assume DRI_PRIME=0 is the intel GPU
            if laptop and intelgpuline:
                i += 1
            env_prime = "env DRI_PRIME=%s" % i
            amdgpurender = "GPU: " + \
                exec_bash(
                    "%s glxinfo | grep \"OpenGL renderer string:\" |\
                            sed 's/^.*: //;s/[(][^)]*[)]//g'" % env_prime) + ' '
            if i != -1:
                amdgpurenderlist.append(amdgpurender)
    except BashError as e:
        print("ERROR: Could not run glxinfo [%s]" % str(e))
        sys.exit(1)
    return amdgpurenderlist
예제 #7
0
파일: out.py 프로젝트: Kirottu/FetchCord
except AttributeError:
    pass

neofetchwin = ""
if os.name == "nt":
    neofetchwin = os.popen("neofetch --noart").read()
else:
    home = os.getenv('HOME')
    if os.path.isdir(
            "%s/.var/app/com.discordapp.Discord" %
            home) and not os.path.isfile(
                "/usr/bin/discord") and not os.path.isdir("/opt/Discord"):
        try:
            print("Symlinking XDG_RUNTIME_DIR path for Flatpak Discord.")
            exec_bash(
                "cd %s/.var && ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-0 "
                % home)
        except BashError as e:
            print("Could not symlink XDG_RUNTIME_DIR Error: %s" % str(e))

    # use default neofetch output, ignoring user config
    baseinfo = exec_bash("neofetch --stdout --config none")

# make lists
cpu = "CPU:"
cpuline = []
nvidiagpu = "GPU: NVIDIA"
nvidiagpuline = []
amdgpu = "GPU: AMD"
amdgpuline = []
intelgpu = "GPU: Intel"