daemonize application
This commit is contained in:
Generated
+18
@@ -5,3 +5,21 @@ version = 4
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ct"
|
name = "ct"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"daemonize",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "daemonize"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ab8bfdaacb3c887a54d41bdf48d3af8873b3f5566469f8ba21b92057509f116e"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libc"
|
||||||
|
version = "0.2.176"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174"
|
||||||
|
|||||||
@@ -5,3 +5,4 @@ edition = "2024"
|
|||||||
description = "Custom Timer"
|
description = "Custom Timer"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
daemonize = "0.5.0"
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ use std::{
|
|||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use daemonize::Daemonize;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let args: Vec<String> = args().collect();
|
let args: Vec<String> = args().collect();
|
||||||
let timeout: u64 = args.get(1)
|
let timeout: u64 = args.get(1)
|
||||||
@@ -28,6 +30,11 @@ fn main() {
|
|||||||
path
|
path
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Daemonize::new()
|
||||||
|
.working_directory(env::current_dir().unwrap())
|
||||||
|
.start()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
sleep(sleeping_amount);
|
sleep(sleeping_amount);
|
||||||
|
|
||||||
let mut sound_alert = Command::new("pw-play")
|
let mut sound_alert = Command::new("pw-play")
|
||||||
|
|||||||
Reference in New Issue
Block a user