From 78ec81da453ee39082f2ab83ad5e2f199fb1fda6 Mon Sep 17 00:00:00 2001 From: ochibani <11yzyv86j@relay.firefox.com> Date: Sat, 26 Nov 2022 20:38:23 +0200 Subject: [PATCH] Working X11 version --- Cargo.toml | 1 - data/blue-recorder-active.svg | 363 ---------------------------------- src/indicator.rs | 69 ------- 3 files changed, 433 deletions(-) delete mode 100644 data/blue-recorder-active.svg delete mode 100644 src/indicator.rs diff --git a/Cargo.toml b/Cargo.toml index fb9792d..c0a228e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,6 @@ rust-ini = "0.16" regex = "1.4.3" secfmt = "0.1.1" subprocess = "0.2.6" -ksni = "0.2.0" [dependencies.gio] version = "0.15.0" diff --git a/data/blue-recorder-active.svg b/data/blue-recorder-active.svg deleted file mode 100644 index ef810d2..0000000 --- a/data/blue-recorder-active.svg +++ /dev/null @@ -1,363 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/indicator.rs b/src/indicator.rs deleted file mode 100644 index 4a59371..0000000 --- a/src/indicator.rs +++ /dev/null @@ -1,69 +0,0 @@ -//use gtk::Button; -//use gtk::prelude::*; -use ksni::menu::StandardItem; -use ksni::Tray; -use std::path::Path; - -pub struct BlueRecorderTray { - //pub stop_record_button: Button, -} - -impl Tray for BlueRecorderTray { - fn icon_theme_path(&self) -> String { - let mut indicator_icon_path = { - let mut current_exec_dir = std::env::current_exe().unwrap(); - current_exec_dir.pop(); - current_exec_dir - } - .join(Path::new("data/")); - - if !indicator_icon_path.exists() { - indicator_icon_path = std::fs::canonicalize(Path::new( - &std::env::var("DATA_DIR") - .unwrap_or_else(|_| String::from("data/")) - )) - .unwrap(); - } - indicator_icon_path.to_str().unwrap().into() - } - - fn icon_name(&self) -> String { - "blue-recorder-active".into() - } - - fn title(&self) -> String { - "Recording".into() - } - - fn menu(&self) -> Vec> { - vec![ - StandardItem { - label: "Stop Recording".into(), - icon_name: "media-playback-stop".into(), - //activate: Box::new(|menu_button: &mut Self| { - //menu_button.stop_record_button.emit_clicked(); - //}), - ..Default::default() - } - .into(), - ] - } -} - -pub struct TrayService { - tray_handle: ksni::Handle, -} - -impl TrayService { - pub fn show() -> Self { - let service = ksni::TrayService::new(BlueRecorderTray{}); - let tray_handle = service.handle(); - service.spawn(); - TrayService { tray_handle } - } - - pub fn close(&self) { - self.tray_handle.shutdown(); - } -} -