diff --git a/src/events/Events.cpp b/src/events/Events.cpp index 7cf0d86..808c815 100644 --- a/src/events/Events.cpp +++ b/src/events/Events.cpp @@ -136,13 +136,19 @@ void Events::handlePointerButton(void *data, struct wl_pointer *wl_pointer, uint return result; }; - Debug::log(NONE, "#%s%s%s", toHex(COL.r).c_str(), toHex(COL.g).c_str(), toHex(COL.b).c_str()); + if (g_pHyprpicker->m_bFancyOutput) + Debug::log(NONE, "\033[38;2;%i;%i;%im #%s%s%s", COL.r, COL.g, COL.b, toHex(COL.r).c_str(), toHex(COL.g).c_str(), toHex(COL.b).c_str()); + else + Debug::log(NONE, "#%s%s%s", toHex(COL.r).c_str(), toHex(COL.g).c_str(), toHex(COL.b).c_str()); break; } case OUTPUT_RGB: { - Debug::log(NONE, "%i %i %i", COL.r, COL.g, COL.b); + if (g_pHyprpicker->m_bFancyOutput) + Debug::log(NONE, "\033[38;2;%i;%i;%im %i %i %i", COL.r, COL.g, COL.b, COL.r, COL.g, COL.b); + else + Debug::log(NONE, "%i %i %i", COL.r, COL.g, COL.b); break; } } diff --git a/src/hyprpicker.hpp b/src/hyprpicker.hpp index 7f15af4..9ef6563 100644 --- a/src/hyprpicker.hpp +++ b/src/hyprpicker.hpp @@ -24,6 +24,8 @@ public: eOutputMode m_bSelectedOutputMode = OUTPUT_HEX; + bool m_bFancyOutput = true; + bool m_bRunning = true; std::vector> m_vMonitors; diff --git a/src/main.cpp b/src/main.cpp index 7e03361..c348f03 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,6 +15,8 @@ int main(int argc, char** argv, char** envp) { if (arg == "--format") { currentlyParsing = 1; continue; + } else if (arg == "--no-fancy") { + g_pHyprpicker->m_bFancyOutput = false; } else { Debug::log(NONE, "Unrecognized option %s", arg.c_str()); exit(1); @@ -32,6 +34,9 @@ int main(int argc, char** argv, char** envp) { } } + if (!isatty(fileno(stdout)) || getenv("NO_COLOR")) + g_pHyprpicker->m_bFancyOutput = false; + g_pHyprpicker->init(); return 0;