Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion neofetch-win/Registry.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <Registry.hpp>
#include "Registry.hpp"

namespace m4x1m1l14n
{
Expand Down
15 changes: 11 additions & 4 deletions neofetch-win/source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <iomanip> // not needed in C++20
#include <algorithm> // not needed in C++20

#include <art.h>
#include <Registry.hpp>
#include "art.h"
#include "Registry.hpp"

#define setlght SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3)
#define setdflt SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7)
Expand Down Expand Up @@ -161,8 +161,15 @@ std::wstring getconsole() {
GetConsoleTitleW((WCHAR*)console, 256);

std::wstring consolestring = console;

return console;
if (consolestring.find(L"Program Files\\WindowsApp") != std::wstring::npos) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the string is too long, the icon will be broken

consolestring.erase(0, 27);
consolestring = L"%WindowsApps%" + consolestring;
}
if (consolestring.find(L"Users") != std::wstring::npos){
consolestring.erase(0, 8);
consolestring = L"%Users%" + consolestring;
}
return consolestring;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shorten the consolestring, so we us that instead of console

}

std::chrono::milliseconds getuptime() {
Expand Down