-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.def.h
102 lines (85 loc) · 4.14 KB
/
config.def.h
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* path: /home/klassiker/.local/share/repos/cinfo/config.def.h
* author: klassiker [mrdotx]
* github: https://github.com/mrdotx/cinfo
* date: 2024-07-08T08:20:02+0200
*/
/* packages */
/* example values for some distros:
| Distro | PKGS_CMD | PKGS_DESC |
| :------ | :-------------------------------------- | :--------- |
| Arch | ls -p /var/lib/pacman/local | grep -c / | [pacman] |
| Red Hat | rpm -qa | wc -l | [rpm] |
| Red Hat | dnf list installed | wc -l | [dnf] |
| Red Hat | yum list installed | wc -l | [yum] |
| Debian | dpkg -l | grep -c '^ii' | [apt] |
| Gentoo | qlist -I | wc -l | [portage] |
The result of the shell command in PKGS_CMD must be an integer!
*/
static const char *PKGS_CMD = "ls -p /var/lib/pacman/local | grep -c /",
*PKGS_DESC = " [pacman]";
/* cpu */
static const char *CPU_TEMP = "'C",
*CPU_TEMP_PATH = "/sys/class/hwmon",
*CPU_TEMP_INPUT_FILE = "temp1_input",
*CPU_TEMP_INPUT[] = {
"k10temp", // amd
"coretemp", // intel
"cpu_thermal" // arm
};
/* memory */
/* values for MEMORY_METHOD:
| Value | Calculation | Comparable |
| :---: | :-------------------------------------- | :---------------------------- |
| 0 | total - available | btop, polybar, free, neofetch |
| 1 | total + shared - free - buffer - cached | htop |
Since Linux 3.14, MemAvailable (method 0) is the preferred choice.
*/
static const int MEMORY_METHOD = 0;
/* values for MEMORY_UNIT:
| Value | Condition | Description |
| :---- | :---------------- | :-------------------------- |
| auto | total => 1024 MiB | Displays result in Gibibyte |
| | total < 1024 MiB | Displays result in Mebibyte |
| GiB | | Displays result in Gibibyte |
| MiB | | Displays result in Mebibyte |
*/
static const char *MEMORY_UNIT = "auto",
*MEMORY_DIVIDER = "/";
/* shell */
static const char *SHELL_PATH = "/bin/sh";
/* general */
static const char *INFO_DIVIDER = " | ";
/* labels */
static const char *LABEL_DISTRO = " distro",
*LABEL_MODEL = " model",
*LABEL_KERNEL = " kernel",
*LABEL_UPTIME = " uptime",
*LABEL_PKGS = " pkgs",
*LABEL_SHELL = " shell",
*LABEL_CPU = " cpu",
*LABEL_MEM = " memory";
/* color version */
static const int COLOR_LEFT_LEN = 13;
static const char *COLOR_LINE = "─",
*COLOR_DIVIDER_TOP = "┬",
*COLOR_DIVIDER = " │ ",
*COLOR_DIVIDER_BOTTOM = "┴",
*COLOR_SYMBOL = "██",
*COLOR_HEADER_PRIMARY = "\033[1;37m",
*COLOR_HEADER_SECONDARY = "\033[0;37m",
*COLOR_PRIMARY = "\033[0;37m",
*COLOR_SECONDARY = "\033[1;37m",
*COLOR_TABLE = "\033[1;34m";
/* ascii version */
static const int ASCII_LEFT_LEN = 8;
static const char *ASCII_LINE = "-",
*ASCII_DIVIDER_TOP = "-",
*ASCII_DIVIDER = " | ",
*ASCII_DIVIDER_BOTTOM = "-";
/* cache */
static const char *CACHE_DISTRO_PATH = "/tmp/distro.cinfo",
*CACHE_PKGS_PATH = "/tmp/pkgs.cinfo",
*CACHE_MODEL_PATH = "/tmp/model.cinfo",
*CACHE_CPU_PATH = "/tmp/cpu.cinfo",
*CACHE_CPU_TEMP_PATH = "/tmp/cpu_temp_path.cinfo";