@@ -11,17 +11,49 @@ use miette::IntoDiagnostic;
11
11
const LOGO : & [ u8 ; 64 * 64 * 4 ] = include_bytes ! ( concat!( env!( "OUT_DIR" ) , "/logo.bin" ) ) ;
12
12
13
13
fn main ( ) -> miette:: Result < ( ) > {
14
+ // On linux, a daemon is required to provide clipboard access even when
15
+ // the process dies.
16
+ //
17
+ // More info: <https://docs.rs/arboard/3.5.0/arboard/trait.SetExtLinux.html#tymethod.wait>
18
+ #[ cfg( target_os = "linux" ) ]
19
+ {
20
+ if std:: env:: args ( )
21
+ . nth ( 1 )
22
+ . as_deref ( )
23
+ . is_some_and ( |arg| arg == ferrishot:: CLIPBOARD_DAEMON_ID )
24
+ {
25
+ ferrishot:: run_clipboard_daemon ( ) . expect ( "Failed to run clipboard daemon" ) ;
26
+ return Ok ( ( ) ) ;
27
+ }
28
+ }
29
+
14
30
// This will parse the command line arguments.
15
31
//
16
32
// Needs to come before the logging initialization because there
17
33
// is an argument to change the verbosity
18
34
LazyLock :: force ( & CLI ) ;
19
35
36
+ // env_logger::Builder::new()
37
+ // .format(|buf, record| {
38
+ // writeln!(
39
+ // buf,
40
+ // "{}:{} {} [{}] - {}",
41
+ // record.file().unwrap_or("unknown"),
42
+ // record.line().unwrap_or(0),
43
+ // chrono::Local::now().format("%Y-%m-%dT%H:%M:%S%.3f"),
44
+ // record.level(),
45
+ // record.args()
46
+ // )
47
+ // })
48
+ // .target(env_logger::Target::Pipe(target))
49
+ // .filter(None, log::LevelFilter::Error)
50
+ // .init();
51
+
20
52
// Initialize logging
21
53
// TODO:
22
54
// - log to file.
23
55
// - add ways to increase logging with command line arguments. Currently you must use `RUST_LOG=info`
24
- env_logger:: builder ( ) . init ( ) ;
56
+ // env_logger::builder().init();
25
57
26
58
LazyLock :: force ( & ferrishot:: CONFIG ) ;
27
59
@@ -38,22 +70,6 @@ fn main() -> miette::Result<()> {
38
70
return Ok ( ( ) ) ;
39
71
}
40
72
41
- // On linux, a daemon is required to provide clipboard access even when
42
- // the process dies.
43
- //
44
- // More info: <https://docs.rs/arboard/3.5.0/arboard/trait.SetExtLinux.html#tymethod.wait>
45
- #[ cfg( target_os = "linux" ) ]
46
- {
47
- if std:: env:: args ( )
48
- . nth ( 1 )
49
- . as_deref ( )
50
- . is_some_and ( |arg| arg == ferrishot:: CLIPBOARD_DAEMON_ID )
51
- {
52
- ferrishot:: run_clipboard_daemon ( ) . expect ( "Failed to run clipboard daemon" ) ;
53
- return Ok ( ( ) ) ;
54
- }
55
- }
56
-
57
73
iced:: application ( App :: default, App :: update, App :: view)
58
74
. window ( iced:: window:: Settings {
59
75
level : iced:: window:: Level :: Normal ,
0 commit comments