summaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/consts.rs
diff options
context:
space:
mode:
authorJae-Heon Ji <32578710+jaeheonji@users.noreply.github.com>2023-04-27 00:26:07 +0900
committerGitHub <noreply@github.com>2023-04-27 00:26:07 +0900
commitff36798c9e52c9c73111afd03c9a69ecb1aee073 (patch)
treec03640f71a6dc08ef544e8dd34aa4ce5c49ff28f /zellij-utils/src/consts.rs
parent0a8bbd7f2310b849dec324aae88c546f82ec7fe8 (diff)
feat: provide default themes (#2307)
* refactor: move themes to zellij-assets * feat: add theme to the binary * chore: move new theme from example to assets
Diffstat (limited to 'zellij-utils/src/consts.rs')
-rw-r--r--zellij-utils/src/consts.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/zellij-utils/src/consts.rs b/zellij-utils/src/consts.rs
index 5709db891..b851b1524 100644
--- a/zellij-utils/src/consts.rs
+++ b/zellij-utils/src/consts.rs
@@ -1,5 +1,6 @@
//! Zellij program-wide constants.
+use crate::input::theme::Themes;
use directories_next::ProjectDirs;
use lazy_static::lazy_static;
use once_cell::sync::OnceCell;
@@ -28,6 +29,19 @@ lazy_static! {
pub static ref ZELLIJ_PROJ_DIR: ProjectDirs =
ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap();
pub static ref ZELLIJ_CACHE_DIR: PathBuf = ZELLIJ_PROJ_DIR.cache_dir().to_path_buf();
+ pub static ref ZELLIJ_DEFAULT_THEMES: Themes = {
+ let mut default_themes = Themes::default();
+
+ let path = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/themes"));
+ match Themes::from_dir(path) {
+ Ok(themes) => {
+ default_themes = default_themes.merge(themes);
+ },
+ Err(_) => {},
+ }
+
+ default_themes
+ };
}
pub const FEATURES: &[&str] = &[