@@ -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