Skip to content

Commit 6f36e9a

Browse files
Done a lot of functions:
1 parent 4e0711a commit 6f36e9a

File tree

16 files changed

+173
-35
lines changed

16 files changed

+173
-35
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*.exe
2-
*.txt
3-
/.vscode
1+
*.exe
2+
*.txt
3+
/.vscode
44
/.vscode/*

.vscode/settings.json

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,30 @@
5555
"C_Cpp_Runner.useLeakSanitizer": false,
5656
"C_Cpp_Runner.showCompilationTime": false,
5757
"C_Cpp_Runner.useLinkTimeOptimization": false,
58-
"C_Cpp_Runner.msvcSecureNoWarnings": false
58+
"C_Cpp_Runner.msvcSecureNoWarnings": false,
59+
"C_Cpp.errorSquiggles": "enabled",
60+
"files.associations": {
61+
"*.vue": "javascript",
62+
"*.kotlin": "perl",
63+
"*.bin": "code-text-binary",
64+
"*.playground": "swift",
65+
"*.tsx": "typescriptreact",
66+
"*.css": "css",
67+
"cctype": "cpp",
68+
"clocale": "cpp",
69+
"cstdarg": "cpp",
70+
"cstddef": "cpp",
71+
"cstdint": "cpp",
72+
"cstdio": "cpp",
73+
"cstdlib": "cpp",
74+
"cwchar": "cpp",
75+
"cwctype": "cpp",
76+
"memory_resource": "cpp",
77+
"random": "cpp",
78+
"utility": "cpp",
79+
"new": "cpp",
80+
"typeinfo": "cpp",
81+
"algorithm": "cpp",
82+
"cmath": "cpp"
83+
}
5984
}

List.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[] OS
2-
[] Kernel
3-
[] Motheboard
4-
[] Uptime
5-
[] Shell
6-
[] Screen resolution
7-
[] Terminal Emulator
8-
[x] CPU
9-
[] GPU
10-
[] RAM
11-
[] Disk (C:/)
1+
[] OS
2+
[] Kernel
3+
[] Motheboard
4+
[] Uptime
5+
[] Shell
6+
[] Screen resolution
7+
[] Terminal Emulator
8+
[x] CPU
9+
[] GPU
10+
[] RAM
11+
[] Disk (C:/)
1212
[x] ascii art

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# betterfetch 0.0.1 indev verison
2-
WARNING!: this app is stil in development, there are some bugs.
3-
You can open an issue in github
4-
## This tool is still not for WINDOWS
1+
# betterfetch 0.0.1 indev verison
2+
WARNING!: this app is stil in development, there are some bugs.
3+
You can open an issue in github
4+
## This tool is still not for WINDOWS
55
## LINUX only!!!

ascii.txt

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
lllllllllllllll lllllllllllllll
2-
lllllllllllllll lllllllllllllll
3-
lllllllllllllll lllllllllllllll
4-
lllllllllllllll lllllllllllllll
5-
lllllllllllllll lllllllllllllll
6-
lllllllllllllll lllllllllllllll
7-
lllllllllllllll lllllllllllllll
8-
9-
lllllllllllllll lllllllllllllll
10-
lllllllllllllll lllllllllllllll
11-
lllllllllllllll lllllllllllllll
12-
lllllllllllllll lllllllllllllll
13-
lllllllllllllll lllllllllllllll
14-
lllllllllllllll lllllllllllllll
15-
lllllllllllllll lllllllllllllll
1+
_______
2+
/ \
3+
/ \
4+
| |
5+
| (o) (o) |
6+
| ^ |
7+
\_________/

functions/ascii_show.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ void displayAsciiArt(const std::string &filename) {
1515
}
1616
file.close();
1717
}
18+
19+
// DONE! displayAsciiArt works!

functions/get_cpu_info.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ std::string getCPUInfo() {
1818

1919
return cpuModel.empty() ? "Unknown CPU" : cpuModel;
2020
}
21+
22+
23+
// DONE getCPUInfo Works!

functions/get_gpu_info.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <iostream>
2+
3+
std::string getGPUInfo() {
4+
return "Unknown";
5+
}
6+
7+
8+
// TODO -- getGPUInfo does not work
9+

functions/get_kernel.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <sys/utsname.h>
2+
3+
std::string getKernelVersion() {
4+
struct utsname buffer;
5+
if (uname(&buffer) != 0) {
6+
return "Unknown";
7+
}
8+
return buffer.release;
9+
}
10+
11+
12+
// TODO -- FIXME Write the getKernelVersion later

functions/get_memory_info.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <fstream>
2+
#include <iostream>
3+
#include <string>
4+
5+
std::string getMemoryInfo() {
6+
std::ifstream meminfo("/proc/meminfo");
7+
std::string line;
8+
long totalMem = 0, freeMem = 0;
9+
while (std::getline(meminfo, line)) {
10+
if (line.find("MemTotal:") != std::string::npos) {
11+
totalMem = std::stol(line.substr(line.find(":") + 1));
12+
}
13+
if (line.find("MemAvailable:") != std::string::npos) {
14+
freeMem = std::stol(line.substr(line.find(":") + 1));
15+
}
16+
}
17+
return std::to_string((totalMem - freeMem) / 1024) + "MB / " + std::to_string(totalMem / 1024) + "MB";
18+
}
19+
20+
// DONE! getMemoryInfo works!

0 commit comments

Comments
 (0)