feat(components): add user and host components
This commit is contained in:
parent
fce7853d4c
commit
def29854b5
2 changed files with 41 additions and 1 deletions
20
README.md
20
README.md
|
@ -75,13 +75,31 @@ set -g @catppuccin_right_separator "█"
|
||||||
|
|
||||||
##### Enable DateTime
|
##### Enable DateTime
|
||||||
|
|
||||||
By default, the `date_time` componenet is set to off.
|
By default, the `date_time` componenet is set to off.
|
||||||
It can be enabled by specifing the tmux date and time format.
|
It can be enabled by specifing the tmux date and time format.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
set -g @catppuccin_date_time "%Y-%m-%d %H:%M"
|
set -g @catppuccin_date_time "%Y-%m-%d %H:%M"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### Enable User
|
||||||
|
|
||||||
|
By default, the `user` componenet is set to off.
|
||||||
|
It can be enabled by toggoling it on.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
set -g @catppuccin_user "on"
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Enable Host
|
||||||
|
|
||||||
|
By default, the `host` componenet is set to off.
|
||||||
|
It can be enabled by toggoling it on.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
set -g @catppuccin_host "on"
|
||||||
|
```
|
||||||
|
|
||||||
[style-guide]: https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md
|
[style-guide]: https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md
|
||||||
|
|
||||||
## 💝 Thanks to
|
## 💝 Thanks to
|
||||||
|
|
|
@ -73,6 +73,14 @@ main() {
|
||||||
left_separator="$(get_tmux_option "@catppuccin_left_separator" "")"
|
left_separator="$(get_tmux_option "@catppuccin_left_separator" "")"
|
||||||
readonly left_separator
|
readonly left_separator
|
||||||
|
|
||||||
|
local user
|
||||||
|
user="$(get_tmux_option "@catppuccin_user" "off")"
|
||||||
|
readonly user
|
||||||
|
|
||||||
|
local host
|
||||||
|
host="$(get_tmux_option "@catppuccin_host" "off")"
|
||||||
|
readonly host
|
||||||
|
|
||||||
local date_time
|
local date_time
|
||||||
date_time="$(get_tmux_option "@catppuccin_date_time" "off")"
|
date_time="$(get_tmux_option "@catppuccin_date_time" "off")"
|
||||||
readonly date_time
|
readonly date_time
|
||||||
|
@ -99,6 +107,12 @@ main() {
|
||||||
local show_window_in_window_status_current
|
local show_window_in_window_status_current
|
||||||
readonly show_window_in_window_status_current="#[fg=$thm_fg,bg=$thm_gray] #W #[fg=$thm_bg,bg=$thm_orange] #I#[fg=$thm_orange,bg=$thm_bg]$left_separator#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics] "
|
readonly show_window_in_window_status_current="#[fg=$thm_fg,bg=$thm_gray] #W #[fg=$thm_bg,bg=$thm_orange] #I#[fg=$thm_orange,bg=$thm_bg]$left_separator#[fg=$thm_fg,bg=$thm_bg,nobold,nounderscore,noitalics] "
|
||||||
|
|
||||||
|
local show_user
|
||||||
|
readonly show_user="#[fg=$thm_blue,bg=$thm_gray]$right_separator#[fg=$thm_bg,bg=$thm_blue] #[fg=$thm_fg,bg=$thm_gray] #(whoami) "
|
||||||
|
|
||||||
|
local show_host
|
||||||
|
readonly show_host="#[fg=$thm_blue,bg=$thm_gray]$right_separator#[fg=$thm_bg,bg=$thm_blue] #[fg=$thm_fg,bg=$thm_gray] #H "
|
||||||
|
|
||||||
local show_date_time
|
local show_date_time
|
||||||
readonly show_date_time="#[fg=$thm_blue,bg=$thm_gray]$right_separator#[fg=$thm_bg,bg=$thm_blue] #[fg=$thm_fg,bg=$thm_gray] $date_time "
|
readonly show_date_time="#[fg=$thm_blue,bg=$thm_gray]$right_separator#[fg=$thm_bg,bg=$thm_blue] #[fg=$thm_fg,bg=$thm_gray] $date_time "
|
||||||
|
|
||||||
|
@ -120,6 +134,14 @@ main() {
|
||||||
window_status_current_format=$show_window_in_window_status_current
|
window_status_current_format=$show_window_in_window_status_current
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${user}" == "on" ]]; then
|
||||||
|
right_column2=$right_column2$show_user
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${host}" == "on" ]]; then
|
||||||
|
right_column2=$right_column2$show_host
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${date_time}" != "off" ]]; then
|
if [[ "${date_time}" != "off" ]]; then
|
||||||
right_column2=$right_column2$show_date_time
|
right_column2=$right_column2$show_date_time
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue