#include #include #include #include #include "imgui_hud_shared.h" #ifdef HAVE_DBUS #include "dbus_info.h" #endif namespace MangoHud { namespace GL { notify_thread notifier; static bool cfg_inited = false; ImVec2 window_size; bool inited = false; overlay_params params {}; // seems to quit by itself though static std::unique_ptr> stop_it(¬ifier, [](notify_thread *n){ stop_notifier(*n); }); void imgui_init() { if (cfg_inited) return; parse_overlay_config(¶ms, getenv("MANGOHUD_CONFIG")); notifier.params = ¶ms; start_notifier(notifier); window_size = ImVec2(params.width, params.height); init_system_info(); cfg_inited = true; init_cpu_stats(params); #ifdef HAVE_DBUS if (params.enabled[OVERLAY_PARAM_ENABLED_media_player]) { try { dbusmgr::dbus_mgr.init(); get_spotify_metadata(dbusmgr::dbus_mgr, spotify); } catch (std::runtime_error& e) { std::cerr << "Failed to get initial Spotify metadata: " << e.what() << std::endl; } } #endif } }} // namespaces