Pi66

pino-rs
Rust notification daemon.
git clone https://git.pi66.xyz/pino-rs

← back to log

dbus server for pino

author: pixel
date: 2025-04-23 17:36
hash: 45b7d428c8314ad7c46d7a6cf2f540341526aea5

Diffstat:

M

scripts/pino-dbus/src/main.rs
5 ------------------------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/scripts/pino-dbus/src/main.rs b/scripts/pino-dbus/src/main.rs
index ade8962..bd71147 100644
--- a/scripts/pino-dbus/src/main.rs
+++ b/scripts/pino-dbus/src/main.rs
@@ -27,7 +27,6 @@ struct NotificationData {

 impl NotificationData {
     fn print(&self) {
-        // Send to pino app
         let summary = self.summary.clone();
         let body = self.body.clone();

@@ -52,7 +51,6 @@ impl NotificationData {
             println!("Actions: {}", self.actions.join(", "));
         }

-        // Print relevant hints if they exist
         if !self.hints.is_empty() {
             println!("Additional Info:");
             for (key, value) in &self.hints {
@@ -65,7 +63,6 @@ impl NotificationData {
     }
 }

-// Media player information structure
 #[derive(Debug)]
 struct MediaInfo {
     player: String,
@@ -112,7 +109,6 @@ impl MediaInfo {
     }
 }

-// Get media information from a specific player
 fn get_media_info(conn: &Connection, player: &str) -> Result<Option<MediaInfo>, Box<dyn Error>> {
     let proxy = conn.with_proxy(
         format!("org.mpris.MediaPlayer2.{}", player),
@@ -120,7 +116,6 @@ fn get_media_info(conn: &Connection, player: &str) -> Result<Option<MediaInfo>,
         Duration::from_millis(500),
     );

-    // Try to get metadata and playback status
     let metadata_result: Result<PropMap, dbus::Error> = proxy.get(MEDIA_PLAYER_INTERFACE, "Metadata");
     let status_result: Result<String, dbus::Error> = proxy.get(MEDIA_PLAYER_INTERFACE, "PlaybackStatus");