From 89e1b40b0b30d82f1ef00cb0f3f89f202ae01a1c Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Mon, 8 Mar 2021 03:12:20 +0300 Subject: [PATCH 1/5] Hide buttons when it not in use; show dialog wth progress after stop recording to show video audio merge and converting to choosen formats --- data/blue-recorder@x128.png | Bin 0 -> 17278 bytes interfaces/main.ui | 35 ++++++++++++++++---- snap/snapcraft.yaml | 2 +- src/ffmpeg_interface.rs | 62 ++++++++++++++++++++++++++++++++++-- src/main.rs | 37 +++++++++++++++++---- 5 files changed, 119 insertions(+), 17 deletions(-) create mode 100644 data/blue-recorder@x128.png diff --git a/data/blue-recorder@x128.png b/data/blue-recorder@x128.png new file mode 100644 index 0000000000000000000000000000000000000000..c060e518af8f9eb2995fdd7bbb388d018ee51864 GIT binary patch literal 17278 zcmbWf1ymf}wl3PZySuwKZo%E%6D+t}kl+r%-JK=`*WeaBxH|!YyF0w*-}~%)?j7fj z@!qSZs#ewfrmyNXd-ZA}Rh4B>5D5_h004@dtfV^l9Pqxw!-9{$giU?}01#iTB_vd> z&CCD*`UKyE53;{RiTjN-q!OYENhF~;HR+HFDP#3RDK+66#miA?)BMDe!l?WE)tp%P z?rU}3ot)?AdbH4?MMSfSbFe=a_r1}C;sQyD@3z-E2G;~dzo(>IG{!(>I%ExdDk@rP z_s8mluty7DLvqwd^UKM1d-$wTbuYBhPh5)J?d@yV<3d4FUNCbiW_bpCde89ioneLR ziD^epL=Gypl3!3Q;KXh4?R~`cv{+Q6*^B(uXWAK>f@=YzL6u7x`#n?nL44UPm^=T-Qx(yf;B2dtQ50Y5IhVHwpvgOeWd^cZej!3)dgCsU!);oOO)|nT~PwU z&kJa;a9wSUE=gFQ)ahXxy7Y5!5lXsmFuje?y#EUMmsgzv1rdUwPXeZ(l>ms_8@${rQ8AKc;cp zI?*O*@b&3Vv8aoTNx&uQd=&(aJ%HRyR$U1I@TLW)Cjg znYw#)0%y2cPEt(Mb9pUCse)$EeZ#-B_3Y_2({UV54y8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3YiHjFb~`RTb_T%mK(^yb(KwO3}$8gA6Qkb9Nir4&D~tA&Hm8} zcH7Ow?H|7}aiR#pT;%@)*S|W^dv{W`_B6KxaBeP)>4ULE?^y6Zun;hFbnZee2P=I&zd@=xX!bK^(A0M!2g96y7Nd1o~+mXiQe0CG~wl2ziyLH`fO CsQu9Z literal 0 HcmV?d00001 diff --git a/interfaces/main.ui b/interfaces/main.ui index 36b10c2..661a020 100644 --- a/interfaces/main.ui +++ b/interfaces/main.ui @@ -130,13 +130,12 @@ True - False - 0.99999999977648257 + True False center center - + True False False @@ -147,7 +146,6 @@ True True half - True True @@ -185,12 +183,35 @@ True True True - none + half - + True False - media-playback-stop + 2 + True + + + True + False + media-playback-stop + + + 0 + 0 + + + + + True + False + Stop Recording + + + 1 + 0 + + diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 54046be..7f3bb02 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -4,7 +4,7 @@ version: git # just for humans, typically '1.2+git' or '1.3.2' summary: A simple screen recorder for Linux desktop. Supports Wayland & Xorg # 79 char long summary description: | A simple desktop recorder for Linux systems. Built using Rust, GTK+ 3 and ffmpeg. It supports recording audio and video on almost all Linux interfaces with support for Wayland display server on GNOME session. - The following formats are currently supported: mkv, avi, mp4, wmv, gif and nut (And only WebM for Wayland's GNOME session). You can stop the recording process easily by right-clicking the icon and choosing "Stop Record". Or middle-clicking the recording icon in the notifications area (but doesn't work on all interfaces). + The following formats are currently supported: mkv, avi, mp4, wmv, gif and nut. You can stop the recording process easily by right-clicking the icon and choosing "Stop Record". Or middle-clicking the recording icon in the notifications area (but doesn't work on all interfaces). You can choose the audio input source you want from the list. You can also set the default values you want by simply changing them in the interface, and the program will save them for you for the next time you open it. Based on GREEN RECORDER but rewritten in RUST diff --git a/src/ffmpeg_interface.rs b/src/ffmpeg_interface.rs index 5af726f..2f3d150 100644 --- a/src/ffmpeg_interface.rs +++ b/src/ffmpeg_interface.rs @@ -1,8 +1,10 @@ extern crate subprocess; use chrono::prelude::*; +use gtk::prelude::*; use gtk::{ - CheckButton, ComboBoxExt, ComboBoxText, Entry, EntryExt, FileChooser, FileChooserExt, - SpinButton, SpinButtonExt, ToggleButtonExt, + CheckButton, ComboBoxText, Entry, EntryExt, FileChooser, + SpinButton, Dialog, ProgressBar, + Window }; use std::collections::HashMap; use std::path::PathBuf; @@ -15,6 +17,47 @@ use subprocess::Exec; use zbus::dbus_proxy; use zvariant::Value; +#[derive(Clone)] +pub struct ProgressWidget { + pub dialog: Dialog, + pub progress: ProgressBar, +} + +impl ProgressWidget { + pub fn new(window: &Window) -> ProgressWidget { + ProgressWidget { + dialog: Dialog::new(), + progress: ProgressBar::new() + }.init(&window) + } + + pub fn init(&self, window: &Window) -> ProgressWidget { + self.dialog.set_title("Progress"); + self.dialog.set_transient_for(Some(window)); + self.progress.set_fraction(0.0); + self.dialog.get_content_area().add(&self.progress); + self.progress.set_show_text(true); + self.dialog.set_deletable(false); + self.dialog.set_modal(true); + self.clone() + } + + pub fn set_progress(&self, title: String, value: i32, max: i32) { + let progress_precentage: f64 = value as f64 / max as f64; + self.progress.set_text(Some(&title)); + self.progress.set_fraction(progress_precentage); + } + + pub fn show(&self) { + self.progress.set_fraction(0.0); + self.dialog.show_all(); + } + + pub fn hide(&self) { + self.dialog.emit_close(); + } +} + trait GnomeScreencastResult {} #[dbus_proxy( @@ -54,6 +97,7 @@ pub struct Ffmpeg { pub process_id: Option, pub saved_filename: Option, pub unbound: Option>, + pub progress_widget: ProgressWidget } impl Ffmpeg { @@ -145,7 +189,9 @@ impl Ffmpeg { ffmpeg_command.arg("-i"); ffmpeg_command.arg(format!( "{}+{},{}", - std::env::var("DISPLAY").unwrap_or(":1".to_string()).as_str(), + std::env::var("DISPLAY") + .unwrap_or(":1".to_string()) + .as_str(), x, y )); @@ -175,8 +221,10 @@ impl Ffmpeg { } pub fn stop_record(&self) { + &self.progress_widget.show(); // kill the process to stop recording if self.process_id.is_some() { + &self.progress_widget.set_progress("Stop Recording".to_string(), 1, 5); Command::new("kill") .arg(format!("{}", self.process_id.unwrap())) .output() @@ -198,6 +246,7 @@ impl Ffmpeg { ) .exists(); if self.unbound.is_some() { + &self.progress_widget.set_progress("Stop Wayland Video Recording".to_string(), 2, 5); self.unbound .as_ref() .unwrap() @@ -230,6 +279,8 @@ impl Ffmpeg { .unwrap(); if is_audio_record { + &self.progress_widget.set_progress("Stop Wayland Audio Recording".to_string(), 3, 5); + // merge audio with video let mut ffmpeg_audio_merge_command = Command::new("ffmpeg"); ffmpeg_audio_merge_command.arg("-i"); @@ -264,6 +315,7 @@ impl Ffmpeg { } } } else if is_audio_record { + &self.progress_widget.set_progress("Convert Audio to choosen format".to_string(), 3, 5); println!("convert audio"); Command::new("ffmpeg") .arg("-f") @@ -286,8 +338,12 @@ impl Ffmpeg { // execute command after finish recording if !(self.command.get_text().trim() == "") { + &self.progress_widget.set_progress("execute custom command after finish".to_string(), 4, 5); Exec::shell(self.command.get_text().trim()).popen().unwrap(); } + + &self.progress_widget.set_progress("Finish".to_string(), 5, 5); + &self.progress_widget.hide(); } // Gnome screencast for record wayland diff --git a/src/main.rs b/src/main.rs index cc28582..d61adbc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,13 +8,14 @@ mod config_management; mod ffmpeg_interface; // use gio::prelude::*; +use ffmpeg_interface::{Ffmpeg, ProgressWidget}; use gettextrs::{bindtextdomain, gettext, setlocale, textdomain, LocaleCategory}; use glib::signal::Inhibit; use gtk::prelude::*; use gtk::ComboBoxText; use gtk::{ - AboutDialog, Builder, Button, CheckButton, CssProvider, Entry, FileChooser, Label, MenuItem, - SpinButton, Window, + AboutDialog, Builder, Button, CheckButton, CssProvider, Entry, FileChooser, Label, + MenuItem, SpinButton, Window, }; use libappindicator::{AppIndicator, AppIndicatorStatus}; use std::cell::RefCell; @@ -52,7 +53,9 @@ fn main() { current_exec_dir.pop(); current_exec_dir } - .join(Path::new("po")).to_str().unwrap(), + .join(Path::new("po")) + .to_str() + .unwrap(), ); textdomain("blue-recorder"); @@ -85,7 +88,6 @@ fn main() { let mouse_switch: CheckButton = builder.get_object("mouseswitch").unwrap(); let follow_mouse_switch: CheckButton = builder.get_object("followmouseswitch").unwrap(); let about_menu_item: MenuItem = builder.get_object("about_menu_item").unwrap(); - // --- default properties // Windows main_window.set_title(&gettext("Blue Recorder")); @@ -96,6 +98,9 @@ fn main() { &gdk::Screen::get_rgba_visual(&gdk::Screen::get_default().unwrap()).unwrap(), )); + stop_button.hide(); + play_button.hide(); + // Entries filename_entry.set_placeholder_text(Some(&gettext("Default filename:"))); command_entry.set_placeholder_text(Some(&gettext("Default command:"))); @@ -287,8 +292,8 @@ fn main() { }); // init record struct - let ffmpeg_record_interface: Rc> = - Rc::new(RefCell::new(ffmpeg_interface::Ffmpeg { + let ffmpeg_record_interface: Rc> = + Rc::new(RefCell::new(Ffmpeg { filename: (folder_chooser, filename_entry, format_chooser_combobox), record_video: video_switch, record_audio: audio_switch, @@ -301,6 +306,7 @@ fn main() { process_id: None, saved_filename: None, unbound: None, + progress_widget: ProgressWidget::new(&main_window) })); // App Indicator @@ -331,16 +337,25 @@ fn main() { // when indictor stop recording button clicked let mut _ffmpeg_record_interface = ffmpeg_record_interface.clone(); let mut _indicator = indicator.clone(); + let _stop_button = stop_button.clone(); + let _play_button = play_button.clone(); + let _record_button = record_button.clone(); indicator_stop_recording.connect_activate(move |_| { _ffmpeg_record_interface.borrow_mut().clone().stop_record(); _indicator .borrow_mut() .set_status(AppIndicatorStatus::Passive); + + _record_button.show(); + _stop_button.hide(); + _play_button.show(); }); let mut _ffmpeg_record_interface = ffmpeg_record_interface.clone(); let mut _area_capture = area_capture.clone(); let mut _indicator = indicator.clone(); + let _stop_button = stop_button.clone(); + let _record_button = record_button.clone(); record_button.connect_clicked(move |_| { let _area_capture = _area_capture.borrow_mut().clone(); _ffmpeg_record_interface.borrow_mut().start_record( @@ -352,15 +367,25 @@ fn main() { _indicator .borrow_mut() .set_status(AppIndicatorStatus::Active); + + _record_button.hide(); + _stop_button.show(); }); let mut _ffmpeg_record_interface = ffmpeg_record_interface.clone(); let mut _indicator = indicator.clone(); + let _stop_button = stop_button.clone(); + let _play_button = play_button.clone(); + let _record_button = record_button.clone(); stop_button.connect_clicked(move |_| { _ffmpeg_record_interface.borrow_mut().clone().stop_record(); _indicator .borrow_mut() .set_status(AppIndicatorStatus::Passive); + + _record_button.show(); + _stop_button.hide(); + _play_button.show(); }); let mut _ffmpeg_record_interface = ffmpeg_record_interface.clone(); From f6ef0abf17c1ade150921af5899b3bfc1ff9a4ad Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Mon, 8 Mar 2021 03:23:04 +0300 Subject: [PATCH 2/5] update cargo version; remove unused import --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/ffmpeg_interface.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4e4574..13003cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,7 +131,7 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "blue-recorder" -version = "0.1.0" +version = "0.1.1" dependencies = [ "chrono", "gdk", diff --git a/Cargo.toml b/Cargo.toml index b4824b6..635b3e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blue-recorder" -version = "0.1.0" +version = "0.1.1" authors = ["Salem Yaslem "] edition = "2018" diff --git a/src/ffmpeg_interface.rs b/src/ffmpeg_interface.rs index 2f3d150..d094625 100644 --- a/src/ffmpeg_interface.rs +++ b/src/ffmpeg_interface.rs @@ -2,7 +2,7 @@ extern crate subprocess; use chrono::prelude::*; use gtk::prelude::*; use gtk::{ - CheckButton, ComboBoxText, Entry, EntryExt, FileChooser, + CheckButton, ComboBoxText, Entry, FileChooser, SpinButton, Dialog, ProgressBar, Window }; From 3aba5eaf3973ca823470b89f3204a0f562656179 Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Mon, 8 Mar 2021 14:02:32 +0300 Subject: [PATCH 3/5] open video in snap --- snap/snapcraft.yaml | 1 - src/ffmpeg_interface.rs | 66 ++++++++++++++++++++++++++++++----------- 2 files changed, 48 insertions(+), 19 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 7f3bb02..1144d9d 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -21,7 +21,6 @@ parts: stage-packages: - libappindicator3-1 - x11-utils - - xdg-utils build-packages: - libappindicator3-dev - clang diff --git a/src/ffmpeg_interface.rs b/src/ffmpeg_interface.rs index d094625..a956e96 100644 --- a/src/ffmpeg_interface.rs +++ b/src/ffmpeg_interface.rs @@ -1,11 +1,7 @@ extern crate subprocess; use chrono::prelude::*; use gtk::prelude::*; -use gtk::{ - CheckButton, ComboBoxText, Entry, FileChooser, - SpinButton, Dialog, ProgressBar, - Window -}; +use gtk::{CheckButton, ComboBoxText, Dialog, Entry, FileChooser, ProgressBar, SpinButton, Window}; use std::collections::HashMap; use std::path::PathBuf; use std::process::Command; @@ -27,8 +23,9 @@ impl ProgressWidget { pub fn new(window: &Window) -> ProgressWidget { ProgressWidget { dialog: Dialog::new(), - progress: ProgressBar::new() - }.init(&window) + progress: ProgressBar::new(), + } + .init(&window) } pub fn init(&self, window: &Window) -> ProgressWidget { @@ -97,7 +94,7 @@ pub struct Ffmpeg { pub process_id: Option, pub saved_filename: Option, pub unbound: Option>, - pub progress_widget: ProgressWidget + pub progress_widget: ProgressWidget, } impl Ffmpeg { @@ -224,7 +221,9 @@ impl Ffmpeg { &self.progress_widget.show(); // kill the process to stop recording if self.process_id.is_some() { - &self.progress_widget.set_progress("Stop Recording".to_string(), 1, 5); + &self + .progress_widget + .set_progress("Stop Recording".to_string(), 1, 5); Command::new("kill") .arg(format!("{}", self.process_id.unwrap())) .output() @@ -246,7 +245,11 @@ impl Ffmpeg { ) .exists(); if self.unbound.is_some() { - &self.progress_widget.set_progress("Stop Wayland Video Recording".to_string(), 2, 5); + &self.progress_widget.set_progress( + "Stop Wayland Video Recording".to_string(), + 2, + 5, + ); self.unbound .as_ref() .unwrap() @@ -279,7 +282,11 @@ impl Ffmpeg { .unwrap(); if is_audio_record { - &self.progress_widget.set_progress("Stop Wayland Audio Recording".to_string(), 3, 5); + &self.progress_widget.set_progress( + "Stop Wayland Audio Recording".to_string(), + 3, + 5, + ); // merge audio with video let mut ffmpeg_audio_merge_command = Command::new("ffmpeg"); @@ -315,7 +322,11 @@ impl Ffmpeg { } } } else if is_audio_record { - &self.progress_widget.set_progress("Convert Audio to choosen format".to_string(), 3, 5); + &self.progress_widget.set_progress( + "Convert Audio to choosen format".to_string(), + 3, + 5, + ); println!("convert audio"); Command::new("ffmpeg") .arg("-f") @@ -338,11 +349,17 @@ impl Ffmpeg { // execute command after finish recording if !(self.command.get_text().trim() == "") { - &self.progress_widget.set_progress("execute custom command after finish".to_string(), 4, 5); + &self.progress_widget.set_progress( + "execute custom command after finish".to_string(), + 4, + 5, + ); Exec::shell(self.command.get_text().trim()).popen().unwrap(); } - &self.progress_widget.set_progress("Finish".to_string(), 5, 5); + &self + .progress_widget + .set_progress("Finish".to_string(), 5, 5); &self.progress_widget.hide(); } @@ -385,10 +402,19 @@ impl Ffmpeg { pub fn play_record(self) { if self.saved_filename.is_some() { - Command::new("xdg-open") - .arg(self.saved_filename.unwrap()) - .spawn() - .unwrap(); + if is_snap() { + // open the video using snapctrl for snap package + Command::new("snapctl") + .arg("user-open") + .arg(self.saved_filename.unwrap()) + .spawn() + .unwrap(); + } else { + Command::new("xdg-open") + .arg(self.saved_filename.unwrap()) + .spawn() + .unwrap(); + } } } } @@ -398,3 +424,7 @@ fn is_wayland() -> bool { .unwrap() .eq_ignore_ascii_case("wayland") } + +fn is_snap() -> bool { + std::env::var("SNAP").unwrap_or(String::new()).len() > 0 +} From c984d7b4d77dd745b06a202ba9afd3e9ade5578b Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Tue, 9 Mar 2021 18:52:17 +0300 Subject: [PATCH 4/5] support GIF add environments for DATA_DIR, PO_DIR, INTERFACES_DIR fix(Gtk-CRITICAL): assertion 'GTK_IS_CONTAINER (container)' failed --- src/ffmpeg_interface.rs | 2 +- src/main.rs | 78 ++++++++++++++++++++++++----------------- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/src/ffmpeg_interface.rs b/src/ffmpeg_interface.rs index a956e96..d355f22 100644 --- a/src/ffmpeg_interface.rs +++ b/src/ffmpeg_interface.rs @@ -51,7 +51,7 @@ impl ProgressWidget { } pub fn hide(&self) { - self.dialog.emit_close(); + self.dialog.hide(); } } diff --git a/src/main.rs b/src/main.rs index d61adbc..cc2cd03 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,11 +14,12 @@ use glib::signal::Inhibit; use gtk::prelude::*; use gtk::ComboBoxText; use gtk::{ - AboutDialog, Builder, Button, CheckButton, CssProvider, Entry, FileChooser, Label, - MenuItem, SpinButton, Window, + AboutDialog, Builder, Button, CheckButton, CssProvider, Entry, FileChooser, Label, MenuItem, + SpinButton, Window, }; use libappindicator::{AppIndicator, AppIndicatorStatus}; use std::cell::RefCell; +use std::ops::Add; use std::path::Path; use std::process::{Command, Stdio}; use std::rc::Rc; @@ -41,22 +42,30 @@ fn main() { if user_interface_path_abs.exists() { builder = Builder::from_file(user_interface_path_abs); } else { - builder = Builder::from_file("interfaces/main.ui"); + builder = Builder::from_file( + std::env::var("INTERFACES_DIR") + .unwrap_or(String::from("interfaces/")) + .add("main.ui"), + ); } // translate + let mut po_path_abs = { + let mut current_exec_dir = std::env::current_exe().unwrap(); + current_exec_dir.pop(); + current_exec_dir + } + .join(Path::new("po")); + + if !po_path_abs.exists() { + po_path_abs = std::fs::canonicalize(Path::new( + &std::env::var("PO_DIR").unwrap_or(String::from("po")), + )) + .unwrap(); + } + setlocale(LocaleCategory::LcAll, ""); - bindtextdomain( - "blue-recorder", - { - let mut current_exec_dir = std::env::current_exe().unwrap(); - current_exec_dir.pop(); - current_exec_dir - } - .join(Path::new("po")) - .to_str() - .unwrap(), - ); + bindtextdomain("blue-recorder", po_path_abs.to_str().unwrap()); textdomain("blue-recorder"); // config initialize @@ -115,8 +124,7 @@ fn main() { format_chooser_combobox.append(Some("avi"), &gettext("AVI (Audio Video Interleaved)")); format_chooser_combobox.append(Some("mp4"), &gettext("MP4 (MPEG-4 Part 14)")); format_chooser_combobox.append(Some("wmv"), &gettext("WMV (Windows Media Video)")); - // TODO: gif not work at this time, fix it! - // format_chooser_combobox.append(Some("gif"), &gettext("GIF (Graphics Interchange Format)")); + format_chooser_combobox.append(Some("gif"), &gettext("GIF (Graphics Interchange Format)")); format_chooser_combobox.append(Some("nut"), &gettext("NUT (NUT Recording Format)")); format_chooser_combobox.set_active(Some(0)); @@ -292,22 +300,21 @@ fn main() { }); // init record struct - let ffmpeg_record_interface: Rc> = - Rc::new(RefCell::new(Ffmpeg { - filename: (folder_chooser, filename_entry, format_chooser_combobox), - record_video: video_switch, - record_audio: audio_switch, - audio_id: audio_source_combobox, - record_mouse: mouse_switch, - follow_mouse: follow_mouse_switch, - record_frames: frames_spin, - record_delay: delay_spin, - command: command_entry, - process_id: None, - saved_filename: None, - unbound: None, - progress_widget: ProgressWidget::new(&main_window) - })); + let ffmpeg_record_interface: Rc> = Rc::new(RefCell::new(Ffmpeg { + filename: (folder_chooser, filename_entry, format_chooser_combobox), + record_video: video_switch, + record_audio: audio_switch, + audio_id: audio_source_combobox, + record_mouse: mouse_switch, + follow_mouse: follow_mouse_switch, + record_frames: frames_spin, + record_delay: delay_spin, + command: command_entry, + process_id: None, + saved_filename: None, + unbound: None, + progress_widget: ProgressWidget::new(&main_window), + })); // App Indicator let mut indicator_icon_path = { @@ -318,7 +325,12 @@ fn main() { .join(Path::new("data/blue-recorder.png")); if !indicator_icon_path.exists() { - indicator_icon_path = std::fs::canonicalize(Path::new("data/blue-recorder.png")).unwrap(); + indicator_icon_path = std::fs::canonicalize(Path::new( + &std::env::var("DATA_DIR") + .unwrap_or(String::from("data/")) + .add("blue-recorder.png"), + )) + .unwrap(); } let indicator = Rc::new(RefCell::new(AppIndicator::new( From 4c4762ac339aac55f26d47b2cbb2f8f9f196cd40 Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Tue, 9 Mar 2021 18:52:34 +0300 Subject: [PATCH 5/5] support GIF add environments for DATA_DIR, PO_DIR, INTERFACES_DIR fix(Gtk-CRITICAL): assertion 'GTK_IS_CONTAINER (container)' failed --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13003cf..a1e0d61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,7 +131,7 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "blue-recorder" -version = "0.1.1" +version = "0.1.2" dependencies = [ "chrono", "gdk", diff --git a/Cargo.toml b/Cargo.toml index 635b3e0..e290eb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blue-recorder" -version = "0.1.1" +version = "0.1.2" authors = ["Salem Yaslem "] edition = "2018"