Skip to content

Commit

Permalink
feat(status/window): icons (#320)
Browse files Browse the repository at this point in the history
* feat(status/window): icons

* chore: update icon order comments
  • Loading branch information
vdbe authored Sep 27, 2024
1 parent 948f5cc commit df8411c
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 27 deletions.
10 changes: 10 additions & 0 deletions catppuccin_options_tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ set -ogq @catppuccin_window_current_color "#{@thm_surface_1}"
set -ogq @catppuccin_window_current_background "#{@thm_peach}"
set -ogq @catppuccin_window_current_text " ##T"
set -ogq @catppuccin_window_number_position "left"
set -ogq @catppuccin_window_status "icon"
set -ogq @catppuccin_window_flags_icon_last " 󰖰" # -
set -ogq @catppuccin_window_flags_icon_current " 󰖯" # *
set -ogq @catppuccin_window_flags_icon_zoom " 󰁌" # Z
set -ogq @catppuccin_window_flags_icon_mark " 󰃀" # M
set -ogq @catppuccin_window_flags_icon_silent " 󰂛" # ~
set -ogq @catppuccin_window_flags_icon_activity " 󱅫" # #
set -ogq @catppuccin_window_flags_icon_bell " 󰂞" # !
# Matches icon order when using `#F` (`#!~[*-]MZ`)
set -ogq @catppuccin_window_flags_icon_format "##{?window_activity_flag,#{E:@catppuccin_window_flags_icon_activity},}##{?window_bell_flag,#{E:@catppuccin_window_flags_icon_bell},}##{?window_silence_flag,#{E:@catppuccin_window_flags_icon_silent},}##{?window_active,#{E:@catppuccin_window_flags_icon_current},}##{?window_last_flag,#{E:@catppuccin_window_flags_icon_last},}##{?window_marked_flag,#{E:@catppuccin_window_flags_icon_mark},}##{?window_zoomed_flag,#{E:@catppuccin_window_flags_icon_zoom},}"

# Status line options
set -ogq @catppuccin_status_left_separator ""
Expand Down
40 changes: 29 additions & 11 deletions catppuccin_tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ source -F "#{d:current_file}/status/clima.conf"
source -F "#{d:current_file}/status/cpu.conf"
source -F "#{d:current_file}/status/date_time.conf"
source -F "#{d:current_file}/status/directory.conf"
source -F "#{d:current_file}/status/gitmux.conf"
source -F "#{d:current_file}/status/host.conf"
source -F "#{d:current_file}/status/kube.conf"
source -F "#{d:current_file}/status/load.conf"
source -F "#{d:current_file}/status/pomodoro_plus.conf"
source -F "#{d:current_file}/status/session.conf"
source -F "#{d:current_file}/status/uptime.conf"
source -F "#{d:current_file}/status/user.conf"
source -F "#{d:current_file}/status/weather.conf"

set status-left-length "100"
set status-right-length "100"
Expand Down Expand Up @@ -55,21 +60,21 @@ set -wF pane-border-style "#{E:@catppuccin_pane_border_style}"
"#[fg=#{@thm_fg},bg=#{@thm_surface_0}]#{@catppuccin_pane_middle_separator}"
set -g @_ctp_p_right \
"#[fg=#{@thm_surface_0},bg=default]#{@catppuccin_pane_middle_separator}"

set -g @_ctp_p_number \
"#[fg=#{@thm_fg},bg=#{@thm_surface_0}]#{pane_index}"
set -g @_ctp_p_text \
"#[fg=#{@thm_fg},bg=#{@thm_surface_0}]#{E:@catppuccin_pane_default_text}"

%elif "#{==:#{@catppuccin_pane_default_fill},all}"

set -g @_ctp_p_left \
"#[fg=#{E:@catppuccin_pane_color},bg=default]#{@catppuccin_pane_left_separator}"
set -g @_ctp_p_middle \
"#[fg=#{E:@catppuccin_pane_background_color},bg=#{E:@catppuccin_pane_color}]#{@catppuccin_pane_middle_separator}"
set -g @_ctp_p_right \
"#[fg=#{E:@catppuccin_pane_color},bg=default]#{@catppuccin_pane_middle_separator}"

set -g @_ctp_p_number \
"#[fg=#{E:@catppuccin_pane_background_color},bg=#{E:@catppuccin_pane_color}]#{pane_index}"
set -g @_ctp_p_text \
Expand All @@ -91,14 +96,15 @@ set -wF pane-border-style "#{E:@catppuccin_pane_border_style}"

set -g @_ctp_p_middle \
"#[fg=#{E:@catppuccin_pane_color},bg=#{E:@catppuccin_pane_background_color}]#{@catppuccin_pane_middle_separator}"

set -g @_ctp_p_number \
"#[fg=#{E:@catppuccin_pane_background_color},bg=#{E:@catppuccin_pane_color}]#{pane_index}"
set -g @_ctp_p_text \
"#[fg=#{E:@catppuccin_pane_color},bg=#{E:@catppuccin_pane_background_color}]#{E:@catppuccin_pane_default_text}"

%endif

set -agq @_ctp_p_text "@{_ctp_p_flags}"
%if "#{==:#{@catppuccin_pane_number_position},left}"
set -wF pane-border-format \
"#{E:@_ctp_p_left}#{E:@_ctp_p_number}#{E:@_ctp_p_middle}#{E:@_ctp_p_text}#{E:@_ctp_p_right}"
Expand Down Expand Up @@ -159,6 +165,15 @@ set -ogqF @catppuccin_window_current_right_separator "#{@catppuccin_window_right
set -gq @_ctp_w_number ""
set -gq @_ctp_w_text ""

%if "#{==:#{@catppuccin_window_status},icon}"
set -gqF @_ctp_w_flags "#{E:@catppuccin_window_flags_icon_format}"
%elif "#{==:#{@catppuccin_window_status},text}"
set -gq @_ctp_w_flags "#F"
%else
set -gq @_ctp_w_flags ""
%endif


%if "#{==:#{@catppuccin_window_default_fill},none}"

set -g @_ctp_w_left \
Expand All @@ -167,7 +182,7 @@ set -ogqF @catppuccin_window_current_right_separator "#{@catppuccin_window_right
"#[fg=#{@thm_surface_0},bg=default]#{@catppuccin_window_middle_separator}"
set -g @_ctp_w_right \
"#[fg=#{@thm_surface_0},bg=default]#{@catppuccin_window_right_separator}"

set -g @_ctp_w_number \
"#[fg=#{@thm_fg},bg=#{@thm_surface_0}]##I"
set -g @_ctp_w_text \
Expand Down Expand Up @@ -201,6 +216,7 @@ set -ogqF @catppuccin_window_current_right_separator "#{@catppuccin_window_right
%endif
%endif

set -agq @_ctp_w_text "#{@_ctp_w_flags}"
%if "#{==:#{@catppuccin_window_number_position},left}"
set -gF window-status-format \
"#{E:@_ctp_w_left}#{E:@_ctp_w_number}#{E:@_ctp_w_middle}#{E:@_ctp_w_text}#{E:@_ctp_w_right}"
Expand All @@ -221,7 +237,7 @@ set -ogqF @catppuccin_window_current_right_separator "#{@catppuccin_window_right
"#[fg=#{E:@catppuccin_window_current_color},bg=default]#{@catppuccin_window_current_middle_separator}"
set -g @_ctp_w_right \
"#[fg=#{E:@catppuccin_window_current_color},bg=default]#{@catppuccin_window_current_right_separator}"

set -g @_ctp_w_number \
"#[fg=#{@thm_fg},bg=#{E:@catppuccin_window_current_color}]##I"
set -g @_ctp_w_text \
Expand Down Expand Up @@ -255,6 +271,7 @@ set -ogqF @catppuccin_window_current_right_separator "#{@catppuccin_window_right
%endif
%endif

set -agq @_ctp_w_text "#{@_ctp_w_flags}"
%if "#{==:#{@catppuccin_window_number_position},left}"
set -gF window-status-current-format \
"#{E:@_ctp_w_left}#{E:@_ctp_w_number}#{E:@_ctp_w_middle}#{E:@_ctp_w_text}#{E:@_ctp_w_right}"
Expand All @@ -264,11 +281,12 @@ set -ogqF @catppuccin_window_current_right_separator "#{@catppuccin_window_right
%endif

# Cleanup (unset) all of the variables to cleanup.
set -ug @_ctp_p_left
set -ug @_ctp_p_middle
set -ug @_ctp_p_right
set -ug @_ctp_p_number
set -ug @_ctp_p_text
set -ug @_ctp_w_left
set -ug @_ctp_w_middle
set -ug @_ctp_w_right
set -ug @_ctp_w_number
set -ug @_ctp_w_text
set -ug @_ctp_w_flags
%endif

# modes
Expand Down
2 changes: 1 addition & 1 deletion status/application.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="application"

set -ogq "@catppuccin_${MODULE_NAME}_icon" ""
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_pink}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#{pane_current_command}"

