From 2bdae38b0d033ccfb7d695b27362face022395f8 Mon Sep 17 00:00:00 2001 From: szymon Date: Tue, 29 Sep 2026 13:42:57 +0200 Subject: [PATCH] feat: implement get_icon --- src/functions.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/functions.rs b/src/functions.rs index 26b10da..8e37e2d 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -51,8 +51,18 @@ pub fn is_initted() -> bool { // Gets the application icon registered. // Available since: 0.8.4 -pub fn get_app_icon() -> String { - todo!(); +pub fn get_app_icon() -> Option { + let app_icon_c: *const std::os::raw::c_char = unsafe { notify_get_app_icon() }; + + if app_icon_c.is_null() { + return None; + } else { + Some( + unsafe { std::ffi::CStr::from_ptr(app_icon_c) } + .to_string_lossy() + .to_string(), + ) + } } /// Queries the server capabilities.