2021-02-18 22:25:36 +01:00
|
|
|
#include "fastfetch.h"
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
void ffPrintShell(FFstate* state)
|
|
|
|
|
{
|
|
|
|
|
char* shellPath = getenv("SHELL");
|
2021-02-19 16:23:41 +01:00
|
|
|
if(shellPath == NULL)
|
|
|
|
|
{
|
2021-02-20 19:08:23 +01:00
|
|
|
ffPrintError(state, "Shell", "getenv(\"SHELL\") == NULL");
|
2021-02-19 16:23:41 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-18 22:25:36 +01:00
|
|
|
char* shellName = strrchr(shellPath, '/');
|
|
|
|
|
|
|
|
|
|
if(shellName == NULL)
|
|
|
|
|
shellName = shellPath;
|
|
|
|
|
else if(shellName[0] == '/')
|
|
|
|
|
++shellName;
|
|
|
|
|
|
|
|
|
|
ffPrintLogoAndKey(state, "Shell");
|
2021-02-19 16:23:41 +01:00
|
|
|
puts(shellName);
|
2021-02-18 22:25:36 +01:00
|
|
|
}
|