Expand Down
2 changes: 1 addition & 1 deletion status/battery.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -ogq @batt_icon_status_discharging "󰂃"
set -ogq @batt_icon_status_unknown "󰂑"
set -ogq @batt_icon_status_attached "󱈑"

set -ogq "@catppuccin_${MODULE_NAME}_icon" "#{battery_icon}"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "#{battery_icon} "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_yellow}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#{battery_percentage}"

Expand Down
2 changes: 1 addition & 1 deletion status/clima.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Requires https://github.com/vascomfnunes/tmux-clima
%hidden MODULE_NAME="clima"

set -ogq "@catppuccin_${MODULE_NAME}_icon" ""
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_yellow}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#{clima}"

Expand Down
2 changes: 1 addition & 1 deletion status/cpu.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="cpu"

set -ogq "@catppuccin_${MODULE_NAME}_icon" ""
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogq "@catppuccin_${MODULE_NAME}_color" "#{cpu_bg_color}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#{cpu_percentage}"

Expand Down
2 changes: 1 addition & 1 deletion status/date_time.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="date_time"

set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰃰"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰃰 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_blue}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "%Y-%m-%d %H:%M"

Expand Down
2 changes: 1 addition & 1 deletion status/directory.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="directory"

set -ogq "@catppuccin_${MODULE_NAME}_icon" ""
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_pink}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#{b:pane_current_path}"

