gardesk/gartray / cd07f3d

Browse files

Fix compilation errors

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
cd07f3d37d1e2f34a574c04e649e79939de199a1
Parents
8b30643
Tree
157dd29

6 changed files

StatusFile+-
A flake.lock 82 0
M gartray/src/daemon.rs 1 1
M gartray/src/ipc.rs 3 4
M gartray/src/main.rs 5 1
M gartray/src/panel/mod.rs 1 2
M gartray/src/tray/xembed.rs 1 1
flake.lockadded
@@ -0,0 +1,82 @@
1
+{
2
+  "nodes": {
3
+    "flake-utils": {
4
+      "inputs": {
5
+        "systems": "systems"
6
+      },
7
+      "locked": {
8
+        "lastModified": 1731533236,
9
+        "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
10
+        "owner": "numtide",
11
+        "repo": "flake-utils",
12
+        "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
13
+        "type": "github"
14
+      },
15
+      "original": {
16
+        "owner": "numtide",
17
+        "repo": "flake-utils",
18
+        "type": "github"
19
+      }
20
+    },
21
+    "nixpkgs": {
22
+      "locked": {
23
+        "lastModified": 1768564909,
24
+        "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=",
25
+        "owner": "NixOS",
26
+        "repo": "nixpkgs",
27
+        "rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f",
28
+        "type": "github"
29
+      },
30
+      "original": {
31
+        "owner": "NixOS",
32
+        "ref": "nixos-unstable",
33
+        "repo": "nixpkgs",
34
+        "type": "github"
35
+      }
36
+    },
37
+    "root": {
38
+      "inputs": {
39
+        "flake-utils": "flake-utils",
40
+        "nixpkgs": "nixpkgs",
41
+        "rust-overlay": "rust-overlay"
42
+      }
43
+    },
44
+    "rust-overlay": {
45
+      "inputs": {
46
+        "nixpkgs": [
47
+          "nixpkgs"
48
+        ]
49
+      },
50
+      "locked": {
51
+        "lastModified": 1768877311,
52
+        "narHash": "sha256-abSDl0cNr0B+YCsIDpO1SjXD9JMxE4s8EFnhLEFVovI=",
53
+        "owner": "oxalica",
54
+        "repo": "rust-overlay",
55
+        "rev": "59e4ab96304585fde3890025fd59bd2717985cc1",
56
+        "type": "github"
57
+      },
58
+      "original": {
59
+        "owner": "oxalica",
60
+        "repo": "rust-overlay",
61
+        "type": "github"
62
+      }
63
+    },
64
+    "systems": {
65
+      "locked": {
66
+        "lastModified": 1681028828,
67
+        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
68
+        "owner": "nix-systems",
69
+        "repo": "default",
70
+        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
71
+        "type": "github"
72
+      },
73
+      "original": {
74
+        "owner": "nix-systems",
75
+        "repo": "default",
76
+        "type": "github"
77
+      }
78
+    }
79
+  },
80
+  "root": "root",
81
+  "version": 7
82
+}
gartray/src/daemon.rsmodified
@@ -4,7 +4,7 @@ use anyhow::{Context, Result};
44
 use std::fs;
55
 use std::io::Write;
66
 use std::path::PathBuf;
7
-use std::sync::mpsc::{self, Receiver};
7
+use std::sync::mpsc::Receiver;
88
 use tokio::signal::unix::{signal, SignalKind};
99
 use tracing::{debug, info, warn};
1010
 
gartray/src/ipc.rsmodified
@@ -9,7 +9,7 @@ use std::os::unix::net::{UnixListener, UnixStream};
99
 use std::path::PathBuf;
1010
 use std::sync::mpsc::{self, Receiver, Sender};
1111
 use std::thread;
12
-use tracing::{debug, error, info, warn};
12
+use tracing::{debug, error, info};
1313
 
1414
 /// Get the path to the IPC socket
1515
 pub fn socket_path() -> PathBuf {
@@ -88,10 +88,9 @@ impl IpcServer {
8888
             socket_path: socket_path(),
8989
             listener: None,
9090
             tx,
91
-            rx: Some(rx),
91
+            rx: None,
9292
         };
93
-        let rx = server.rx.clone();
94
-        (server, rx.unwrap())
93
+        (server, rx)
9594
     }
9695
 
9796
     /// Start listening for connections
gartray/src/main.rsmodified
@@ -59,10 +59,14 @@ async fn main() -> Result<()> {
5959
     let cli = Cli::parse();
6060
 
6161
     match cli.command {
62
-        Some(Commands::Daemon { foreground }) | None => {
62
+        Some(Commands::Daemon { foreground }) => {
6363
             info!("Starting gartray daemon");
6464
             daemon::run(cli.config, foreground || cli.foreground).await
6565
         }
66
+        None => {
67
+            info!("Starting gartray daemon");
68
+            daemon::run(cli.config, cli.foreground).await
69
+        }
6670
         Some(Commands::Panel) => {
6771
             info!("Showing quick settings panel");
6872
             ipc::send_command("panel").await
gartray/src/panel/mod.rsmodified
@@ -17,6 +17,5 @@ pub trait PanelModule {
1717
     /// Update module state
1818
     fn update(&mut self);
1919
 
20
-    /// Render the module widget
21
-    // fn render(&self, renderer: &mut Renderer, rect: Rect);
20
+    // TODO: fn render(&self, renderer: &mut Renderer, rect: Rect);
2221
 }
gartray/src/tray/xembed.rsmodified
@@ -5,12 +5,12 @@
55
 use std::collections::HashMap;
66
 use anyhow::{Context, Result};
77
 use gartk_x11::{Connection, Window, WindowConfig};
8
-use x11rb::connection::Connection as X11Connection;
98
 use x11rb::protocol::xproto::{
109
     self, Atom, AtomEnum, ClientMessageEvent, ConfigureWindowAux,
1110
     ConnectionExt, CreateWindowAux, EventMask, PropMode, WindowClass,
1211
 };
1312
 use x11rb::protocol::Event;
13
+use x11rb::wrapper::ConnectionExt as WrapperConnectionExt;
1414
 use tracing::{debug, info, warn};
1515
 
1616
 use crate::config::TrayConfig;