From a8eefccac5bc814b19f6e1015e0329927be0de24 Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Mon, 11 Sep 2023 12:30:41 +0900 Subject: [PATCH 01/11] bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef850ce..4927537 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2859,7 +2859,7 @@ dependencies = [ [[package]] name = "zellij-datetime" -version = "0.18.0" +version = "0.19.0" dependencies = [ "ansi_term", "chrono-wasi", diff --git a/Cargo.toml b/Cargo.toml index d9b39b9..304d3ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zellij-datetime" -version = "0.18.0" +version = "0.19.0" authors = ["h1romas4 "] edition = "2021" From d96d8323140bd8ef581adec4a358e51119c483b7 Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Mon, 11 Sep 2023 13:12:46 +0900 Subject: [PATCH 02/11] update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e5f8db..feb1073 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ layout { | `arrow_separator1` | `"string"` | `""` | Delimiter string on line. Only the first character. | | `arrow_separator2` | `"string"` | `""` | 📅 Only the first character. | | `arrow_separator3` | `"string"` | `""` | ⌚ Only the first character. | -| `padding_adjust` | `i32` | `0` | It can be used to adjust left-justified padding. For example, adjusting the separator width if it is off by full-width. | +| `padding_adjust` | i32 | `0` | It can be used to adjust left-justified padding. For example, adjusting the separator width if it is off by full-width. | | `text_align` | `"string"` | `"right"` | `right` or `left` or `center` | ## Build From e1cb48e303cbffee51eaf607c1606fc88fb60977 Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Thu, 21 Sep 2023 20:36:49 +0900 Subject: [PATCH 03/11] add todo --- src/line.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/line.rs b/src/line.rs index 57a65e4..e08bb4a 100644 --- a/src/line.rs +++ b/src/line.rs @@ -93,6 +93,7 @@ impl Line { let padding: String = if cols as isize - width as isize > 0 { let size = match self.text_align { TextAlign::Right | TextAlign::Left => cols - width, + // TODO: Incorrect calculation for odd-numbered characters. TextAlign::Center => (cols - width) / 2, }; let space = " ".repeat(size); From e1085de8921bf2279f504e654dfe31cbdc0e0ea7 Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Fri, 22 Sep 2023 19:21:53 +0900 Subject: [PATCH 04/11] add .gitignore for inttelij --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ea8c4bf..6db043d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +.idea /target From 02500fe4d31c037120804bd7a9634e509b0a6b91 Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Fri, 22 Sep 2023 19:29:33 +0900 Subject: [PATCH 05/11] fix typo --- src/config.rs | 10 +++++----- src/main.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/config.rs b/src/config.rs index d7ce9df..b8a4dec 100644 --- a/src/config.rs +++ b/src/config.rs @@ -15,7 +15,7 @@ static DEFAULT_TEXT_ALIGN: &str = "right"; pub struct Config { timezone: LinkedHashMap, default_timezone: String, - backgound_color: (u8, u8, u8), + background_color: (u8, u8, u8), foreground_color: (u8, u8, u8), pane_color: (u8, u8, u8), enable_right_click: bool, @@ -33,7 +33,7 @@ impl Default for Config { Config { timezone, default_timezone: default_timezone.to_string(), - backgound_color: parse_color(DEFAULT_BACKGROUND_COLOR).unwrap(), + background_color: parse_color(DEFAULT_BACKGROUND_COLOR).unwrap(), foreground_color: parse_color(DEFAULT_FOREGROUND_COLOR).unwrap(), pane_color: parse_color(DEFAULT_PANE_COLOR).unwrap(), enable_right_click: false, @@ -91,8 +91,8 @@ impl Config { } } - pub fn get_backgound_color(&self) -> (u8, u8, u8) { - self.backgound_color + pub fn get_background_color(&self) -> (u8, u8, u8) { + self.background_color } pub fn get_foreground_color(&self) -> (u8, u8, u8) { @@ -145,7 +145,7 @@ impl Config { } "background_color" => { if let Ok(color) = parse_color(value) { - self.backgound_color = (color.0, color.1, color.2); + self.background_color = (color.0, color.1, color.2); } } "foreground_color" => { diff --git a/src/main.rs b/src/main.rs index 7004895..a4a3da8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,7 @@ impl ZellijPlugin for State { self.config.configuration(&configuration); self.reset_default_timezone(); self.line.update_style( - self.config.get_backgound_color(), + self.config.get_background_color(), self.config.get_foreground_color(), self.config.get_pane_color(), self.config.get_separator(), From ecb5ebec33bceed14567129d0c9b9b23d8e79aeb Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Tue, 26 Sep 2023 12:27:30 +0900 Subject: [PATCH 06/11] update README --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index feb1073..f591b8a 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,15 @@ cargo xtask build --release cd ../zellij-datetime cargo build # Run with container (podman or docker) -podman run --name zellij-datetime --env SHELL=/usr/bin/bash -v ../zellij/target/release/:/opt/zellij -v .:/opt/zellij-datetime -w /opt/zellij-datetime -it --rm ubuntu:22.04 /opt/zellij/zellij -l plugin.kb +podman run \ + --name zellij-datetime \ + --env SHELL=/usr/bin/bash \ + -v ../zellij/target/release/:/opt/zellij \ + -v .:/opt/zellij-datetime \ + -w /opt/zellij-datetime \ + -it --rm \ + ubuntu:22.04 \ + /opt/zellij/zellij -l plugin.kb ``` ## License From 71fafda18e6d8cd034768123861e441e3da7ea2e Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Tue, 26 Sep 2023 12:30:20 +0900 Subject: [PATCH 07/11] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f591b8a..07a6bd8 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ Production cargo install wasm-snip # Build cargo build --release -# Remove debug symbles and replaces unreachable. +# Remove debug symbols and replaces unreachable. wasm-snip target/wasm32-wasi/release/zellij-datetime.wasm -o target/wasm32-wasi/release/zellij-datetime-snip.wasm # Deploy plugin directory cp -p target/wasm32-wasi/release/zellij-datetime-snip.wasm ~/.config/zellij/plugins/zellij-datetime.wasm From 2812ef9174bedf032ebca0fbc895ce93a18b427c Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Tue, 26 Sep 2023 12:31:20 +0900 Subject: [PATCH 08/11] fix typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 07a6bd8..95e11b8 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,11 @@ zellij 0.38.0 Preparation of Plug-in deployment destination: ```bash -# create configration directory +# create configuration directory mkdir -p ~/.config/zellij/layouts/ mkdir -p ~/.config/zellij/plugins/ # If you have already created a layout file, you do not need to do the following. -# export default layaut (Be careful not to overwrite your settings) +# export default layout (Be careful not to overwrite your settings) zellij setup --dump-layout default > ~/.config/zellij/layouts/default.kdl ``` [Download zellij-datetime.wasm](https://github.com/h1romas4/zellij-datetime/releases/latest/download/zellij-datetime.wasm): From 74293626c23d0c29b4ec7144f64083ea79e802cf Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Thu, 28 Sep 2023 08:58:17 +0900 Subject: [PATCH 09/11] update README (Wasmer 3.1) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95e11b8..bccef8d 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ MIT License ### Operation log in riscv64 -At this time, RISC-V is not yet supported in Wasmer 2.3 used by Zellij. RISC-V has been supported since Wasmer 3.2. +At this time, RISC-V is not yet supported in Wasmer 3.1.1 used by Zellij. RISC-V has been supported since Wasmer 3.2. ```bash $ uname -a From 044fec0e8dac0b6e42dd32b8068e5df4783258c5 Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Tue, 3 Oct 2023 19:14:34 +0900 Subject: [PATCH 10/11] fix typo --- src/line.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/line.rs b/src/line.rs index e08bb4a..81ce14a 100644 --- a/src/line.rs +++ b/src/line.rs @@ -3,7 +3,7 @@ use zellij_tile_utils::style; #[derive(Default)] pub struct Line { - backgound_color: PaletteColor, + background_color: PaletteColor, foreground_color: PaletteColor, pane_color: PaletteColor, separator: (String, String, String), @@ -27,7 +27,7 @@ impl Default for TextAlign { impl Line { pub fn update_style( &mut self, - backgound_color: (u8, u8, u8), + background_color: (u8, u8, u8), foreground_color: (u8, u8, u8), pane_color: (u8, u8, u8), separator: &(String, String, String), @@ -35,7 +35,7 @@ impl Line { text_align: &str, ) { // set color - self.backgound_color = PaletteColor::Rgb(backgound_color); + self.background_color = PaletteColor::Rgb(background_color); self.foreground_color = PaletteColor::Rgb(foreground_color); self.pane_color = PaletteColor::Rgb(pane_color); // text align @@ -47,7 +47,7 @@ impl Line { }; // create charctor let bg_1 = self.pane_color; - let bg_2 = self.backgound_color; + let bg_2 = self.background_color; let space = &style!(bg_2, bg_2).paint(" ").to_string(); let sep_1 = &style!(bg_2, bg_1).bold().paint(&separator.0).to_string(); let sep_2 = &style!(bg_1, bg_2).bold().paint(&separator.1).to_string(); @@ -104,9 +104,9 @@ impl Line { String::new() }; - let timezone = style!(self.foreground_color, self.backgound_color).paint(timezone); - let date = style!(self.foreground_color, self.backgound_color).paint(date); - let time = style!(self.foreground_color, self.backgound_color).paint(time); + let timezone = style!(self.foreground_color, self.background_color).paint(timezone); + let date = style!(self.foreground_color, self.background_color).paint(date); + let time = style!(self.foreground_color, self.background_color).paint(time); match self.text_align { TextAlign::Right => { From 60af23c20b772205880a18dfd92decfbd5386403 Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Tue, 3 Oct 2023 19:20:51 +0900 Subject: [PATCH 11/11] fix typo --- src/line.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/line.rs b/src/line.rs index 81ce14a..9062688 100644 --- a/src/line.rs +++ b/src/line.rs @@ -45,7 +45,7 @@ impl Line { "center" => TextAlign::Center, _ => TextAlign::Right, }; - // create charctor + // create character let bg_1 = self.pane_color; let bg_2 = self.background_color; let space = &style!(bg_2, bg_2).paint(" ").to_string();