Expand Down
2 changes: 1 addition & 1 deletion status/gitmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%hidden MODULE_NAME="gitmux"

# Requires https://github.com/arl/gitmux
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰊢"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰊢 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{@thm_green}"
set -gq "@catppuccin_${MODULE_NAME}_text" '#(gitmux "#{pane_current_path}")'

Expand Down
2 changes: 1 addition & 1 deletion status/host.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="host"

set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰒋"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰒋 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_mauve}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#H"

Expand Down
2 changes: 1 addition & 1 deletion status/kube.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Requires https://github.com/jonmosco/kube-tmux

set -ogq "@catppuccin_${MODULE_NAME}_icon" "󱃾"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󱃾 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{@thm_blue}"
set -ogqF "@catppuccin_kube_context_color" "#{@thm_red}"
set -ogqF "@catppuccin_kube_namespace_color" "#{@thm_sky}"
Expand Down
2 changes: 1 addition & 1 deletion status/load.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="load"

set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰊚"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰊚 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_blue}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#{load_full}"

Expand Down
2 changes: 1 addition & 1 deletion status/pomodoro_plus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Requires https://github.com/olimorris/tmux-pomodoro-plus
%hidden MODULE_NAME="pomodoro_plus"

set -ogq "@catppuccin_${MODULE_NAME}_icon" ""
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_orange}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#{pomodoro_status}"

Expand Down
2 changes: 1 addition & 1 deletion status/session.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="session"

set -ogq "@catppuccin_${MODULE_NAME}_icon" ""
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "##{?client_prefix,#{E:@thm_red},#{E:@thm_green}}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#S"

Expand Down
2 changes: 1 addition & 1 deletion status/uptime.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="uptime"

set -ogq @catppuccin_uptime_icon "󰔟"
set -ogq @catppuccin_uptime_icon "󰔟 "
set -ogqF @catppuccin_uptime_color "#{@thm_green}"
set -ogq @catppuccin_uptime_text "#(uptime | sed 's/^[^,]*up *//; s/, *[[:digit:]]* user.*//; s/ day.*, */d /; s/:/h /; s/ min//; s/$/m/')"

Expand Down
2 changes: 1 addition & 1 deletion status/user.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="user"

set -ogq @catppuccin_user_icon ""
set -ogq @catppuccin_user_icon " "
set -ogqF @catppuccin_user_color "#{@thm_sky}"
set -ogq @catppuccin_user_text "#(whoami)"

Expand Down
2 changes: 1 addition & 1 deletion status/weather.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Requires https://github.com/xamut/tmux-weather.

set -ogq @catppuccin_weather_icon ""
set -ogq @catppuccin_weather_icon " "
set -ogqF @catppuccin_weather_color "#{@thm_yellow}"
set -ogq @catppuccin_weather_text "#{weather}"

Expand Down
2 changes: 1 addition & 1 deletion utils/status_module.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -gF "@catppuccin_status_${MODULE_NAME}" \
"#[fg=#{@catppuccin_${MODULE_NAME}_color},#{@_ctp_connect_color_bg},nobold,nounderscore,noitalics]#{@catppuccin_status_left_separator}"

set -agF "@catppuccin_status_${MODULE_NAME}" \
"#[fg=#{@thm_crust},bg=#{@catppuccin_${MODULE_NAME}_color}]#{@catppuccin_${MODULE_NAME}_icon} "
"#[fg=#{@thm_crust},bg=#{@catppuccin_${MODULE_NAME}_color}]#{@catppuccin_${MODULE_NAME}_icon}"

set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{@catppuccin_${MODULE_NAME}_color},"
%if "#{==:#{@catppuccin_status_fill},icon}"
Expand Down

0 comments on commit df8411c

Please sign in to comment.