i3-style
i3-style copied to clipboard
Thread panic when not loaded from i3
I'll admit that this is a corner case and one that I doubt you'll frequently run into; however, I wanted to mention it regardless.
I switch back and forth between Plasma 5 and i3. I booted into Plasma today and while surfing crates.io, I noticed this package. Installed it and upon running it with a few different flags, I kept getting errors.I decided to run the command almost directly from the readme. Here's the output::
$ i3-style gruvbox --output ~/.config/i3/config --reload
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:1009:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at libstd/panicking.rs:211
3: std::panicking::default_hook
at libstd/panicking.rs:227
4: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:477
5: std::panicking::continue_panic_fmt
at libstd/panicking.rs:391
6: rust_begin_unwind
at libstd/panicking.rs:326
7: core::panicking::panic_fmt
at libcore/panicking.rs:77
8: core::result::unwrap_failed
9: i3_style::validate_config
10: i3_style::main
11: std::rt::lang_start::{{closure}}
12: std::panicking::try::do_call
at libstd/rt.rs:59
at libstd/panicking.rs:310
13: __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:103
14: std::rt::lang_start_internal
at libstd/panicking.rs:289
at libstd/panic.rs:392
at libstd/rt.rs:58
15: main
16: __libc_start_main
17: _start
Restarted the computer and booted into i3 and am experiencing the same issue.
Sorry my rust is bad. It's supposed to print a nice error message instead of panic.
Thr panic comes from i3-msg not being found in the path when trying to reload. If you run under wayland, it tries to use swaymsg. Look at the end of main.rs for the reload logic.
Ah ok looking at this again, it's in the config validation step which requires i3 to be in the PATH. Maybe the way I'm trying to find the command in the PATH is wrong. I'll take a look at it.
Hahah no worries. I dont know rust at all, I honestly just thought it was a neat idea and wanted to share my traceback with you. Sorry I cant be of more help but if you have any questions, id be happy to answer anything that you think would help!
I just pushed some changes to master that improves the error message. Can you test it and see if the panic is still there?
I've experienced the same issues with a fresh install of i3 and cargo/rust. I had to use older version available on npm which work still just fine.