systemd-user-timers-lib

Crates.iosystemd-user-timers-lib
lib.rssystemd-user-timers-lib
version1.1.3
created_at2026-01-06 22:29:56.97959+00
updated_at2026-01-07 01:40:00.726128+00
descriptionA simple way to make systemd user timers. This is the library, not the CLI.
homepagehttps://systemd-user-timers.galacticsystemsindevelopment.xyz
repositoryhttps://github.com/galacticSystemsInDevelopment/systemd-user-timers-lib
max_upload_size
id2027034
size14,783
Colorful Light 48 (colorfulLight48)

documentation

README

systemd-user-timers-lib

Systemd User Timers Library

This is the library. For the app, see https://github.com/galacticSystemsInDevelopment/systemd-user-timers.

Add to your Rust project:

cargo add systemd-user-timers-lib

Modules

Add example:

use systemd_user_timers_lib::timers::Timer;
fn main() {
  let timer = Timer {
        name: "notify".to_string(),
        description: "5 Minute Notify Timer".to_string(),
        schedule: "5min".to_string(),
        executable: "/home/user/notify.sh",
        exec_if_missed: false,
        single_use: false,     
        recurring: false,       
        on_calendar: false,    
        from_boot: false,      
        normal_service: false,   
        service: None,         
        already_made_service: false, 
        enable_at_login: false, 
        start_after_create: true, 
  };
  println!("{}", systemd_user_timers_lib::add_timer:add_timer(timer));

}

Start example:

fn main() {
  let output = systemd_user_timers_lib::start::start("notify").unwrap_or_else(|e| {
        eprintln!("Error listing timers: {}", e);
        String::new()  // Returning an empty string on error
    });

    if !output.is_empty() {
        println!("{}", output);  // Print the output
    }
}

Stop example:

fn main() {
      println!("{}", systemd_user_timers_lib::stop::stop("notify").unwrap());
}

List example

fn main() {
      let output = systemd_user_timers_lib::list_timers::list_timers().unwrap_or_else(|e| {
        eprintln!("Error listing timers: {}", e);
        String::new()  // Returning an empty string on error
    });

    if !output.is_empty() {
        println!("{}", output);  // Print the output
    }
}
Commit count: 12

cargo fmt