diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json
index 826f126..1c2cb61 100644
--- a/config/.config/nvim/lazy-lock.json
+++ b/config/.config/nvim/lazy-lock.json
@@ -1,6 +1,6 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
- "LuaSnip": { "branch": "master", "commit": "df58ee1664cfda71479cd2bbd56114f56599eba6" },
+ "LuaSnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" },
"aerial.nvim": { "branch": "master", "commit": "e2e3bc2df4490690ea005395eecdc8eeb30c4def" },
"ai.nvim": { "branch": "main", "commit": "7fce571d1efe34fb41989a899efe0c57e13111a3" },
"asyncrun.vim": { "branch": "master", "commit": "61cc3081963a12048e00e89f8cedc8bd1cb83b8c" },
@@ -42,18 +42,15 @@
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lazygit.nvim": { "branch": "main", "commit": "1e08e3f5ac1152339690140e61a4a32b3bdc7de5" },
"leap.nvim": { "branch": "main", "commit": "4394f67ccefc64cdb3258c9f22195ed65a13e874" },
- "libp.nvim": { "branch": "main", "commit": "636b1748e92f66022c1763f32b2ded6b8606eda5" },
"lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" },
"lsp-timeout.nvim": { "branch": "main", "commit": "6325906730330105a9adc41d0ceb8499b3072e2b" },
- "lsp-zero.nvim": { "branch": "v2.x", "commit": "2c1e776fd28f001438f12b1d9cee8933a0a40934" },
- "lsp_lines.nvim": { "branch": "main", "commit": "cf2306dd332e34a3e91075b40bdd4f6db824b2ee" },
+ "lsp-zero.nvim": { "branch": "v3.x", "commit": "433db11e818d07a5151e2c750ca8f09cc2aa3146" },
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
"lush.nvim": { "branch": "main", "commit": "e8a58f36c256af65cda36878f6f2024a612154c3" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "0989bdf4fdf7b5aa4c74131d7ffccc3f399ac788" },
"mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" },
- "mini.notify": { "branch": "main", "commit": "f430f84e24557f55906c348c9f558665893f9d8c" },
"mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" },
"neodev.nvim": { "branch": "main", "commit": "34b93b809b781b8a1ad862142e40b11bae1dc0e9" },
@@ -86,7 +83,7 @@
"tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" },
"tagalong.vim": { "branch": "main", "commit": "5a2bbf2b1d5b657685a49d48d98a4aa921c1fde3" },
"telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" },
- "telescope.nvim": { "branch": "master", "commit": "b3ff5f33201f474d58f5be96244869f189bbc091" },
+ "telescope.nvim": { "branch": "master", "commit": "da8b3d485975a8727bea127518b65c980521ae22" },
"text-case.nvim": { "branch": "main", "commit": "04a2ef39604fac1e1cd280989afd101615039b88" },
"todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" },
"tree-sitter-gdscript": { "branch": "master", "commit": "03f20b94707a21bed90bb95101684bc4036139ce" },
diff --git a/tmux/.tmux/plugins/tmux-battery/.gitignore b/tmux/.tmux/plugins/tmux-battery/.gitignore
new file mode 100644
index 0000000..1377554
--- /dev/null
+++ b/tmux/.tmux/plugins/tmux-battery/.gitignore
@@ -0,0 +1 @@
+*.swp
diff --git a/tmux/.tmux/plugins/tmux-battery/scripts/battery_remain.sh b/tmux/.tmux/plugins/tmux-battery/scripts/battery_remain.sh
index 112f725..f456b2f 100755
--- a/tmux/.tmux/plugins/tmux-battery/scripts/battery_remain.sh
+++ b/tmux/.tmux/plugins/tmux-battery/scripts/battery_remain.sh
@@ -106,7 +106,11 @@ upower_battery_remaining_time() {
}
acpi_battery_remaining_time() {
- acpi -b | grep -m 1 -Eo "[0-9]+:[0-9]+:[0-9]+"
+ regex="[0-9]+:[0-9]+"
+ if ! $short; then
+ regex="$regex:[0-9]+"
+ fi
+ acpi -b | grep -m 1 -Eo "$regex"
}
print_battery_remain() {
diff --git a/tmux/.tmux/plugins/tmux/.gitignore b/tmux/.tmux/plugins/tmux/.gitignore
new file mode 100644
index 0000000..0d82d79
--- /dev/null
+++ b/tmux/.tmux/plugins/tmux/.gitignore
@@ -0,0 +1 @@
+custom
diff --git a/tmux/.tmux/plugins/tmux/README.md b/tmux/.tmux/plugins/tmux/README.md
index 6bf042c..75e0639 100644
--- a/tmux/.tmux/plugins/tmux/README.md
+++ b/tmux/.tmux/plugins/tmux/README.md
@@ -15,6 +15,24 @@
Copyright © 2021-present Catppuccin Org
+ diff --git a/tmux/.tmux/plugins/tmux/assets/config1.png b/tmux/.tmux/plugins/tmux/assets/config1.png new file mode 100644 index 0000000..d75206b Binary files /dev/null and b/tmux/.tmux/plugins/tmux/assets/config1.png differ diff --git a/tmux/.tmux/plugins/tmux/assets/config2.png b/tmux/.tmux/plugins/tmux/assets/config2.png new file mode 100644 index 0000000..eb5eb8c Binary files /dev/null and b/tmux/.tmux/plugins/tmux/assets/config2.png differ diff --git a/tmux/.tmux/plugins/tmux/assets/config3.png b/tmux/.tmux/plugins/tmux/assets/config3.png new file mode 100644 index 0000000..91b8454 Binary files /dev/null and b/tmux/.tmux/plugins/tmux/assets/config3.png differ diff --git a/tmux/.tmux/plugins/tmux/assets/overview.png b/tmux/.tmux/plugins/tmux/assets/overview.png new file mode 100644 index 0000000..f26e899 Binary files /dev/null and b/tmux/.tmux/plugins/tmux/assets/overview.png differ diff --git a/tmux/.tmux/plugins/tmux/catppuccin-frappe.tmuxtheme b/tmux/.tmux/plugins/tmux/catppuccin-frappe.tmuxtheme old mode 100755 new mode 100644 index 8ed37a8..a38a73f --- a/tmux/.tmux/plugins/tmux/catppuccin-frappe.tmuxtheme +++ b/tmux/.tmux/plugins/tmux/catppuccin-frappe.tmuxtheme @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" # WARNING: hex colors can't contain capital letters @@ -17,55 +15,3 @@ thm_yellow="#e5c890" thm_blue="#8caaee" thm_orange="#ef9f76" thm_black4="#626880" - -# ----------------------------=== Theme ===-------------------------- - -# utils -set() { - local option=$1 - local value=$2 - tmux set-option -gq "$option" "$value" -} - -setw() { - local option=$1 - local value=$2 - tmux set-window-option -gq "$option" "$value" -} - -# status -set status "on" -set status-bg "${thm_bg}" -set status-justify "left" -set status-left-length "100" -set status-right-length "100" - -# messages -set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" -set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - -# panes -set pane-border-style "fg=${thm_gray}" -set pane-active-border-style "fg=${thm_blue}" - -# windows -setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" -setw window-status-separator "" -setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" - -# --------=== Statusline - -set status-left "" -set status-right "#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]๎ถ#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]๏ฎ #[fg=$thm_fg,bg=$thm_gray] #W #{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}#[bg=$thm_gray]๎ถ#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]๎ #[fg=$thm_fg,bg=$thm_gray] #S " - -# current_dir -setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " - -# parent_dir/current_dir -# setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - -# --------=== Modes -setw clock-mode-colour "${thm_blue}" -setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/tmux/.tmux/plugins/tmux/catppuccin-latte.tmuxtheme b/tmux/.tmux/plugins/tmux/catppuccin-latte.tmuxtheme old mode 100755 new mode 100644 index 1ddb188..16f078f --- a/tmux/.tmux/plugins/tmux/catppuccin-latte.tmuxtheme +++ b/tmux/.tmux/plugins/tmux/catppuccin-latte.tmuxtheme @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" # WARNING: hex colors can't contain capital letters @@ -17,55 +15,3 @@ thm_yellow="#df8e1d" thm_blue="#1e66f5" thm_orange="#fe640b" thm_black4="#acb0be" - -# ----------------------------=== Theme ===-------------------------- - -# utils -set() { - local option=$1 - local value=$2 - tmux set-option -gq "$option" "$value" -} - -setw() { - local option=$1 - local value=$2 - tmux set-window-option -gq "$option" "$value" -} - -# status -set status "on" -set status-bg "${thm_bg}" -set status-justify "left" -set status-left-length "100" -set status-right-length "100" - -# messages -set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" -set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - -# panes -set pane-border-style "fg=${thm_gray}" -set pane-active-border-style "fg=${thm_blue}" - -# windows -setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" -setw window-status-separator "" -setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" - -# --------=== Statusline - -set status-left "" -set status-right "#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]๎ถ#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]๏ฎ #[fg=$thm_fg,bg=$thm_gray] #W #{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}#[bg=$thm_gray]๎ถ#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]๎ #[fg=$thm_fg,bg=$thm_gray] #S " - -# current_dir -setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " - -# parent_dir/current_dir -# setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - -# --------=== Modes -setw clock-mode-colour "${thm_blue}" -setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/tmux/.tmux/plugins/tmux/catppuccin-macchiato.tmuxtheme b/tmux/.tmux/plugins/tmux/catppuccin-macchiato.tmuxtheme old mode 100755 new mode 100644 index 3b16b64..c90bf76 --- a/tmux/.tmux/plugins/tmux/catppuccin-macchiato.tmuxtheme +++ b/tmux/.tmux/plugins/tmux/catppuccin-macchiato.tmuxtheme @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" # WARNING: hex colors can't contain capital letters @@ -17,55 +15,3 @@ thm_yellow="#eed49f" thm_blue="#8aadf4" thm_orange="#f5a97f" thm_black4="#5b6078" - -# ----------------------------=== Theme ===-------------------------- - -# utils -set() { - local option=$1 - local value=$2 - tmux set-option -gq "$option" "$value" -} - -setw() { - local option=$1 - local value=$2 - tmux set-window-option -gq "$option" "$value" -} - -# status -set status "on" -set status-bg "${thm_bg}" -set status-justify "left" -set status-left-length "100" -set status-right-length "100" - -# messages -set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" -set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - -# panes -set pane-border-style "fg=${thm_gray}" -set pane-active-border-style "fg=${thm_blue}" - -# windows -setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" -setw window-status-separator "" -setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" - -# --------=== Statusline - -set status-left "" -set status-right "#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]๎ถ#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]๏ฎ #[fg=$thm_fg,bg=$thm_gray] #W #{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}#[bg=$thm_gray]๎ถ#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]๎ #[fg=$thm_fg,bg=$thm_gray] #S " - -# current_dir -setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #W " -setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #W " - -# parent_dir/current_dir -# setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - -# --------=== Modes -setw clock-mode-colour "${thm_blue}" -setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/tmux/.tmux/plugins/tmux/catppuccin-mocha.tmuxtheme b/tmux/.tmux/plugins/tmux/catppuccin-mocha.tmuxtheme old mode 100755 new mode 100644 index d0b64fa..41e6369 --- a/tmux/.tmux/plugins/tmux/catppuccin-mocha.tmuxtheme +++ b/tmux/.tmux/plugins/tmux/catppuccin-mocha.tmuxtheme @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # NOTE: you can use vars with $ and ${} as long as the str is double quoted: "" # WARNING: hex colors can't contain capital letters @@ -17,55 +15,3 @@ thm_yellow="#f9e2af" thm_blue="#89b4fa" thm_orange="#fab387" thm_black4="#585b70" - -# ----------------------------=== Theme ===-------------------------- - -# utils -set() { - local option=$1 - local value=$2 - tmux set-option -gq "$option" "$value" -} - -setw() { - local option=$1 - local value=$2 - tmux set-window-option -gq "$option" "$value" -} - -# status -set status "on" -set status-bg "${thm_bg}" -set status-justify "left" -set status-left-length "100" -set status-right-length "100" - -# messages -set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" -set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" - -# panes -set pane-border-style "fg=${thm_gray}" -set pane-active-border-style "fg=${thm_blue}" - -# windows -setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" -setw window-status-separator "" -setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" - -# --------=== Statusline - -set status-left "" -set status-right "#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]๎ถ#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics]๏ฎ #[fg=$thm_fg,bg=$thm_gray] #W #{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}#[bg=$thm_gray]๎ถ#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg]๎ #[fg=$thm_fg,bg=$thm_gray] #S " - -# current_dir -setw window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} " -setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} " - -# parent_dir/current_dir -# setw window-status-format "#[fg=colour232,bg=colour111] #I #[fg=colour222,bg=colour235] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " -# setw window-status-current-format "#[fg=colour232,bg=colour208] #I #[fg=colour255,bg=colour237] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) " - -# --------=== Modes -setw clock-mode-colour "${thm_blue}" -setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" diff --git a/tmux/.tmux/plugins/tmux/catppuccin.tmux b/tmux/.tmux/plugins/tmux/catppuccin.tmux index 928321f..11d4030 100755 --- a/tmux/.tmux/plugins/tmux/catppuccin.tmux +++ b/tmux/.tmux/plugins/tmux/catppuccin.tmux @@ -1,23 +1,332 @@ #!/usr/bin/env bash -CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -get-tmux-option() { +get_tmux_option() { local option value default option="$1" default="$2" - value="$(tmux show-option -gqv "$option")" + value=$(tmux show-option -gqv "$option") + + if [ -n "$value" ] + then + if [ "$value" = "null" ] + then + echo "" + + else + echo "$value" + fi - if [ -n "$value" ]; then - echo "$value" else echo "$default" + fi } +set() { + local option=$1 + local value=$2 + tmux_commands+=(set-option -gq "$option" "$value" ";") +} + +setw() { + local option=$1 + local value=$2 + tmux_commands+=(set-window-option -gq "$option" "$value" ";") +} + +build_window_icon() { + local window_status_icon_enable=$(get_tmux_option "@catppuccin_window_status_icon_enable" "yes") + + local custom_icon_window_last=$(get_tmux_option "@catppuccin_icon_window_last" "๓ฐฐ") + local custom_icon_window_current=$(get_tmux_option "@catppuccin_icon_window_current" "๓ฐฏ") + local custom_icon_window_zoom=$(get_tmux_option "@catppuccin_icon_window_zoom" "๓ฐ") + local custom_icon_window_mark=$(get_tmux_option "@catppuccin_icon_window_mark" "๓ฐ") + local custom_icon_window_silent=$(get_tmux_option "@catppuccin_icon_window_silent" "๓ฐ") + local custom_icon_window_activity=$(get_tmux_option "@catppuccin_icon_window_activity" "๓ฐฒ") + local custom_icon_window_bell=$(get_tmux_option "@catppuccin_icon_window_bell" "๓ฐ") + + if [ "$window_status_icon_enable" = "yes" ] + then + # #!~[*-]MZ + local show_window_status="#{?window_activity_flag,${custom_icon_window_activity},}#{?window_bell_flag,${custom_icon_window_bell},}#{?window_silence_flag,${custom_icon_window_silent},}#{?window_active,${custom_icon_window_current},}#{?window_last_flag,${custom_icon_window_last},}#{?window_marked_flag,${custom_icon_window_mark},}#{?window_zoomed_flag,${custom_icon_window_zoom},}" + fi + + if [ "$window_status_icon_enable" = "no" ] + then + local show_window_status="#F" + fi + + echo "$show_window_status" +} + +build_window_format() { + local number=$1 + local color=$2 + local background=$3 + local text=$4 + local fill=$5 + + if [ "$window_status_enable" = "yes" ] + then + local icon="$( build_window_icon )" + text="$text $icon" + fi + + if [ "$fill" = "none" ] + then + local show_left_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_number="#[fg=$thm_fg,bg=$thm_gray]$number" + local show_middle_separator="#[fg=$thm_fg,bg=$thm_gray,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_fg,bg=$thm_gray]$text" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg]$window_right_separator" + + fi + + if [ "$fill" = "all" ] + then + local show_left_separator="#[fg=$color,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_number="#[fg=$background,bg=$color]$number" + local show_middle_separator="#[fg=$background,bg=$color,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$background,bg=$color]$text" + local show_right_separator="#[fg=$color,bg=$thm_bg]$window_right_separator" + + fi + + if [ "$fill" = "number" ] + then + local show_number="#[fg=$background,bg=$color]$number" + local show_middle_separator="#[fg=$color,bg=$background,nobold,nounderscore,noitalics]$window_middle_separator" + local show_text="#[fg=$thm_fg,bg=$background]$text" + + if [ "$window_number_position" = "right" ] + then + local show_left_separator="#[fg=$background,bg=$thm_bg,nobold,nounderscore,noitalics]$window_left_separator" + local show_right_separator="#[fg=$color,bg=$thm_bg]$window_right_separator" + fi + + if [ "$window_number_position" = "left" ] + then + local show_right_separator="#[fg=$background,bg=$thm_bg,nobold,nounderscore,noitalics]$window_right_separator" + local show_left_separator="#[fg=$color,bg=$thm_bg]$window_left_separator" + fi + + fi + + local final_window_format + + if [ "$window_number_position" = "right" ] + then + final_window_format="$show_left_separator$show_text$show_middle_separator$show_number$show_right_separator" + fi + + if [ "$window_number_position" = "left" ] + then + final_window_format="$show_left_separator$show_number$show_middle_separator$show_text$show_right_separator" + fi + + echo "$final_window_format" +} + +build_status_module() { + local index=$1 + local icon=$2 + local color=$3 + local text=$4 + + if [ "$status_fill" = "icon" ] + then + local show_left_separator="#[fg=$color,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" + + local show_icon="#[fg=$thm_bg,bg=$color,nobold,nounderscore,noitalics]$icon " + local show_text="#[fg=$thm_fg,bg=$thm_gray] $text" + + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + + if [ "$status_connect_separator" = "yes" ] + then + local show_left_separator="#[fg=$color,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" + local show_right_separator="#[fg=$thm_gray,bg=$thm_gray,nobold,nounderscore,noitalics]$status_right_separator" + + else + local show_left_separator="#[fg=$color,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" + local show_right_separator="#[fg=$thm_gray,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + fi + + fi + + if [ "$status_fill" = "all" ] + then + local show_left_separator="#[fg=$color,bg=$thm_gray,nobold,nounderscore,noitalics]$status_left_separator" + + local show_icon="#[fg=$thm_bg,bg=$color,nobold,nounderscore,noitalics]$icon " + local show_text="#[fg=$thm_bg,bg=$color]$text" + + local show_right_separator="#[fg=$color,bg=$thm_gray,nobold,nounderscore,noitalics]$status_right_separator" + + if [ "$status_connect_separator" = "yes" ] + then + local show_left_separator="#[fg=$color,nobold,nounderscore,noitalics]$status_left_separator" + local show_right_separator="#[fg=$color,bg=$color,nobold,nounderscore,noitalics]$status_right_separator" + + else + local show_left_separator="#[fg=$color,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" + local show_right_separator="#[fg=$color,bg=$thm_bg,nobold,nounderscore,noitalics]$status_right_separator" + fi + + fi + + if [ "$status_right_separator_inverse" = "yes" ] + then + if [ "$status_connect_separator" = "yes" ] + then + local show_right_separator="#[fg=$thm_gray,bg=$color,nobold,nounderscore,noitalics]$status_right_separator" + else + local show_right_separator="#[fg=$thm_bg,bg=$color,nobold,nounderscore,noitalics]$status_right_separator" + fi + fi + + if [ $(($index)) -eq 0 ] + then + local show_left_separator="#[fg=$color,bg=$thm_bg,nobold,nounderscore,noitalics]$status_left_separator" + fi + + echo "$show_left_separator$show_icon$show_text$show_right_separator" +} + +load_modules() { + local modules_list=$1 + + local modules_custom_path=$PLUGIN_DIR/custom + local modules_status_path=$PLUGIN_DIR/status + local modules_window_path=$PLUGIN_DIR/window + + local module_index=0; + local module_name + local loaded_modules + local IN=$modules_list + + # https://stackoverflow.com/questions/918886/how-do-i-split-a-string-on-a-delimiter-in-bash#15988793 + while [ "$IN" != "$iter" ] ;do + # extract the substring from start of string up to delimiter. + iter=${IN%% *} + # delete this first "element" AND next separator, from $IN. + IN="${IN#$iter }" + # Print (or doing anything with) the first "element". + + module_name=$iter + + local module_path=$modules_custom_path/$module_name.sh + source $module_path + + if [ 0 -eq $? ] + then + loaded_modules="$loaded_modules$( show_$module_name $module_index )" + module_index=$module_index+1 + continue + fi + + local module_path=$modules_status_path/$module_name.sh + source $module_path + + if [ 0 -eq $? ] + then + loaded_modules="$loaded_modules$( show_$module_name $module_index )" + module_index=$module_index+1 + continue + fi + + local module_path=$modules_window_path/$module_name.sh + source $module_path + + if [ 0 -eq $? ] + then + loaded_modules="$loaded_modules$( show_$module_name $module_index )" + module_index=$module_index+1 + continue + fi + + done + + echo "$loaded_modules" +} + main() { local theme - theme="$(get-tmux-option "@catppuccin_flavour" "mocha")" - tmux run -b "$CURRENT_DIR/catppuccin-${theme}.tmuxtheme" + theme="$(get_tmux_option "@catppuccin_flavour" "mocha")" + + # Aggregate all commands in one array + local tmux_commands=() + + # NOTE: Pulling in the selected theme by the theme that's being set as local + # variables. + # shellcheck source=catppuccin-frappe.tmuxtheme + # https://github.com/dylanaraps/pure-sh-bible#parsing-a-keyval-file + while IFS='=' read -r key val; do + # Skip over lines containing comments. + # (Lines starting with '#'). + [ "${key##\#*}" ] || continue + + # '$key' stores the key. + # '$val' stores the value. + eval "local $key"="$val" + done < "${PLUGIN_DIR}/catppuccin-${theme}.tmuxtheme" + + # status + set status "on" + set status-bg "${thm_bg}" + set status-justify "left" + set status-left-length "100" + set status-right-length "100" + + # messages + set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" + set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" + + # panes + set pane-border-style "fg=${thm_gray}" + set pane-active-border-style "fg=${thm_blue}" + + # windows + setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" + setw window-status-separator "" + setw window-status-style "fg=${thm_fg},bg=${thm_bg},none" + + # --------=== Statusline + + local window_left_separator=$(get_tmux_option "@catppuccin_window_left_separator" "โ") + local window_right_separator=$(get_tmux_option "@catppuccin_window_right_separator" "โ") + local window_middle_separator=$(get_tmux_option "@catppuccin_window_middle_separator" "โ ") + local window_number_position=$(get_tmux_option "@catppuccin_window_number_position" "left") # right, left + local window_status_enable=$(get_tmux_option "@catppuccin_window_status_enable" "no") # right, left + + local window_format=$( load_modules "window_default_format") + local window_current_format=$( load_modules "window_current_format") + + setw window-status-format "$window_format" + setw window-status-current-format "$window_current_format" + + local status_left_separator=$(get_tmux_option "@catppuccin_status_left_separator" "๎ถ") + local status_right_separator=$(get_tmux_option "@catppuccin_status_right_separator" "โ") + local status_right_separator_inverse=$(get_tmux_option "@catppuccin_status_right_separator_inverse" "no") + local status_connect_separator=$(get_tmux_option "@catppuccin_status_connect_separator" "yes") + local status_fill=$(get_tmux_option "@catppuccin_status_fill" "icon") + + local status_modules_right=$(get_tmux_option "@catppuccin_status_modules_right" "application session") + local loaded_modules_right=$( load_modules "$status_modules_right") + + local status_modules_left=$(get_tmux_option "@catppuccin_status_modules_left" "") + local loaded_modules_left=$( load_modules "$status_modules_left") + + set status-left "$loaded_modules_left" + set status-right "$loaded_modules_right" + + # --------=== Modes + # + setw clock-mode-colour "${thm_blue}" + setw mode-style "fg=${thm_pink} bg=${thm_black4} bold" + + tmux "${tmux_commands[@]}" } main "$@" diff --git a/tmux/.tmux/plugins/tmux/status/application.sh b/tmux/.tmux/plugins/tmux/status/application.sh new file mode 100644 index 0000000..56f2e76 --- /dev/null +++ b/tmux/.tmux/plugins/tmux/status/application.sh @@ -0,0 +1,10 @@ +show_application() { + local index=$1 + local icon=$(get_tmux_option "@catppuccin_application_icon" "๏ฎ") + local color=$(get_tmux_option "@catppuccin_application_color" "$thm_pink") + local text=$(get_tmux_option "@catppuccin_application_text" "#W") + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo "$module" +} diff --git a/tmux/.tmux/plugins/tmux/status/battery.sh b/tmux/.tmux/plugins/tmux/status/battery.sh new file mode 100644 index 0000000..7ad978f --- /dev/null +++ b/tmux/.tmux/plugins/tmux/status/battery.sh @@ -0,0 +1,23 @@ +show_battery() { + tmux set-option -g @batt_icon_charge_tier8 '๓ฐน' + tmux set-option -g @batt_icon_charge_tier7 '๓ฐ' + tmux set-option -g @batt_icon_charge_tier6 '๓ฐฟ' + tmux set-option -g @batt_icon_charge_tier5 '๓ฐพ' + tmux set-option -g @batt_icon_charge_tier4 '๓ฐฝ' + tmux set-option -g @batt_icon_charge_tier3 '๓ฐผ' + tmux set-option -g @batt_icon_charge_tier2 '๓ฐป' + tmux set-option -g @batt_icon_charge_tier1 '๓ฐบ' + tmux set-option -g @batt_icon_status_charged '๓ฐฅ' + tmux set-option -g @batt_icon_status_charging '๓ฐ' + tmux set-option -g @batt_icon_status_discharging '๓ฐ' + tmux set-option -g @batt_icon_status_unknown '๓ฐ' + + local index=$1 + local icon=$(get_tmux_option "@catppuccin_battery_icon" "#{battery_icon}") + local color=$(get_tmux_option "@catppuccin_battery_color" "$thm_yellow") + local text=$(get_tmux_option "@catppuccin_battery_text" "#{battery_percentage}") + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo "$module" +} diff --git a/tmux/.tmux/plugins/tmux/status/date_time.sh b/tmux/.tmux/plugins/tmux/status/date_time.sh new file mode 100644 index 0000000..9f7030e --- /dev/null +++ b/tmux/.tmux/plugins/tmux/status/date_time.sh @@ -0,0 +1,11 @@ +show_date_time() { + local index=$1 + local icon="$(get_tmux_option "@catppuccin_date_time_icon" "๓ฐฐ")" + local color="$(get_tmux_option "@catppuccin_date_time_color" "$thm_blue")" + local text="$(get_tmux_option "@catppuccin_date_time_text" "%Y-%m-%d %H:%M")" + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo "$module" +} + diff --git a/tmux/.tmux/plugins/tmux/status/directory.sh b/tmux/.tmux/plugins/tmux/status/directory.sh new file mode 100644 index 0000000..1ff293d --- /dev/null +++ b/tmux/.tmux/plugins/tmux/status/directory.sh @@ -0,0 +1,10 @@ +show_directory() { + local index=$1 + local icon=$(get_tmux_option "@catppuccin_directory_icon" "๏ป") + local color=$(get_tmux_option "@catppuccin_directory_color" "$thm_pink") + local text=$(get_tmux_option "@catppuccin_directory_text" "#{b:pane_current_path}") + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo "$module" +} diff --git a/tmux/.tmux/plugins/tmux/status/host.sh b/tmux/.tmux/plugins/tmux/status/host.sh new file mode 100644 index 0000000..5abd71e --- /dev/null +++ b/tmux/.tmux/plugins/tmux/status/host.sh @@ -0,0 +1,10 @@ +show_host() { + local index=$1 + local icon=$(get_tmux_option "@catppuccin_host_icon" "๓ฐ") + local color=$(get_tmux_option "@catppuccin_host_color" "$thm_magenta") + local text=$(get_tmux_option "@catppuccin_host_text" "#H") + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo "$module" +} diff --git a/tmux/.tmux/plugins/tmux/status/session.sh b/tmux/.tmux/plugins/tmux/status/session.sh new file mode 100644 index 0000000..58d6c90 --- /dev/null +++ b/tmux/.tmux/plugins/tmux/status/session.sh @@ -0,0 +1,10 @@ +show_session() { + local index=$1 + local icon=$(get_tmux_option "@catppuccin_session_icon" "๎") + local color=$(get_tmux_option "@catppuccin_session_color" "#{?client_prefix,$thm_red,$thm_green}") + local text=$(get_tmux_option "@catppuccin_session_text" "#S") + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo "$module" +} diff --git a/tmux/.tmux/plugins/tmux/status/user.sh b/tmux/.tmux/plugins/tmux/status/user.sh new file mode 100644 index 0000000..1d4d03e --- /dev/null +++ b/tmux/.tmux/plugins/tmux/status/user.sh @@ -0,0 +1,10 @@ +show_user() { + local index=$1 + local icon=$(get_tmux_option "@catppuccin_user_icon" "๏") + local color=$(get_tmux_option "@catppuccin_user_color" "$thm_cyan") + local text=$(get_tmux_option "@catppuccin_user_text" "#(whoami)") + + local module=$( build_status_module "$index" "$icon" "$color" "$text" ) + + echo "$module" +} diff --git a/tmux/.tmux/plugins/tmux/window/window_current_format.sh b/tmux/.tmux/plugins/tmux/window/window_current_format.sh new file mode 100644 index 0000000..88e9053 --- /dev/null +++ b/tmux/.tmux/plugins/tmux/window/window_current_format.sh @@ -0,0 +1,11 @@ +show_window_current_format() { + local number="#I" + local color="$thm_orange" + local background="$thm_bg" + local text="$(get_tmux_option "@catppuccin_window_current_text" "#{b:pane_current_path}")" # use #W for application instead of directory + local fill="$(get_tmux_option "@catppuccin_window_current_fill" "number")" # number, all, none + + local current_window_format=$( build_window_format "$number" "$color" "$background" "$text" "$fill" ) + + echo "$current_window_format" +} diff --git a/tmux/.tmux/plugins/tmux/window/window_default_format.sh b/tmux/.tmux/plugins/tmux/window/window_default_format.sh new file mode 100644 index 0000000..1f5f016 --- /dev/null +++ b/tmux/.tmux/plugins/tmux/window/window_default_format.sh @@ -0,0 +1,11 @@ +show_window_default_format() { + local number="#I" + local color="$thm_blue" + local background="$thm_gray" + local text="$(get_tmux_option "@catppuccin_window_default_text" "#{b:pane_current_path}")" # use #W for application instead of directory + local fill="$(get_tmux_option "@catppuccin_window_default_fill" "number")" # number, all, none + + local default_window_format=$( build_window_format "$number" "$color" "$background" "$text" "$fill" ) + + echo "$default_window_format" +} diff --git a/tmux/.tmux/plugins/vim-tmux-navigator/README.md b/tmux/.tmux/plugins/vim-tmux-navigator/README.md index 2c9dfa0..a45f310 100644 --- a/tmux/.tmux/plugins/vim-tmux-navigator/README.md +++ b/tmux/.tmux/plugins/vim-tmux-navigator/README.md @@ -53,6 +53,31 @@ If you are using Vim 8+, you don't need any plugin manager. Simply clone this re git clone git@github.com:christoomey/vim-tmux-navigator.git ~/.vim/pack/plugins/start/vim-tmux-navigator ``` +### lazy.nvim + +If you are using [lazy.nvim](https://github.com/folke/lazy.nvim). Add the following plugin to your configuration. + +```lua +{ + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + }, + keys = { + { "