diff options
-rw-r--r-- | Cargo.lock | 10 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Makefile.toml | 8 | ||||
-rw-r--r-- | default-plugins/status-bar/Cargo.toml | 1 | ||||
-rw-r--r-- | default-plugins/status-bar/src/main.rs | 1 | ||||
-rw-r--r-- | default-plugins/tab-bar/Cargo.toml | 1 | ||||
-rw-r--r-- | default-plugins/tab-bar/src/line.rs | 1 | ||||
-rw-r--r-- | default-plugins/tab-bar/src/tab.rs | 1 | ||||
-rw-r--r-- | zellij-tile-extra/Cargo.toml | 12 | ||||
l--------- | zellij-tile-extra/LICENSE.md | 1 | ||||
-rw-r--r-- | zellij-tile-extra/src/lib.rs | 15 | ||||
-rw-r--r-- | zellij-tile/src/lib.rs | 16 |
12 files changed, 52 insertions, 17 deletions
diff --git a/Cargo.lock b/Cargo.lock index d5a0de39d..56986ed21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1483,6 +1483,7 @@ dependencies = [ "ansi_term 0.12.1", "colored", "zellij-tile", + "zellij-tile-extra", ] [[package]] @@ -1575,6 +1576,7 @@ dependencies = [ "ansi_term 0.12.1", "colored", "zellij-tile", + "zellij-tile-extra", ] [[package]] @@ -2249,6 +2251,7 @@ dependencies = [ "wasmer-wasi", "xrdb", "zellij-tile", + "zellij-tile-extra", ] [[package]] @@ -2261,3 +2264,10 @@ dependencies = [ "strum", "strum_macros", ] + +[[package]] +name = "zellij-tile-extra" +version = "1.0.0" +dependencies = [ + "ansi_term 0.12.1", +] diff --git a/Cargo.toml b/Cargo.toml index bfdfa8843..a1f260cc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,6 +39,7 @@ interprocess = "1.0.1" xrdb = "0.1.1" colors-transform = "0.2.5" zellij-tile = { path = "zellij-tile/", version = "1.1.0" } +zellij-tile-extra = { path = "zellij-tile-extra/", version="1.0.0" } [dependencies.async-std] version = "1.3.0" @@ -54,6 +55,7 @@ structopt = "0.3" [workspace] members = [ "zellij-tile", + "zellij-tile-extra", "default-plugins/status-bar", "default-plugins/strider", "default-plugins/tab-bar", diff --git a/Makefile.toml b/Makefile.toml index 628899f9d..1d11f0d1a 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -108,7 +108,7 @@ args = ["install", "cross"] [tasks.publish] clear = true workspace = false -dependencies = ["build-plugins-release", "wasm-opt-plugins", "build-release", "publish-zellij-tile"] +dependencies = ["build-plugins-release", "wasm-opt-plugins", "build-release", "publish-zellij-tile", "publish-zellij-tile-extra"] run_task = "publish-zellij" [tasks.publish-zellij-tile] @@ -117,6 +117,12 @@ cwd = "zellij-tile" command = "cargo" args = ["publish"] +[tasks.publish-zellij-tile-extra] +ignore_errors = true +cwd = "zellij-tile-extra" +command = "cargo" +args = ["publish"] + [tasks.publish-zellij] command = "cargo" args = ["publish"]
\ No newline at end of file diff --git a/default-plugins/status-bar/Cargo.toml b/default-plugins/status-bar/Cargo.toml index c94d8feb8..8c6cc85de 100644 --- a/default-plugins/status-bar/Cargo.toml +++ b/default-plugins/status-bar/Cargo.toml @@ -9,3 +9,4 @@ license = "MIT" colored = "2" ansi_term = "0.12" zellij-tile = { path = "../../zellij-tile" } +zellij-tile-extra = { path = "../../zellij-tile-extra" }
\ No newline at end of file diff --git a/default-plugins/status-bar/src/main.rs b/default-plugins/status-bar/src/main.rs index 8b13e763b..93898cea3 100644 --- a/default-plugins/status-bar/src/main.rs +++ b/default-plugins/status-bar/src/main.rs @@ -5,6 +5,7 @@ use ansi_term::Style; use std::fmt::{Display, Error, Formatter}; use zellij_tile::prelude::*; +use zellij_tile_extra::*; use first_line::{ctrl_keys, superkey}; use second_line::keybinds; diff --git a/default-plugins/tab-bar/Cargo.toml b/default-plugins/tab-bar/Cargo.toml index 59b95b4bf..d27144ddc 100644 --- a/default-plugins/tab-bar/Cargo.toml +++ b/default-plugins/tab-bar/Cargo.toml @@ -9,3 +9,4 @@ license = "MIT" colored = "2" ansi_term = "0.12" zellij-tile = { path = "../../zellij-tile" } +zellij-tile-extra = { path = "../../zellij-tile-extra" }
\ No newline at end of file diff --git a/default-plugins/tab-bar/src/line.rs b/default-plugins/tab-bar/src/line.rs index ae287d2e8..98ad51668 100644 --- a/default-plugins/tab-bar/src/line.rs +++ b/default-plugins/tab-bar/src/line.rs @@ -2,6 +2,7 @@ use ansi_term::ANSIStrings; use crate::{LinePart, ARROW_SEPARATOR}; use zellij_tile::prelude::*; +use zellij_tile_extra::*; fn get_current_title_len(current_title: &[LinePart]) -> usize { current_title diff --git a/default-plugins/tab-bar/src/tab.rs b/default-plugins/tab-bar/src/tab.rs index cbe744466..ab110634a 100644 --- a/default-plugins/tab-bar/src/tab.rs +++ b/default-plugins/tab-bar/src/tab.rs @@ -1,6 +1,7 @@ use crate::{LinePart, ARROW_SEPARATOR}; use ansi_term::ANSIStrings; use zellij_tile::prelude::*; +use zellij_tile_extra::*; pub fn active_tab(text: String, palette: Palette) -> LinePart { let left_separator = style!(palette.bg, palette.green).paint(ARROW_SEPARATOR); diff --git a/zellij-tile-extra/Cargo.toml b/zellij-tile-extra/Cargo.toml new file mode 100644 index 000000000..69a0298be --- /dev/null +++ b/zellij-tile-extra/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "zellij-tile-extra" +version = "1.0.0" +authors = ["denis <denismaximov98@gmail.com>"] +edition = "2018" +description = "A utility library for Zellij plugins" +license = "MIT" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +ansi_term = "0.12.1"
\ No newline at end of file diff --git a/zellij-tile-extra/LICENSE.md b/zellij-tile-extra/LICENSE.md new file mode 120000 index 000000000..7eabdb1c2 --- /dev/null +++ b/zellij-tile-extra/LICENSE.md @@ -0,0 +1 @@ +../LICENSE.md
\ No newline at end of file diff --git a/zellij-tile-extra/src/lib.rs b/zellij-tile-extra/src/lib.rs new file mode 100644 index 000000000..bec19158c --- /dev/null +++ b/zellij-tile-extra/src/lib.rs @@ -0,0 +1,15 @@ +#[macro_export] +macro_rules! rgb { + ($a:expr) => { + ansi_term::Color::RGB($a.0, $a.1, $a.2) + }; +} + +#[macro_export] +macro_rules! style { + ($a:expr, $b:expr) => { + ansi_term::Style::new() + .fg(ansi_term::Color::RGB($a.0, $a.1, $a.2)) + .on(ansi_term::Color::RGB($b.0, $b.1, $b.2)) + }; +} diff --git a/zellij-tile/src/lib.rs b/zellij-tile/src/lib.rs index 3ab490613..af7d8ca12 100644 --- a/zellij-tile/src/lib.rs +++ b/zellij-tile/src/lib.rs @@ -39,19 +39,3 @@ macro_rules! register_plugin { } }; } - -#[macro_export] -macro_rules! rgb { - ($a:expr) => { - ansi_term::Color::RGB($a.0, $a.1, $a.2) - }; -} - -#[macro_export] -macro_rules! style { - ($a:expr, $b:expr) => { - ansi_term::Style::new() - .fg(ansi_term::Color::RGB($a.0, $a.1, $a.2)) - .on(ansi_term::Color::RGB($b.0, $b.1, $b.2)) - }; -} |