-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptifetch.h
More file actions
70 lines (63 loc) · 1.5 KB
/
Copy pathoptifetch.h
File metadata and controls
70 lines (63 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef OPTIFETCH_H
#define OPTIFETCH_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/utsname.h>
#include <sys/sysinfo.h>
#include <sys/statvfs.h>
#include <pwd.h>
#include <time.h>
#include <ifaddrs.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define BUF_SIZE 4096
typedef struct
{
char user[128];
char hostname[256];
char os[256];
char os_id[64];
char distro_color[64]; // NOUVEAU
char kernel[128];
char uptime[128];
char arch[128];
char shell[128];
char cpu[256];
char gpu[256];
char de[128];
char wm[128];
char term[128];
char packages[128];
long cores;
long cpu_max_freq;
char host_model[128];
char display_server[32];
char theme[128];
char font[128];
char locale[64];
char dns[64];
char wifi[128];
char ip_public[64];
char disk_fs[32];
unsigned long ram_total_mb;
unsigned long ram_used_mb;
unsigned long swap_total_mb;
unsigned long swap_used_mb;
unsigned long disk_total_mb;
unsigned long disk_used_mb;
char battery[64];
char battery_status[64];
char date[64];
char time_str[64];
char ip_local[128];
} SysInfo;
void get_info(SysInfo *info);
void get_logo_line(const char *os_id, int small, int idx, char *out, size_t size);
int get_logo_height(const char *os_id, int small);
void generate_default_config(const char *path);
void render_config(const char *path, SysInfo *info);
void print_help();
#endif