mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2026-01-06 00:30:11 +01:00
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.
19 lines
587 B
C++
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();
|
|
}
|