daemonize application
This commit is contained in:
18
Cargo.lock
generated
18
Cargo.lock
generated
@@ -5,3 +5,21 @@ version = 4
|
||||
[[package]]
|
||||
name = "ct"
|
||||
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"
|
||||
|
||||
[dependencies]
|
||||
daemonize = "0.5.0"
|
||||
|
||||
@@ -6,6 +6,8 @@ use std::{
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use daemonize::Daemonize;
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = args().collect();
|
||||
let timeout: u64 = args.get(1)
|
||||
@@ -28,6 +30,11 @@ fn main() {
|
||||
path
|
||||
});
|
||||
|
||||
Daemonize::new()
|
||||
.working_directory(env::current_dir().unwrap())
|
||||
.start()
|
||||
.unwrap();
|
||||
|
||||
sleep(sleeping_amount);
|
||||
|
||||
let mut sound_alert = Command::new("pw-play")
|
||||
|
||||
Reference in New Issue
Block a user