From aefa3f04f39a6dd0a92bd2719f318b4b774720b9 Mon Sep 17 00:00:00 2001 From: Alejandro Amaral Date: Sat, 8 Jun 2024 20:33:31 -0300 Subject: [PATCH] feat: added hide style to custom numbers (#89) --- src/custom-number.sh | 11 ++++++++--- tokyo-night.tmux | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/custom-number.sh b/src/custom-number.sh index 0408d3a7..aadf3764 100755 --- a/src/custom-number.sh +++ b/src/custom-number.sh @@ -4,6 +4,7 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." . "${ROOT_DIR}/lib/coreutils-compat.sh" +format_hide="" format_none="0123456789" format_digital="🯰🯱🯲🯳🯴🯵🯶🯷🯸🯹" format_fsquare="󰎡󰎤󰎧󰎪󰎭󰎱󰎳󰎶󰎹󰎼" @@ -18,6 +19,11 @@ FORMAT=${2:-none} # Preserve leading whitespace for bash format="$(eval echo \"\$format_${FORMAT}\")" + +if [ "$FORMAT" = "hide" ]; then + exit 0 +fi + if [ -z "$format" ]; then echo "Invalid format: $FORMAT" exit 1 @@ -25,11 +31,10 @@ fi # If format is roman numerals (-r), only handle IDs of 1 digit if [ "$FORMAT" = "roman" ] && [ ${#ID} -gt 1 ]; then - echo -n $ID - continue + echo -n "$ID " else for ((i = 0; i < ${#ID}; i++)); do DIGIT=${ID:i:1} - echo -n "${format:DIGIT:1}" + echo -n "${format:DIGIT:1} " done fi diff --git a/tokyo-night.tmux b/tokyo-night.tmux index 7d06fe9f..6a55454c 100755 --- a/tokyo-night.tmux +++ b/tokyo-night.tmux @@ -58,9 +58,9 @@ tmux set -g status-left "#[fg=${THEME[bblack]},bg=${THEME[blue]},bold] #{?client #+--- Windows ---+ # Focus -tmux set -g window-status-current-format "$RESET#[fg=${THEME[green]},bg=${THEME[bblack]}] #{?#{==:#{pane_current_command},ssh},󰣀,} #[fg=${THEME[foreground]},bold,nodim]$window_number #W#[nobold]#{?window_zoomed_flag, $zoom_number, $custom_pane} #{?window_last_flag,,} " +tmux set -g window-status-current-format "$RESET#[fg=${THEME[green]},bg=${THEME[bblack]}] #{?#{==:#{pane_current_command},ssh},󰣀 , }#[fg=${THEME[foreground]},bold,nodim]$window_number#W#[nobold]#{?window_zoomed_flag, $zoom_number, $custom_pane}#{?window_last_flag, , }" # Unfocused -tmux set -g window-status-format "$RESET#[fg=${THEME[foreground]}] #{?#{==:#{pane_current_command},ssh},󰣀,}${RESET} $window_number #W#[nobold,dim]#{?window_zoomed_flag, $zoom_number, $custom_pane} #[fg=${THEME[yellow]}]#{?window_last_flag,󰁯 , } " +tmux set -g window-status-format "$RESET#[fg=${THEME[foreground]}] #{?#{==:#{pane_current_command},ssh},󰣀 , }${RESET}$window_number#W#[nobold,dim]#{?window_zoomed_flag, $zoom_number, $custom_pane}#[fg=${THEME[yellow]}]#{?window_last_flag,󰁯 , }" #+--- Bars RIGHT ---+ tmux set -g status-right "$battery_status$current_path$cmus_status$netspeed$git_status$wb_git_status$date_and_time"