mirror of
https://github.com/xlmnxp/blue-recorder.git
synced 2024-11-23 17:13:11 +03:00
Working X11 version
This commit is contained in:
parent
258cda823b
commit
78ec81da45
@ -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"
|
||||
|
@ -1,363 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
version="1.1"
|
||||
id="svg62"
|
||||
width="170.66667"
|
||||
height="170.66667"
|
||||
viewBox="0 0 170.66667 170.66667"
|
||||
sodipodi:docname="blue-recorder-active.svg"
|
||||
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
|
||||
inkscape:export-filename="/home/albaroty/Pictures/logo_blue_recorder.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<metadata
|
||||
id="metadata68">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs66">
|
||||
<linearGradient
|
||||
id="linearGradient4698"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#058ef6;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4696" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4621"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4619" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4615"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#030303;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4613" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4609"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4607" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4549"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#030303;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4547" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4543"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#058ef6;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4541" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4064"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#058ef6;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4062" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3862"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#fcfcfc;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop3860" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient1624"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop1622" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient1618"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop1616" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3311"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#090028;stop-opacity:0.60392159;"
|
||||
offset="0"
|
||||
id="stop3309" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3305"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#058ef6;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3303" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3299"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#1192f3;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3297" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3293"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#1192f3;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3291" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3287"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#1192f3;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3285" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3257"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#ff0000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3255" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3251"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#1192f3;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3249" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3245"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3243" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3225"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#ff0000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3223" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3213"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#ff0000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3211" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3207"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#030303;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3205" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient2948"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#1192f3;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop2946" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient856"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#1192f3;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop854" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient850"
|
||||
inkscape:swatch="solid">
|
||||
<stop
|
||||
style="stop-color:#1192f3;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop848" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3207"
|
||||
id="linearGradient3209"
|
||||
x1="121.80067"
|
||||
y1="84.575974"
|
||||
x2="168.20712"
|
||||
y2="84.575974"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3213"
|
||||
id="linearGradient3215"
|
||||
x1="121.80067"
|
||||
y1="84.575973"
|
||||
x2="168.20712"
|
||||
y2="84.575973"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3245"
|
||||
id="linearGradient3247"
|
||||
x1="8.210619"
|
||||
y1="85.030476"
|
||||
x2="118.6838"
|
||||
y2="85.030476"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3862"
|
||||
id="linearGradient4066"
|
||||
x1="-98.70813"
|
||||
y1="91.882187"
|
||||
x2="-19.218285"
|
||||
y2="91.882187"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.72827722,0,0,0.8345753,80.950138,8.2092762)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3862"
|
||||
id="linearGradient4258"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.72827722,0,0,0.8345753,132.37174,8.2021688)"
|
||||
x1="-98.70813"
|
||||
y1="91.882187"
|
||||
x2="-19.218285"
|
||||
y2="91.882187" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="692"
|
||||
id="namedview64"
|
||||
showgrid="false"
|
||||
inkscape:zoom="2.5013183"
|
||||
inkscape:cx="77.159314"
|
||||
inkscape:cy="74.360789"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g70"
|
||||
inkscape:document-rotation="0"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1" />
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
inkscape:label="Image"
|
||||
id="g70">
|
||||
<rect
|
||||
style="opacity:1;fill:#058ef6;fill-opacity:1;stroke:#1192f3;stroke-width:2.92809;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect949"
|
||||
width="167.32172"
|
||||
height="166.60974"
|
||||
x="1.5693487"
|
||||
y="2.2145147"
|
||||
rx="22.684824"
|
||||
ry="22.919044" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ff0000;fill-rule:evenodd;fill-opacity:1;stroke:url(#linearGradient3247)"
|
||||
id="rect74"
|
||||
width="110.47318"
|
||||
height="79.478859"
|
||||
x="8.210619"
|
||||
y="45.291046"
|
||||
ry="18.463987"
|
||||
rx="16.285496" />
|
||||
<path
|
||||
style="fill:url(#linearGradient3215);stroke:url(#linearGradient3209);stroke-width:1.5164px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;paint-order:markers fill stroke;fill-opacity:1"
|
||||
d="m 122.80105,72.350264 c 0,0 8.22528,-5.421058 26.57003,-17.501126 17.8691,-11.766838 17.86924,3.392739 17.86924,15.652523 0,23.061598 0.2086,11.932385 0.2086,31.642149 0,17.20932 -7.40475,20.52681 -20.96009,11.60058 -18.69452,-12.31038 -23.9254,-14.363562 -23.9254,-14.363562 z"
|
||||
id="path114"
|
||||
sodipodi:nodetypes="ccccccc" />
|
||||
<ellipse
|
||||
style="opacity:0.954171;fill:url(#linearGradient4066);fill-opacity:1;stroke:#000000;stroke-width:0.826393;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
|
||||
id="path4060"
|
||||
cx="38.008572"
|
||||
cy="84.891869"
|
||||
rx="24.408154"
|
||||
ry="26.722046" />
|
||||
<ellipse
|
||||
style="opacity:0.954171;fill:url(#linearGradient4258);fill-opacity:1;stroke:#000000;stroke-width:0.826393;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
|
||||
id="path4060-6"
|
||||
cx="89.430161"
|
||||
cy="84.884766"
|
||||
rx="24.408154"
|
||||
ry="26.722046" />
|
||||
<rect
|
||||
style="opacity:1;fill:#058ef6;fill-opacity:1;stroke:#000000;stroke-width:1.00159;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
id="rect4605"
|
||||
width="65.381508"
|
||||
height="11.685902"
|
||||
x="31.363594"
|
||||
y="57.767193"
|
||||
rx="21.006493"
|
||||
ry="1.8877746" />
|
||||
<ellipse
|
||||
style="fill:none;stroke:#058ef6;stroke-width:12.2205;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="circle941-2"
|
||||
cx="37.828201"
|
||||
cy="85.038574"
|
||||
rx="18.093803"
|
||||
ry="20.405428" />
|
||||
<ellipse
|
||||
style="opacity:1;fill:none;stroke:#058ef6;stroke-width:12.2205;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="circle941"
|
||||
cx="89.269768"
|
||||
cy="84.87233"
|
||||
rx="18.093803"
|
||||
ry="20.405428" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 11 KiB |
@ -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<ksni::MenuItem<Self>> {
|
||||
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<BlueRecorderTray>,
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user