Files
fastfetch/src/shell.c
T
2021-02-19 16:23:41 +01:00

24 lines
497 B
C

#include "fastfetch.h"
#include <string.h>
void ffPrintShell(FFstate* state)
{
char* shellPath = getenv("SHELL");
if(shellPath == NULL)
{
if(state->showErrors)
ffPrintError(state, "Shell", "getenv(\"SHELL\") == NULL");
return;
}
char* shellName = strrchr(shellPath, '/');
if(shellName == NULL)
shellName = shellPath;
else if(shellName[0] == '/')
++shellName;
ffPrintLogoAndKey(state, "Shell");
puts(shellName);
}