Pi66

pino-rs
Rust notification daemon.
git clone https://git.pi66.xyz/pino-rs

src/config.rs

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
use std::{
    fs::{OpenOptions, create_dir_all},
    io::Write,
    path::PathBuf,
};

pub fn generate_config(config_path: PathBuf) {
    let config = config_path.join("pino").join("config.toml");

    create_dir_all(config.parent().unwrap()).expect("Failed to create directories for template");
    println!("Creating config file at: {}", config.display());
    let mut template = OpenOptions::new()
        .write(true)
        .create(true)
        .truncate(true)
        .open(&config)
        .expect("Can't Create Template File !!!");

    template
        .write_all(
            b"[screen]
monitor = 0 # Set the monitor using index

# Placment: 
#   top_left  |   top_center  |  top_right
# bottom_left | bottom_center | bottom_right

placement = \"top_left\"
x = 25                  # X access palcement
y = 55                  # Y access palcement

width = 300     # Width  of the app
height = 100    # Height of the app

delay = 5 # Time to display the app (in seconds)

[frame]
fg_color = \"#1a1e24\" 

# Run \"pino -f\" to show all available fonts
font_family = \"Fira Code\"

[border]
weight = 4 
color = \"#ffffff\"
radius = 8

[title]
color = \"#c5c6c8\"
font_size = 19
x = 4
y = 10

[message]
color = \"#626977\"
font_size = 15
x = 10
y = 45

[pywal]
pywal = false

# You can choose colors from colors[0-15] or use these values: \"bg\", \"fg\"
# Check ~/.cache/wal/colors-pino.toml file
background_color  = \"bg\"
border_color      = \"color1\"
title_color       = \"fg\"
message_color     = \"color8\"

",
        )
        .expect("Can't Create Template File !!!");
}