diff --git a/src/clipboard/Clipboard.cpp b/src/clipboard/Clipboard.cpp index 386f9a2..024653b 100644 --- a/src/clipboard/Clipboard.cpp +++ b/src/clipboard/Clipboard.cpp @@ -6,11 +6,7 @@ #include void NClipboard::copy(std::string data) { - std::string clipboardBinary = "wl-copy"; - - std::vector clipboardArgs = {data}; - - Hyprutils::OS::CProcess copy(clipboardBinary, clipboardArgs); + Hyprutils::OS::CProcess copy("wl-copy", {data}); copy.runAsync(); } diff --git a/src/hyprpicker.cpp b/src/hyprpicker.cpp index 5588c2f..07f69db 100644 --- a/src/hyprpicker.cpp +++ b/src/hyprpicker.cpp @@ -671,7 +671,7 @@ void CHyprpicker::initMouse() { return result; }; - std::string hexColor = std::format("#{}{}{}", toHex(COL.r), toHex(COL.g), toHex(COL.b)); + std::string hexColor = std::format("#{0:02x}{1:02x}{2:02x}", COL.r, COL.g, COL.b); switch (m_bSelectedOutputMode) { case OUTPUT_CMYK: { @@ -688,9 +688,8 @@ void CHyprpicker::initMouse() { if (m_bAutoCopy) NClipboard::copy(formattedColor); - if (m_bNotify) { + if (m_bNotify) NNotify::send(hexColor, formattedColor); - } finish(); break; @@ -705,9 +704,8 @@ void CHyprpicker::initMouse() { if (m_bAutoCopy) NClipboard::copy(hexColor); - if (m_bNotify) { + if (m_bNotify) NNotify::send(hexColor, hexColor); - } finish(); break; @@ -723,9 +721,8 @@ void CHyprpicker::initMouse() { if (m_bAutoCopy) NClipboard::copy(formattedColor); - if (m_bNotify) { + if (m_bNotify) NNotify::send(hexColor, formattedColor); - } finish(); break; @@ -748,9 +745,8 @@ void CHyprpicker::initMouse() { if (m_bAutoCopy) NClipboard::copy(formattedColor); - if (m_bNotify) { + if (m_bNotify) NNotify::send(hexColor, formattedColor); - } finish(); break; diff --git a/src/notify/Notify.cpp b/src/notify/Notify.cpp index 962bc45..5379afa 100644 --- a/src/notify/Notify.cpp +++ b/src/notify/Notify.cpp @@ -11,12 +11,9 @@ #include void NNotify::send(std::string hexColor, std::string formattedColor) { - std::string notifyBody = std::format("You selected the color: {}", hexColor, formattedColor); + std::string notifyBody = std::format("Selected color: {}", hexColor, formattedColor); - std::string notifyBinary = "notify-send"; - std::vector notifyArgs = {"-t", "5000", "-i", "color-select-symbolic", "Color Picker", notifyBody}; - - Hyprutils::OS::CProcess notify(notifyBinary, notifyArgs); + Hyprutils::OS::CProcess notify("notify-send", {"-t", "5000", "-i", "color-select-symbolic", "Color Picker", notifyBody}); notify.runAsync(); }