hyprpicker/src/notify/Notify.cpp
R3B00T 68bc7875fd
core: add Notifications Support (#130)
new feature, a flag for notifications -n /
--notify. It's using the notify-send command line utility to send
desktop notifications. By default I made it compatible with dunst (you
will need to enable full markup in the dunst config) but it should work
with other notification daemons too.
2025-06-10 18:39:45 +02:00

19 lines
587 B
C++

#include "Notify.hpp"
#include "../includes.hpp"
#include <cstdint>
#include <cstdio>
#include <format>
#include <hyprutils/os/Process.hpp>
#include <iostream>
#include <string>
#include <hyprutils/os/Process.hpp>
void NNotify::send(std::string hexColor, std::string formattedColor) {
std::string notifyBody = std::format("<span>Selected color: <span color='{}'><b>{}</b></span></span>", hexColor, formattedColor);
Hyprutils::OS::CProcess notify("notify-send", {"-t", "5000", "-i", "color-select-symbolic", "Color Picker", notifyBody});
notify.runAsync();
}