1use std::{path::PathBuf, sync::Mutex};
2
3use once_cell::sync::Lazy;
4
5pub mod keys;
6pub mod nodes;
7pub mod shell;
8pub mod tui;
9pub mod yml;
10
11pub const CONFIG_FILE_NAME: &str = ".blz.yml";
12pub const NU_SOURCE_NAME: &str = ".leader_keys.nu";
13
14pub static CONFIG_DIR: Lazy<PathBuf> = Lazy::new(|| {
15 shellexpand::tilde("~/.config/blaze-keys")
16 .to_string()
17 .into()
18});
19
20#[derive(PartialEq, Copy, Clone)]
21pub enum Shell {
22 Zsh,
23 Nu,
24}
25
26pub static SHELL: Mutex<Shell> = Mutex::new(Shell::Zsh);
27
28pub fn is_nushell() -> bool {
29 *SHELL.lock().unwrap() == Shell::Nu
30}