wallpapers 0.3.0

Set wallpaper periodically.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::*;

use daemonize::Daemonize;
use std::process::exit;

impl DaemonRunner for Daemon {
    fn run<F: 'static + FnOnce(Receiver<State>)>(&self, f: F) -> Result<(), Error> {
        let d = Daemonize::new()
            .pid_file("/data/wallpapers/wallpapers.pid")
            .chown_pid_file(true);
        match d.start() {
            Ok(_) => f(),
            Err(_) => exit(-1),
        };
        Ok(())
    }
}