From 650d3e698842555f709af94db34e27d0889a32cf Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Wed, 19 Aug 2020 10:35:04 -0700 Subject: [PATCH] Add rust item, fix os item and configs --- README.md | 4 +++- functions/_tide_item_os.fish | 1 + functions/_tide_item_rust.fish | 14 ++++++++++++++ tide_theme/configure/configs/classic.fish | 11 ++++++++--- tide_theme/configure/configs/lean.fish | 7 ++++++- tide_theme/configure/configs/pure.fish | 7 ++++++- tide_theme/configure/configs/rainbow.fish | 11 ++++++++--- .../configure/prompt_items/_fake_tide_item_os.fish | 2 ++ .../prompt_items/_fake_tide_item_rust.fish | 2 ++ 9 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 functions/_tide_item_rust.fish create mode 100644 tide_theme/configure/prompt_items/_fake_tide_item_os.fish create mode 100644 tide_theme/configure/prompt_items/_fake_tide_item_rust.fish diff --git a/README.md b/README.md index 24f3004..69cf55f 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,8 @@ Open each file and click "Install". This will make the `MesloLGS NF` font availa ## Acknowledgments - [Powerlevel10k][] - Inspired much of Tide's documentation, resources, ideas, and design. -- [Starship][] - Inspired elements of the documentation and community health files. +- [Starship][] - Inspired elements of Tide's documentation and community health files. +- [Spacefish][] - Inspired some of Tide's items. [actions]: https://github.com/IlanCosman/tide/actions [ci_badge]: https://github.com/IlanCosman/tide/workflows/CI/badge.svg @@ -159,5 +160,6 @@ Open each file and click "Install". This will make the `MesloLGS NF` font availa [powerlevel10k]: https://github.com/romkatv/powerlevel10k/ [items]: https://github.com/IlanCosman/tide/wiki/Items [pure]: https://github.com/rafaelrinaldi/pure +[spacefish]: https://github.com/matchai/spacefish [starship]: https://github.com/starship/starship [wiki]: https://github.com/IlanCosman/tide/wiki diff --git a/functions/_tide_item_os.fish b/functions/_tide_item_os.fish index a46bced..5453632 100644 --- a/functions/_tide_item_os.fish +++ b/functions/_tide_item_os.fish @@ -1,3 +1,4 @@ function _tide_item_os + set_color $tide_os_color printf '%s' $_tide_os_icon end \ No newline at end of file diff --git a/functions/_tide_item_rust.fish b/functions/_tide_item_rust.fish new file mode 100644 index 0000000..7a9a09a --- /dev/null +++ b/functions/_tide_item_rust.fish @@ -0,0 +1,14 @@ +function _tide_item_rust + if not type --quiet rustc || not test -e Cargo.toml || test (count *.rs) -gt 0 + return + end + + set -l rustVersion (rustc --version | string split ' ')[2] + + if test "$tide_rust_verbose_version" = false + set rustVersion (string split '-' $rustVersion)[1] # Cut off -suffixes from version. "v1.30.0-beta" vs "v1.30.0" + end + + set_color $tide_rust_color + printf '%s' {$tide_rust_icon}' ' $rustVersion +end \ No newline at end of file diff --git a/tide_theme/configure/configs/classic.fish b/tide_theme/configure/configs/classic.fish index 6dff0d1..9750b17 100644 --- a/tide_theme/configure/configs/classic.fish +++ b/tide_theme/configure/configs/classic.fish @@ -104,6 +104,11 @@ _set fake_tide_time_color 5F8787 _set fake_tide_time_format '%T' _set fake_tide_time_bg_color 444444 # ---------------OS--------------- -_set fake_tide_os_color normal -_set fake_tide_os_bg_color normal -_set fake_tide_os_use_nearest true \ No newline at end of file +_set fake_tide_os_color EEEEEE +_set fake_tide_os_bg_color 444444 +_set fake_tide_os_use_nearest true +# ---------------Rust--------------- +_set fake_tide_rust_color 00AFAF +_set fake_tide_rust_bg_color 444444 +_set fake_tide_rust_icon '' +_set fake_tide_rust_verbose_version false \ No newline at end of file diff --git a/tide_theme/configure/configs/lean.fish b/tide_theme/configure/configs/lean.fish index 091b7bd..65f18b7 100644 --- a/tide_theme/configure/configs/lean.fish +++ b/tide_theme/configure/configs/lean.fish @@ -106,4 +106,9 @@ _set fake_tide_time_bg_color normal # ---------------OS--------------- _set fake_tide_os_color normal _set fake_tide_os_bg_color normal -_set fake_tide_os_use_nearest true \ No newline at end of file +_set fake_tide_os_use_nearest true +# ---------------Rust--------------- +_set fake_tide_rust_color 00AFAF +_set fake_tide_rust_bg_color normal +_set fake_tide_rust_icon '' +_set fake_tide_rust_verbose_version false \ No newline at end of file diff --git a/tide_theme/configure/configs/pure.fish b/tide_theme/configure/configs/pure.fish index 235062b..db2aecb 100644 --- a/tide_theme/configure/configs/pure.fish +++ b/tide_theme/configure/configs/pure.fish @@ -105,4 +105,9 @@ _set fake_tide_time_bg_color normal # ---------------OS--------------- _set fake_tide_os_color normal _set fake_tide_os_bg_color normal -_set fake_tide_os_use_nearest true \ No newline at end of file +_set fake_tide_os_use_nearest true +# ---------------Rust--------------- +_set fake_tide_rust_color 00AFAF +_set fake_tide_rust_bg_color normal +_set fake_tide_rust_icon '' +_set fake_tide_rust_verbose_version false \ No newline at end of file diff --git a/tide_theme/configure/configs/rainbow.fish b/tide_theme/configure/configs/rainbow.fish index aa7a863..5b0c9de 100644 --- a/tide_theme/configure/configs/rainbow.fish +++ b/tide_theme/configure/configs/rainbow.fish @@ -104,6 +104,11 @@ _set fake_tide_time_color 000000 _set fake_tide_time_format '%T' _set fake_tide_time_bg_color D3D7CF # ---------------OS--------------- -_set fake_tide_os_color normal -_set fake_tide_os_bg_color normal -_set fake_tide_os_use_nearest true \ No newline at end of file +_set fake_tide_os_color 080808 +_set fake_tide_os_bg_color CED7CF +_set fake_tide_os_use_nearest true +# ---------------Rust--------------- +_set fake_tide_rust_color 2E3436 +_set fake_tide_rust_bg_color FF8700 +_set fake_tide_rust_icon '' +_set fake_tide_rust_verbose_version false \ No newline at end of file diff --git a/tide_theme/configure/prompt_items/_fake_tide_item_os.fish b/tide_theme/configure/prompt_items/_fake_tide_item_os.fish new file mode 100644 index 0000000..77034ca --- /dev/null +++ b/tide_theme/configure/prompt_items/_fake_tide_item_os.fish @@ -0,0 +1,2 @@ +function _fake_tide_item_os +end \ No newline at end of file diff --git a/tide_theme/configure/prompt_items/_fake_tide_item_rust.fish b/tide_theme/configure/prompt_items/_fake_tide_item_rust.fish new file mode 100644 index 0000000..36021b4 --- /dev/null +++ b/tide_theme/configure/prompt_items/_fake_tide_item_rust.fish @@ -0,0 +1,2 @@ +function _fake_tide_item_rust +end \ No newline at end of file