#include "../include/Notification.hpp" #include "../include/Program.hpp" #include #include namespace QuickMedia { const char* urgency_string(Urgency urgency) { switch(urgency) { case Urgency::LOW: return "low"; case Urgency::NORMAL: return "normal"; case Urgency::CRITICAL: return "critical"; } assert(false); return nullptr; } void show_notification(const std::string &title, const std::string &description, Urgency urgency) { fprintf(stderr, "Notification: title: %s, description: %s\n", title.c_str(), description.c_str()); const char *args[] = { "notify-send", "-a", "QuickMedia", "-t", "10000", "-u", urgency_string(urgency), "--", title.c_str(), description.c_str(), nullptr }; exec_program_async(args, nullptr); } }