aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins/status-bar/src/tip/data
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-06-07 14:28:39 +0200
committerGitHub <noreply@github.com>2022-06-07 14:28:39 +0200
commit3be718371af9029822e2aeb3f52b5dde1b7397d1 (patch)
tree017147ebe5418a67570b9e7ea3d9ba3bf990cd83 /default-plugins/status-bar/src/tip/data
parentdocs(changelog): tweak simplified ui (diff)
downloadsl0ppij-3be718371af9029822e2aeb3f52b5dde1b7397d1.tar.gz
sl0ppij-3be718371af9029822e2aeb3f52b5dde1b7397d1.tar.xz
sl0ppij-3be718371af9029822e2aeb3f52b5dde1b7397d1.zip
feat(ui): add status bar tips (#1462)
* feat(ui): add more tips to status bar * fix(e2e): clear status-bar-tips cache for each test * style(fmt): rustfmt
Diffstat (limited to 'default-plugins/status-bar/src/tip/data')
-rw-r--r--default-plugins/status-bar/src/tip/data/compact_layout.rs87
-rw-r--r--default-plugins/status-bar/src/tip/data/edit_scrollbuffer.rs78
-rw-r--r--default-plugins/status-bar/src/tip/data/floating_panes_mouse.rs69
-rw-r--r--default-plugins/status-bar/src/tip/data/mod.rs92
-rw-r--r--default-plugins/status-bar/src/tip/data/move_focus_hjkl_tab_switch.rs64
-rw-r--r--default-plugins/status-bar/src/tip/data/quicknav.rs86
-rw-r--r--default-plugins/status-bar/src/tip/data/send_mouse_click_to_terminal.rs63
-rw-r--r--default-plugins/status-bar/src/tip/data/sync_tab.rs69
-rw-r--r--default-plugins/status-bar/src/tip/data/use_mouse.rs56
-rw-r--r--default-plugins/status-bar/src/tip/data/zellij_setup_check.rs65
10 files changed, 729 insertions, 0 deletions
diff --git a/default-plugins/status-bar/src/tip/data/compact_layout.rs b/default-plugins/status-bar/src/tip/data/compact_layout.rs
new file mode 100644
index 00000000..1632a836
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/compact_layout.rs
@@ -0,0 +1,87 @@
+use ansi_term::{
+ unstyled_len, ANSIString, ANSIStrings,
+ Color::{Fixed, RGB},
+ Style,
+};
+
+use crate::LinePart;
+use zellij_tile::prelude::*;
+use zellij_tile_utils::palette_match;
+
+macro_rules! strings {
+ ($ANSIStrings:expr) => {{
+ let strings: &[ANSIString<'static>] = $ANSIStrings;
+
+ let ansi_strings = ANSIStrings(strings);
+
+ LinePart {
+ part: format!("{}", ansi_strings),
+ len: unstyled_len(&ansi_strings),
+ }
+ }};
+}
+
+pub fn compact_layout_full(palette: Palette) -> LinePart {
+ // Tip: UI taking up too much space? Start Zellij with
+ // zellij -l compact or remove pane frames with Ctrl + <p> + <z>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("UI taking up too much space? Start Zellij with "),
+ Style::new()
+ .fg(green_color)
+ .bold()
+ .paint("zellij -l compact"),
+ Style::new().paint(" or remove pane frames with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<p>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<z>"),
+ ])
+}
+
+pub fn compact_layout_medium(palette: Palette) -> LinePart {
+ // Tip: To save screen space, start Zellij with
+ // zellij -l compact or remove pane frames with Ctrl + <p> + <z>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("To save screen space, start Zellij with "),
+ Style::new()
+ .fg(green_color)
+ .bold()
+ .paint("zellij -l compact"),
+ Style::new().paint(" or remove frames with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<p>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<z>"),
+ ])
+}
+
+pub fn compact_layout_short(palette: Palette) -> LinePart {
+ // Save screen space, start Zellij with
+ // zellij -l compact or remove pane frames with Ctrl + <p> + <z>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Save screen space, start with: "),
+ Style::new()
+ .fg(green_color)
+ .bold()
+ .paint("zellij -l compact"),
+ Style::new().paint(" or remove frames with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<p>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<z>"),
+ ])
+}
diff --git a/default-plugins/status-bar/src/tip/data/edit_scrollbuffer.rs b/default-plugins/status-bar/src/tip/data/edit_scrollbuffer.rs
new file mode 100644
index 00000000..3807f55d
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/edit_scrollbuffer.rs
@@ -0,0 +1,78 @@
+use ansi_term::{
+ unstyled_len, ANSIString, ANSIStrings,
+ Color::{Fixed, RGB},
+ Style,
+};
+
+use crate::LinePart;
+use zellij_tile::prelude::*;
+use zellij_tile_utils::palette_match;
+
+macro_rules! strings {
+ ($ANSIStrings:expr) => {{
+ let strings: &[ANSIString<'static>] = $ANSIStrings;
+
+ let ansi_strings = ANSIStrings(strings);
+
+ LinePart {
+ part: format!("{}", ansi_strings),
+ len: unstyled_len(&ansi_strings),
+ }
+ }};
+}
+
+pub fn edit_scrollbuffer_full(palette: Palette) -> LinePart {
+ // Tip: Search through the scrollbuffer using your default $EDITOR with
+ // Ctrl + <s> + <e>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("Search through the scrollbuffer using your default "),
+ Style::new().fg(green_color).bold().paint("$EDITOR"),
+ Style::new().paint(" with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<s>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<e>"),
+ ])
+}
+
+pub fn edit_scrollbuffer_medium(palette: Palette) -> LinePart {
+ // Tip: Search the scrollbuffer using your $EDITOR with
+ // Ctrl + <s> + <e>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("Search the scrollbuffer using your "),
+ Style::new().fg(green_color).bold().paint("$EDITOR"),
+ Style::new().paint(" with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<s>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<e>"),
+ ])
+}
+
+pub fn edit_scrollbuffer_short(palette: Palette) -> LinePart {
+ // Search using $EDITOR with
+ // Ctrl + <s> + <e>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Search using "),
+ Style::new().fg(green_color).bold().paint("$EDITOR"),
+ Style::new().paint(" with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<s>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<e>"),
+ ])
+}
diff --git a/default-plugins/status-bar/src/tip/data/floating_panes_mouse.rs b/default-plugins/status-bar/src/tip/data/floating_panes_mouse.rs
new file mode 100644
index 00000000..64594987
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/floating_panes_mouse.rs
@@ -0,0 +1,69 @@
+use ansi_term::{
+ unstyled_len, ANSIString, ANSIStrings,
+ Color::{Fixed, RGB},
+ Style,
+};
+
+use crate::LinePart;
+use zellij_tile::prelude::*;
+use zellij_tile_utils::palette_match;
+
+macro_rules! strings {
+ ($ANSIStrings:expr) => {{
+ let strings: &[ANSIString<'static>] = $ANSIStrings;
+
+ let ansi_strings = ANSIStrings(strings);
+
+ LinePart {
+ part: format!("{}", ansi_strings),
+ len: unstyled_len(&ansi_strings),
+ }
+ }};
+}
+
+pub fn floating_panes_mouse_full(palette: Palette) -> LinePart {
+ // Tip: Toggle floating panes with Ctrl + <p> + <w> and move them with keyboard or mouse
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("Toggle floating panes with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<p>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<w>"),
+ Style::new().paint(" and move them with keyboard or mouse"),
+ ])
+}
+
+pub fn floating_panes_mouse_medium(palette: Palette) -> LinePart {
+ // Tip: Toggle floating panes with Ctrl + <p> + <w>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("Toggle floating panes with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<p>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<w>"),
+ ])
+}
+
+pub fn floating_panes_mouse_short(palette: Palette) -> LinePart {
+ // Ctrl + <p> + <w> => floating panes
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().fg(orange_color).bold().paint(" Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<p>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<w>"),
+ Style::new().paint(" => floating panes"),
+ ])
+}
diff --git a/default-plugins/status-bar/src/tip/data/mod.rs b/default-plugins/status-bar/src/tip/data/mod.rs
new file mode 100644
index 00000000..1354b1ab
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/mod.rs
@@ -0,0 +1,92 @@
+use std::collections::HashMap;
+
+use lazy_static::lazy_static;
+
+use crate::tip::TipBody;
+
+mod compact_layout;
+mod edit_scrollbuffer;
+mod floating_panes_mouse;
+mod move_focus_hjkl_tab_switch;
+mod quicknav;
+mod send_mouse_click_to_terminal;
+mod sync_tab;
+mod use_mouse;
+mod zellij_setup_check;
+
+lazy_static! {
+ pub static ref TIPS: HashMap<&'static str, TipBody> = HashMap::from([
+ (
+ "quicknav",
+ TipBody {
+ short: quicknav::quicknav_short,
+ medium: quicknav::quicknav_medium,
+ full: quicknav::quicknav_full,
+ }
+ ),
+ (
+ "floating_panes_mouse",
+ TipBody {
+ short: floating_panes_mouse::floating_panes_mouse_short,
+ medium: floating_panes_mouse::floating_panes_mouse_medium,
+ full: floating_panes_mouse::floating_panes_mouse_full,
+ }
+ ),
+ (
+ "send_mouse_clicks_to_terminal",
+ TipBody {
+ short: send_mouse_click_to_terminal::mouse_click_to_terminal_short,
+ medium: send_mouse_click_to_terminal::mouse_click_to_terminal_medium,
+ full: send_mouse_click_to_terminal::mouse_click_to_terminal_full,
+ }
+ ),
+ (
+ "move_focus_hjkl_tab_switch",
+ TipBody {
+ short: move_focus_hjkl_tab_switch::move_focus_hjkl_tab_switch_short,
+ medium: move_focus_hjkl_tab_switch::move_focus_hjkl_tab_switch_medium,
+ full: move_focus_hjkl_tab_switch::move_focus_hjkl_tab_switch_full,
+ }
+ ),
+ (
+ "zellij_setup_check",
+ TipBody {
+ short: zellij_setup_check::zellij_setup_check_short,
+ medium: zellij_setup_check::zellij_setup_check_medium,
+ full: zellij_setup_check::zellij_setup_check_full,
+ }
+ ),
+ (
+ "use_mouse",
+ TipBody {
+ short: use_mouse::use_mouse_short,
+ medium: use_mouse::use_mouse_medium,
+ full: use_mouse::use_mouse_full,
+ }
+ ),
+ (
+ "sync_tab",
+ TipBody {
+ short: sync_tab::sync_tab_short,
+ medium: sync_tab::sync_tab_medium,
+ full: sync_tab::sync_tab_full,
+ }
+ ),
+ (
+ "edit_scrollbuffer",
+ TipBody {
+ short: edit_scrollbuffer::edit_scrollbuffer_short,
+ medium: edit_scrollbuffer::edit_scrollbuffer_medium,
+ full: edit_scrollbuffer::edit_scrollbuffer_full,
+ }
+ ),
+ (
+ "compact_layout",
+ TipBody {
+ short: compact_layout::compact_layout_short,
+ medium: compact_layout::compact_layout_medium,
+ full: compact_layout::compact_layout_full,
+ }
+ ),
+ ]);
+}
diff --git a/default-plugins/status-bar/src/tip/data/move_focus_hjkl_tab_switch.rs b/default-plugins/status-bar/src/tip/data/move_focus_hjkl_tab_switch.rs
new file mode 100644
index 00000000..8e9f678c
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/move_focus_hjkl_tab_switch.rs
@@ -0,0 +1,64 @@
+use ansi_term::{
+ unstyled_len, ANSIString, ANSIStrings,
+ Color::{Fixed, RGB},
+ Style,
+};
+
+use crate::LinePart;
+use zellij_tile::prelude::*;
+use zellij_tile_utils::palette_match;
+
+macro_rules! strings {
+ ($ANSIStrings:expr) => {{
+ let strings: &[ANSIString<'static>] = $ANSIStrings;
+
+ let ansi_strings = ANSIStrings(strings);
+
+ LinePart {
+ part: format!("{}", ansi_strings),
+ len: unstyled_len(&ansi_strings),
+ }
+ }};
+}
+
+pub fn move_focus_hjkl_tab_switch_full(palette: Palette) -> LinePart {
+ // Tip: When changing focus with Alt + <←↓↑→> moving off screen left/right focuses the next tab.
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("When changing focus with "),
+ Style::new().fg(orange_color).bold().paint("Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<←↓↑→>"),
+ Style::new().paint(" moving off screen left/right focuses the next tab."),
+ ])
+}
+
+pub fn move_focus_hjkl_tab_switch_medium(palette: Palette) -> LinePart {
+ // Tip: Changing focus with Alt + <←↓↑→> off screen focuses the next tab.
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("Changing focus with "),
+ Style::new().fg(orange_color).bold().paint("Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<←↓↑→>"),
+ Style::new().paint(" off screen focuses the next tab."),
+ ])
+}
+
+pub fn move_focus_hjkl_tab_switch_short(palette: Palette) -> LinePart {
+ // Alt + <←↓↑→> off screen edge focuses next tab.
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().fg(orange_color).bold().paint(" Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<←↓↑→>"),
+ Style::new().paint(" off screen edge focuses next tab."),
+ ])
+}
diff --git a/default-plugins/status-bar/src/tip/data/quicknav.rs b/default-plugins/status-bar/src/tip/data/quicknav.rs
new file mode 100644
index 00000000..21d46fe8
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/quicknav.rs
@@ -0,0 +1,86 @@
+use ansi_term::{
+ unstyled_len, ANSIString, ANSIStrings,
+ Color::{Fixed, RGB},
+ Style,
+};
+
+use crate::LinePart;
+use zellij_tile::prelude::*;
+use zellij_tile_utils::palette_match;
+
+macro_rules! strings {
+ ($ANSIStrings:expr) => {{
+ let strings: &[ANSIString<'static>] = $ANSIStrings;
+
+ let ansi_strings = ANSIStrings(strings);
+
+ LinePart {
+ part: format!("{}", ansi_strings),
+ len: unstyled_len(&ansi_strings),
+ }
+ }};
+}
+
+pub fn quicknav_full(palette: Palette) -> LinePart {
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().fg(orange_color).bold().paint("Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<n>"),
+ Style::new().paint(" => open new pane. "),
+ Style::new().fg(orange_color).bold().paint("Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<←↓↑→"),
+ Style::new().paint(" or "),
+ Style::new().fg(green_color).bold().paint("hjkl>"),
+ Style::new().paint(" => navigate between panes. "),
+ Style::new().fg(orange_color).bold().paint("Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<+->"),
+ Style::new().paint(" => increase/decrease pane size."),
+ ])
+}
+
+pub fn quicknav_medium(palette: Palette) -> LinePart {
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().fg(orange_color).bold().paint("Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<n>"),
+ Style::new().paint(" => new pane. "),
+ Style::new().fg(orange_color).bold().paint("Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<←↓↑→"),
+ Style::new().paint(" or "),
+ Style::new().fg(green_color).bold().paint("hjkl>"),
+ Style::new().paint(" => navigate. "),
+ Style::new().fg(orange_color).bold().paint("Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<+->"),
+ Style::new().paint(" => resize pane."),
+ ])
+}
+
+pub fn quicknav_short(palette: Palette) -> LinePart {
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" QuickNav: "),
+ Style::new().fg(orange_color).bold().paint("Alt"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("n"),
+ Style::new().paint("/"),
+ Style::new().fg(green_color).bold().paint("<←↓↑→"),
+ Style::new().paint("/"),
+ Style::new().fg(green_color).bold().paint("hjkl"),
+ Style::new().paint("/"),
+ Style::new().fg(green_color).bold().paint("+->"),
+ ])
+}
diff --git a/default-plugins/status-bar/src/tip/data/send_mouse_click_to_terminal.rs b/default-plugins/status-bar/src/tip/data/send_mouse_click_to_terminal.rs
new file mode 100644
index 00000000..a4f7ee60
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/send_mouse_click_to_terminal.rs
@@ -0,0 +1,63 @@
+use ansi_term::{
+ unstyled_len, ANSIString, ANSIStrings,
+ Color::{Fixed, RGB},
+ Style,
+};
+
+use crate::LinePart;
+use zellij_tile::prelude::*;
+use zellij_tile_utils::palette_match;
+
+macro_rules! strings {
+ ($ANSIStrings:expr) => {{
+ let strings: &[ANSIString<'static>] = $ANSIStrings;
+
+ let ansi_strings = ANSIStrings(strings);
+
+ LinePart {
+ part: format!("{}", ansi_strings),
+ len: unstyled_len(&ansi_strings),
+ }
+ }};
+}
+
+pub fn mouse_click_to_terminal_full(palette: Palette) -> LinePart {
+ // Tip: SHIFT + <mouse-click> bypasses Zellij and sends the mouse click directly to the terminal
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().fg(orange_color).bold().paint("SHIFT"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<mouse-click>"),
+ Style::new().paint(" bypasses Zellij and sends the mouse click directly to the terminal."),
+ ])
+}
+
+pub fn mouse_click_to_terminal_medium(palette: Palette) -> LinePart {
+ // Tip: SHIFT + <mouse-click> sends the click directly to the terminal
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().fg(orange_color).bold().paint("SHIFT"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<mouse-click>"),
+ Style::new().paint(" sends the click directly to the terminal."),
+ ])
+}
+
+pub fn mouse_click_to_terminal_short(palette: Palette) -> LinePart {
+ // Tip: SHIFT + <mouse-click> => sends click to terminal.
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().fg(orange_color).bold().paint("SHIFT"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<mouse-click>"),
+ Style::new().paint(" => sends click to terminal."),
+ ])
+}
diff --git a/default-plugins/status-bar/src/tip/data/sync_tab.rs b/default-plugins/status-bar/src/tip/data/sync_tab.rs
new file mode 100644
index 00000000..27d0ae7f
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/sync_tab.rs
@@ -0,0 +1,69 @@
+use ansi_term::{
+ unstyled_len, ANSIString, ANSIStrings,
+ Color::{Fixed, RGB},
+ Style,
+};
+
+use crate::LinePart;
+use zellij_tile::prelude::*;
+use zellij_tile_utils::palette_match;
+
+macro_rules! strings {
+ ($ANSIStrings:expr) => {{
+ let strings: &[ANSIString<'static>] = $ANSIStrings;
+
+ let ansi_strings = ANSIStrings(strings);
+
+ LinePart {
+ part: format!("{}", ansi_strings),
+ len: unstyled_len(&ansi_strings),
+ }
+ }};
+}
+
+pub fn sync_tab_full(palette: Palette) -> LinePart {
+ // Tip: Sync a tab and write keyboard input to all panes with Ctrl + <t> + <s>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("Sync a tab and write keyboard input to all its panes with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<t>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<s>"),
+ ])
+}
+
+pub fn sync_tab_medium(palette: Palette) -> LinePart {
+ // Tip: Sync input to panes in a tab with Ctrl + <t> + <s>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("Sync input to panes in a tab with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<t>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<s>"),
+ ])
+}
+
+pub fn sync_tab_short(palette: Palette) -> LinePart {
+ // Sync input in a tab with Ctrl + <t> + <s>
+ let green_color = palette_match!(palette.green);
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Sync input in a tab with "),
+ Style::new().fg(orange_color).bold().paint("Ctrl"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<t>"),
+ Style::new().paint(" + "),
+ Style::new().fg(green_color).bold().paint("<s>"),
+ ])
+}
diff --git a/default-plugins/status-bar/src/tip/data/use_mouse.rs b/default-plugins/status-bar/src/tip/data/use_mouse.rs
new file mode 100644
index 00000000..b9c8de58
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/use_mouse.rs
@@ -0,0 +1,56 @@
+use ansi_term::{
+ unstyled_len, ANSIString, ANSIStrings,
+ Color::{Fixed, RGB},
+ Style,
+};
+
+use crate::LinePart;
+use zellij_tile::prelude::*;
+use zellij_tile_utils::palette_match;
+
+macro_rules! strings {
+ ($ANSIStrings:expr) => {{
+ let strings: &[ANSIString<'static>] = $ANSIStrings;
+
+ let ansi_strings = ANSIStrings(strings);
+
+ LinePart {
+ part: format!("{}", ansi_strings),
+ len: unstyled_len(&ansi_strings),
+ }
+ }};
+}
+
+pub fn use_mouse_full(palette: Palette) -> LinePart {
+ // Tip: Use the mouse to switch pane focus, scroll through the pane
+ // scrollbuffer, switch or scroll through tabs
+ let green_color = palette_match!(palette.green);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().fg(green_color).bold().paint("Use the mouse"),
+ Style::new().paint(" to switch pane focus, scroll through the pane scrollbuffer, switch or scroll through the tabs."),
+ ])
+}
+
+pub fn use_mouse_medium(palette: Palette) -> LinePart {
+ // Tip: Use the mouse to switch panes/tabs or scroll through the pane
+ // scrollbuffer
+ let green_color = palette_match!(palette.green);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().fg(green_color).bold().paint("Use the mouse"),
+ Style::new().paint(" to switch pane/tabs or scroll through the pane scrollbuffer."),
+ ])
+}
+
+pub fn use_mouse_short(palette: Palette) -> LinePart {
+ // Tip: Use the mouse to switch panes/tabs or scroll
+ let green_color = palette_match!(palette.green);
+
+ strings!(&[
+ Style::new().fg(green_color).bold().paint(" Use the mouse"),
+ Style::new().paint(" to switch pane/tabs or scroll."),
+ ])
+}
diff --git a/default-plugins/status-bar/src/tip/data/zellij_setup_check.rs b/default-plugins/status-bar/src/tip/data/zellij_setup_check.rs
new file mode 100644
index 00000000..c45deac2
--- /dev/null
+++ b/default-plugins/status-bar/src/tip/data/zellij_setup_check.rs
@@ -0,0 +1,65 @@
+use ansi_term::{
+ unstyled_len, ANSIString, ANSIStrings,
+ Color::{Fixed, RGB},
+ Style,
+};
+
+use crate::LinePart;
+use zellij_tile::prelude::*;
+use zellij_tile_utils::palette_match;
+
+macro_rules! strings {
+ ($ANSIStrings:expr) => {{
+ let strings: &[ANSIString<'static>] = $ANSIStrings;
+
+ let ansi_strings = ANSIStrings(strings);
+
+ LinePart {
+ part: format!("{}", ansi_strings),
+ len: unstyled_len(&ansi_strings),
+ }
+ }};
+}
+
+pub fn zellij_setup_check_full(palette: Palette) -> LinePart {
+ // Tip: Having issues with Zellij? Try running "zellij setup --check"
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("Having issues with Zellij? Try running "),
+ Style::new()
+ .fg(orange_color)
+ .bold()
+ .paint("zellij setup --check"),
+ ])
+}
+
+pub fn zellij_setup_check_medium(palette: Palette) -> LinePart {
+ // Tip: Run "zellij setup --check" to find issues
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Tip: "),
+ Style::new().paint("Run "),
+ Style::new()
+ .fg(orange_color)
+ .bold()
+ .paint("zellij setup --check"),
+ Style::new().paint(" to find issues"),
+ ])
+}
+
+pub fn zellij_setup_check_short(palette: Palette) -> LinePart {
+ // Run "zellij setup --check" to find issues
+ let orange_color = palette_match!(palette.orange);
+
+ strings!(&[
+ Style::new().paint(" Run "),
+ Style::new()
+ .fg(orange_color)
+ .bold()
+ .paint("zellij setup --check"),
+ Style::new().paint(" to find issues"),
+ ])
+}