mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-03 11:44:18 +01:00
structure and values can be set in fastfetch via command line and file!
This commit is contained in:
@@ -2,11 +2,6 @@
|
||||
|
||||
void ffPrintBattery(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Battery"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
char model[256];
|
||||
ffGetFileContent("/sys/class/power_supply/BAT0/model_name", model, sizeof(model));
|
||||
|
||||
|
||||
@@ -15,11 +15,6 @@ static void printKDE()
|
||||
|
||||
void ffPrintDesktopEnvironment(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "DE"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP");
|
||||
if(currentDesktop == NULL)
|
||||
{
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
|
||||
void ffPrintDisk(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Disk (/)"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
struct statvfs fs;
|
||||
int ret = statvfs("/", &fs);
|
||||
if(ret != 0)
|
||||
|
||||
@@ -16,11 +16,6 @@ static void parseFont(char* font, char* buffer)
|
||||
|
||||
void ffPrintFont(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Font"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
char plasma[256];
|
||||
ffParsePropFileHome(instance, ".config/kdeglobals", "font=%[^\n]", plasma);
|
||||
|
||||
|
||||
@@ -107,4 +107,6 @@ void ffPrintGPU(FFinstance* instance)
|
||||
}
|
||||
}
|
||||
ffpci_cleanup(pacc);
|
||||
|
||||
dlclose(pci);
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
|
||||
|
||||
void ffPrintHost(FFinstance* instance)
|
||||
{
|
||||
if(ffPrintCachedValue(instance, "Host"))
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
|
||||
void ffPrintIcons(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Icons"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
char plasma[256];
|
||||
ffParsePropFileHome(instance, ".config/kdeglobals", "Theme=%[^\n]", plasma);
|
||||
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
|
||||
void ffPrintKernel(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Kernel"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
ffPrintLogoAndKey(instance, "Kernel");
|
||||
puts(instance->state.utsname.release);
|
||||
}
|
||||
@@ -3,11 +3,6 @@
|
||||
// Impl by: https://github.com/sam-barr/paleofetch/blob/b7c58a52c0de39b53c9b5f417889a5886d324bfa/paleofetch.c#L544
|
||||
void ffPrintMemory(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Memory"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
FILE* meminfo = fopen("/proc/meminfo", "r");
|
||||
if(meminfo == NULL) {
|
||||
ffPrintError(instance, "Memory", "fopen(\"/proc/meminfo\", \"r\") == NULL");
|
||||
|
||||
@@ -33,11 +33,6 @@ static void printPacmanPackages()
|
||||
|
||||
void ffPrintPackages(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Packages"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
ffPrintLogoAndKey(instance, "Packages");
|
||||
printPacmanPackages();
|
||||
putchar('\n');
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
|
||||
|
||||
void ffPrintShell(FFinstance* instance)
|
||||
{
|
||||
if(ffPrintCachedValue(instance, "Shell"))
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
|
||||
|
||||
void printTerminalName(FFinstance* instance, const char* pid)
|
||||
{
|
||||
char file[256];
|
||||
@@ -58,11 +56,6 @@ void printTerminalName(FFinstance* instance, const char* pid)
|
||||
|
||||
void ffPrintTerminal(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Terminal"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
char ppid[256];
|
||||
sprintf(ppid, "%i", getppid());
|
||||
printTerminalName(instance, ppid);
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
|
||||
void ffPrintTheme(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Theme"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
char plasma[256];
|
||||
ffParsePropFileHome(instance, ".config/kdeglobals", "Name=%[^\n]", plasma);
|
||||
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
|
||||
void ffPrintTitle(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Title"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
char hostname[256];
|
||||
gethostname(hostname, 256);
|
||||
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
|
||||
void ffPrintUptime(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Uptime"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
ffPrintLogoAndKey(instance, "Uptime");
|
||||
|
||||
if(instance->state.sysinfo.uptime < 60)
|
||||
|
||||
Reference in New Issue
Block a user