Skip to content

Commit 0eb4c87

Browse files
committed
Removed custom art related code due to unacceptable performance overhead :(
1 parent ce317d7 commit 0eb4c87

4 files changed

Lines changed: 78 additions & 74 deletions

File tree

include/art.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ const std::wstring win11art19 = L"llllllllllllllll llllllllllllllll";
8787
// identical to win11art but you could customize this if you so choose
8888

8989
// removed unknownartNN - was identical to win11art, now use custom art from utils
90+
// 2026-01-19 removed custom art but there should be no need for this anyways
9091

9192
/*
9293
const std::wstring unknownart01 = L"llllllllllllllll llllllllllllllll";

include/utils.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@
33
#include <string>
44
#include <vector>
55

6-
std::string wstring_to_string(const std::wstring& wide);
7-
8-
std::wstring get_art_config_path();
9-
std::vector<std::wstring> load_custom_art();
6+
std::string wstring_to_string(const std::wstring& wide);

src/core/neofetch.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
#include <windowsinfo.h>
1212
#include <display.h>
1313
#include <colors.h>
14-
#include "utils.h"
14+
#include "utils.h"
1515
#include <debug.h>
1616

17+
1718
void render_neofetch_display(int art_type) {
1819

1920
std::string username = wstring_to_string(getusername());
@@ -37,15 +38,16 @@ void render_neofetch_display(int art_type) {
3738

3839
std::wstring divider = L"--------------";
3940

40-
std::vector<std::wstring> custom_art = load_custom_art();
41+
//std::vector<std::wstring> custom_art = load_custom_art();
4142

4243
std::vector<std::wstring> art_lines;
4344

44-
if (!custom_art.empty()) {
45-
// use custom art if available
46-
art_lines = custom_art;
47-
}
48-
else if (art_type == 0) {
45+
//if (!custom_art.empty()) {
46+
// // use custom art if available
47+
// art_lines = custom_art;
48+
//}
49+
50+
if (art_type == 0) {
4951
// Windows 10
5052
art_lines = {
5153
win10art01, win10art02, win10art03, win10art04, win10art05,

src/utils/utils.cpp

Lines changed: 67 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -12,66 +12,70 @@ std::string wstring_to_string(const std::wstring& wide) {
1212
return result;
1313
}
1414

15-
// configuration
16-
// path: %USERPROFILE%\.neofetch-win or C:\Program Files\neofetch-win (prioritized)
17-
std::wstring get_art_config_path() {
18-
wchar_t* the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust = nullptr;
19-
size_t len = 0;
20-
21-
if (_wdupenv_s(&the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust, &len, L"PROGRAMFILES") == 0 && the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust) {
22-
std::wstring path = the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust;
23-
path += L"\\neofetch-win\\.neofetch-win";
24-
free(the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust);
25-
26-
if (GetFileAttributesW(path.c_str()) != INVALID_FILE_ATTRIBUTES) {
27-
return path;
28-
}
29-
}
30-
31-
if (_wdupenv_s(&the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust, &len, L"USERPROFILE") == 0 && the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust) {
32-
std::wstring path = the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust;
33-
path += L"\\.neofetch-win";
34-
free(the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust);
35-
return path;
36-
}
37-
38-
return L".neofetch-win";
39-
}
40-
41-
// note: make sure that the art is at least 19 lines long lols
42-
std::vector<std::wstring> load_custom_art() {
43-
std::vector<std::wstring> custom_art;
44-
std::wstring config_path = get_art_config_path();
45-
46-
std::ifstream file_utf8(config_path);
47-
if (file_utf8.is_open()) {
48-
std::string line;
49-
while (std::getline(file_utf8, line)) {
50-
if (line.empty() || line[0] != '#') {
51-
int size = MultiByteToWideChar(CP_UTF8, 0, line.c_str(), -1, nullptr, 0);
52-
if (size > 0) {
53-
std::wstring wide_line(size - 1, 0);
54-
MultiByteToWideChar(CP_UTF8, 0, line.c_str(), -1, &wide_line[0], size);
55-
custom_art.push_back(wide_line);
56-
}
57-
}
58-
}
59-
file_utf8.close();
60-
return custom_art;
61-
}
62-
63-
std::wifstream file(config_path);
64-
if (!file.is_open()) {
65-
return custom_art;
66-
}
67-
68-
std::wstring line;
69-
while (std::getline(file, line)) {
70-
if (line.empty() || line[0] != L'#') {
71-
custom_art.push_back(line);
72-
}
73-
}
74-
75-
file.close();
76-
return custom_art;
77-
}
15+
//std::wstring get_art_config_path() {
16+
// wchar_t* the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust = nullptr;
17+
// size_t len = 0;
18+
//
19+
// // check programfiles first (higher priority)
20+
// if (_wdupenv_s(&the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust, &len, L"PROGRAMFILES") == 0 && the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust) {
21+
// std::wstring path = the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust;
22+
// path += L"\\neofetch-win\\.neofetch-win";
23+
// free(the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust);
24+
//
25+
// if (GetFileAttributesW(path.c_str()) != INVALID_FILE_ATTRIBUTES) {
26+
// return path;
27+
// }
28+
// }
29+
//
30+
// // fall back to USERPROFILE
31+
// if (_wdupenv_s(&the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust, &len, L"USERPROFILE") == 0 && the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust) {
32+
// std::wstring path = the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust;
33+
// path += L"\\.neofetch-win";
34+
// free(the_sport_n_field_collection_will_get_removed_at_the_end_of_the_armory_pass_its_a_good_invest_trust);
35+
//
36+
// if (GetFileAttributesW(path.c_str()) != INVALID_FILE_ATTRIBUTES) {
37+
// return path;
38+
// }
39+
// }
40+
//
41+
// // fallback to this maybe
42+
// return L".neofetch-win";
43+
//}
44+
//
45+
//// note: make sure that the art is at least 19 lines long lols
46+
//std::vector<std::wstring> load_custom_art() {
47+
// std::vector<std::wstring> custom_art;
48+
// std::wstring config_path = get_art_config_path();
49+
//
50+
// std::ifstream file_utf8(config_path);
51+
// if (file_utf8.is_open()) {
52+
// std::string line;
53+
// while (std::getline(file_utf8, line)) {
54+
// if (line.empty() || line[0] != '#') {
55+
// int size = MultiByteToWideChar(CP_UTF8, 0, line.c_str(), -1, nullptr, 0);
56+
// if (size > 0) {
57+
// std::wstring wide_line(size - 1, 0);
58+
// MultiByteToWideChar(CP_UTF8, 0, line.c_str(), -1, &wide_line[0], size);
59+
// custom_art.push_back(wide_line);
60+
// }
61+
// }
62+
// }
63+
// file_utf8.close();
64+
// return custom_art;
65+
// }
66+
//
67+
// std::wifstream file(config_path);
68+
// if (!file.is_open()) {
69+
// return custom_art;
70+
// }
71+
//
72+
// std::wstring line;
73+
// while (std::getline(file, line)) {
74+
// if (line.empty() || line[0] != L'#') {
75+
// custom_art.push_back(line);
76+
// }
77+
// }
78+
//
79+
// file.close();
80+
// return custom_art;
81+
//}

0 commit comments

Comments
 (0)