From 5b0433d599b2a83213eba42345260c99a96f88e6 Mon Sep 17 00:00:00 2001 From: VeejeyPL Date: Tue, 6 Jun 2023 12:33:05 +0200 Subject: [PATCH] Update with icon customization --- README.md | 27 ++++++++++++++++++++++----- catppuccin.tmux | 27 ++++++++++++++++++++++++++- src/default.conf | 12 ++++++------ src/pill-status-line.conf | 12 ++++++------ src/powerline-icons-status-line.conf | 12 ++++++------ 5 files changed, 66 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 7892edb..b50433a 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ 3. [Enable date and time](#enable-datetime) 4. [Enable user](#enable-user) 5. [Enable host](#enable-host) + 6. [Customize icons](#customize-icons) ## Themes @@ -41,7 +42,7 @@ ## Installation -In order to have the icons displayed correctly please use / update your favorite patched font. +In order to have the icons displayed correctly please use / update your favorite patched font or overwrite the defaults - refer to [Customize icons](#customize-icons) section. If you do not have patched font installed, you can use the [No patched fonts](#no-patched-fonts) status line theme. ### TPM @@ -147,8 +148,8 @@ set -g @catppuccin_r_left_separator "█" ### Enable DateTime -By default, the `date_time` componenet is set to off. -It can be enabled by specifing any tmux date and time format. +By default, the `date_time` component is set to off. +It can be enabled by specifying any tmux date and time format. ```sh set -g @catppuccin_date_time "%Y-%m-%d %H:%M" @@ -156,7 +157,7 @@ set -g @catppuccin_date_time "%Y-%m-%d %H:%M" ### Enable User -By default, the `user` componenet is set to off. +By default, the `user` component is set to off. It can be enabled by toggling it on. ```sh @@ -165,13 +166,29 @@ set -g @catppuccin_user "on" ### Enable Host -By default, the `host` componenet is set to off. +By default, the `host` component is set to off. It can be enabled by toggling it on. ```sh set -g @catppuccin_host "on" ``` +### Customize Icons + +Each of the components comes with their own default icon, which +can be changed to fit your preference or requirements of your font. + +*Note: NerdFont Icons do not render properly in the Github UI, so the below example +does not use them* +```sh +set -g @catppuccin_datetime_icon "A" +set -g @catppuccin_user_icon "B" +set -g @catppuccin_directory_icon "C" +set -g @catppuccin_window_icon "D" +set -g @catppuccin_session_icon "E" +set -g @catppuccin_host_icon "F" +``` + [style-guide]: https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md ## 💝 Thanks to diff --git a/catppuccin.tmux b/catppuccin.tmux index d4e484e..df29d12 100755 --- a/catppuccin.tmux +++ b/catppuccin.tmux @@ -115,7 +115,32 @@ main() { local date_time date_time="$(get_tmux_option "@catppuccin_date_time" "off")" readonly date_time - + + # Icons + local directory_icon + directory_icon="$(get_tmux_option "@catppuccin_directory_icon" "")" + readonly directory_icon + + local window_icon + window_icon="$(get_tmux_option "@catppuccin_window_icon" "")" + readonly window_icon + + local session_icon + session_icon="$(get_tmux_option "@catppuccin_session_icon" "")" + readonly session_icon + + local user_icon + user_icon="$(get_tmux_option "@catppuccin_user_icon" "")" + readonly user_icon + + local host_icon + host_icon="$(get_tmux_option "@catppuccin_host_icon" "󰒋")" + readonly host_icon + + local datetime_icon + datetime_icon="$(get_tmux_option "@catppuccin_datetime_icon" "")" + readonly datetime_icon + # Source status line themes if [[ "${pill_theme_enabled}" == "off" ]] && [[ "${powerline_theme_enabled}" == "off" ]] && diff --git a/src/default.conf b/src/default.conf index d0c4d38..63eb008 100644 --- a/src/default.conf +++ b/src/default.conf @@ -1,11 +1,11 @@ local show_directory -readonly show_directory="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " +readonly show_directory="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]$directory_icon #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " local show_window -readonly show_window="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #W " +readonly show_window="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]$window_icon #[fg=$thm_fg,bg=$thm_gray] #W " local show_session -readonly show_session="#[fg=$thm_green]#[bg=$thm_gray]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S " +readonly show_session="#[fg=$thm_green]#[bg=$thm_gray]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]$session_icon #[fg=$thm_fg,bg=$thm_gray] #S " local show_directory_in_window_status readonly show_directory_in_window_status="#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " @@ -20,10 +20,10 @@ 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,nobold,nounderscore,noitalics]$l_right_separator " local show_user -readonly show_user="#[fg=$thm_cyan,bg=$thm_gray,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #(whoami) " +readonly show_user="#[fg=$thm_cyan,bg=$thm_gray,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics]$user_icon #[fg=$thm_fg,bg=$thm_gray] #(whoami) " local show_host -readonly show_host="#[fg=$thm_magenta,bg=$thm_gray,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics]󰒋 #[fg=$thm_fg,bg=$thm_gray] #H " +readonly show_host="#[fg=$thm_magenta,bg=$thm_gray,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics]$host_icon #[fg=$thm_fg,bg=$thm_gray] #H " local show_date_time -readonly show_date_time="#[fg=$thm_blue,bg=$thm_gray,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] $date_time " +readonly show_date_time="#[fg=$thm_blue,bg=$thm_gray,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics]$datetime_icon #[fg=$thm_fg,bg=$thm_gray] $date_time " diff --git a/src/pill-status-line.conf b/src/pill-status-line.conf index 848f8ab..d2b84a4 100644 --- a/src/pill-status-line.conf +++ b/src/pill-status-line.conf @@ -1,11 +1,11 @@ local show_directory -readonly show_directory="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " +readonly show_directory="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]$directory_icon #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " local show_window -readonly show_window="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #W #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " +readonly show_window="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]$window_icon #[fg=$thm_fg,bg=$thm_gray] #W #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " local show_session -readonly show_session="#[fg=$thm_green,bg=$thm_bg,nobold,nounderscore,noitalics]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#[fg=$thm_bg,bg=$thm_green]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]} #[fg=$thm_fg,bg=$thm_gray] #S #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " +readonly show_session="#[fg=$thm_green,bg=$thm_bg,nobold,nounderscore,noitalics]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#[fg=$thm_bg,bg=$thm_green]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}$session_icon #[fg=$thm_fg,bg=$thm_gray] #S #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " local show_directory_in_window_status readonly show_directory_in_window_status="#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " @@ -20,10 +20,10 @@ local show_window_in_window_status_current readonly show_window_in_window_status_current="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$l_left_separator#[fg=$thm_fg,bg=$thm_gray]#W #[fg=$thm_bg,bg=$thm_orange] #I#[fg=$thm_orange,bg=$thm_bg,nobold,nounderscore,noitalics]$l_right_separator " local show_user -readonly show_user="#[fg=$thm_cyan,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #(whoami) #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " +readonly show_user="#[fg=$thm_cyan,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics]$user_icon #[fg=$thm_fg,bg=$thm_gray] #(whoami) #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " local show_host -readonly show_host="#[fg=$thm_magenta,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics]󰒋 #[fg=$thm_fg,bg=$thm_gray] #H #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " +readonly show_host="#[fg=$thm_magenta,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics]$host_icon #[fg=$thm_fg,bg=$thm_gray] #H #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " local show_date_time -readonly show_date_time="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] $date_time #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " +readonly show_date_time="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics]$datetime_icon #[fg=$thm_fg,bg=$thm_gray] $date_time #[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$r_right_separator " diff --git a/src/powerline-icons-status-line.conf b/src/powerline-icons-status-line.conf index 5c3d845..120fa75 100644 --- a/src/powerline-icons-status-line.conf +++ b/src/powerline-icons-status-line.conf @@ -1,11 +1,11 @@ local show_directory -readonly show_directory="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]  #{b:pane_current_path} $r_right_separator" +readonly show_directory="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] $directory_icon#{b:pane_current_path} $r_right_separator" local show_window -readonly show_window="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]  #W $r_right_separator" +readonly show_window="#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] $window_icon #W $r_right_separator" local show_session -readonly show_session="#[fg=$thm_green,bg=$thm_bg,nobold,nounderscore,noitalics]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]  #S #{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]$r_right_separator" +readonly show_session="#[fg=$thm_green,bg=$thm_bg,nobold,nounderscore,noitalics]#{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}$r_left_separator#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] $session_icon #S #{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]$r_right_separator" local show_directory_in_window_status readonly show_directory_in_window_status="#[fg=$thm_bg,bg=$thm_gray,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_fg,bg=$thm_gray,nobold,noitalics,nounderscore]#I  #{b:pane_current_path} #[fg=$thm_gray,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" @@ -20,11 +20,11 @@ local show_window_in_window_status_current readonly show_window_in_window_status_current="#[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]$l_left_separator #[fg=$thm_bg,bg=$thm_blue,nobold,noitalics,nounderscore]#W  #I #[fg=$thm_blue,bg=$thm_bg,nobold,noitalics,nounderscore]$l_right_separator" local show_user -readonly show_user="#[fg=$thm_cyan,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics]  #(whoami) $r_right_separator" +readonly show_user="#[fg=$thm_cyan,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_cyan,nobold,nounderscore,noitalics] $user_icon #(whoami) $r_right_separator" local show_host -readonly show_host="#[fg=$thm_magenta,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics] 󰒋 #H $r_right_separator" +readonly show_host="#[fg=$thm_magenta,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics] $host_icon #H $r_right_separator" local show_date_time -readonly show_date_time="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics]  $date_time $r_right_separator" +readonly show_date_time="#[fg=$thm_blue,bg=$thm_bg,nobold,nounderscore,noitalics]$r_left_separator#[fg=$thm_bg,bg=$thm_blue,nobold,nounderscore,noitalics] $datetime_icon $date_time $r_right_separator"