mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-01 02:22:52 +01:00
25 lines
517 B
C
25 lines
517 B
C
#include "fastfetch.h"
|
|
|
|
|
|
|
|
void ffPrintShell(FFinstance* instance)
|
|
{
|
|
if(ffPrintCachedValue(instance, "Shell"))
|
|
return;
|
|
|
|
char* shellPath = getenv("SHELL");
|
|
if(shellPath == NULL)
|
|
{
|
|
ffPrintError(instance, "Shell", "getenv(\"SHELL\") == NULL");
|
|
return;
|
|
}
|
|
|
|
char* shellName = strrchr(shellPath, '/');
|
|
|
|
if(shellName == NULL)
|
|
shellName = shellPath;
|
|
else if(shellName[0] == '/')
|
|
++shellName;
|
|
|
|
ffPrintAndSaveCachedValue(instance, "Shell", shellName);
|
|
} |