mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-09 06:30:10 +01:00
flashfetch loads default values too now
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
|
||||
void ffPrintBattery(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Battery"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
int scanned;
|
||||
|
||||
FILE* fullFile = fopen("/sys/class/power_supply/BAT0/charge_full", "r");
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
|
||||
|
||||
static void printKDE()
|
||||
{
|
||||
char version[256];
|
||||
@@ -17,6 +15,11 @@ 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,6 +4,11 @@
|
||||
|
||||
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)
|
||||
|
||||
+5
-2
@@ -1,7 +1,5 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
|
||||
|
||||
static void parseFont(char* font, char* buffer)
|
||||
{
|
||||
char name[64];
|
||||
@@ -18,6 +16,11 @@ 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);
|
||||
|
||||
|
||||
+5
-2
@@ -1,9 +1,12 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
|
||||
|
||||
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,6 +2,11 @@
|
||||
|
||||
void ffPrintKernel(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Kernel"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
ffPrintLogoAndKey(instance, "Kernel");
|
||||
printf("%s\n", instance->state.utsname.release);
|
||||
puts(instance->state.utsname.release);
|
||||
}
|
||||
@@ -3,6 +3,11 @@
|
||||
// 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,6 +33,11 @@ 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');
|
||||
|
||||
@@ -58,6 +58,11 @@ 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);
|
||||
|
||||
+5
-2
@@ -1,9 +1,12 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
|
||||
|
||||
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);
|
||||
|
||||
|
||||
+5
-2
@@ -1,9 +1,12 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
|
||||
|
||||
void ffPrintTitle(FFinstance* instance)
|
||||
{
|
||||
#ifdef FASTFETCH_BUILD_FLASHFETCH
|
||||
if(ffPrintCustomValue(instance, "Title"))
|
||||
return;
|
||||
#endif // FASTFETCH_BUILD_FLASHFETCH
|
||||
|
||||
char hostname[256];
|
||||
gethostname(hostname, 256);
|
||||
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
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