···11+22+require("config.lazy")
33+44+require("toggleterm").setup{
55+ -- size can be a number or function which is passed the current terminal
66+ size = 20,
77+ open_mapping = [[<c-\>]],
88+ hide_numbers = true, -- hide the number column in toggleterm buffers
99+ shade_filetypes = {},
1010+ shade_terminals = true,
1111+ shading_factor = '1', -- the degree by which to darken to terminal colour, default: 1
1212+ start_in_insert = true,
1313+ insert_mappings = true, -- whether or not the open mapping applies in insert mode
1414+ terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals
1515+ persist_size = true,
1616+ direction = 'horizontal', -- 'vertical' | 'horizontal' | 'window' | 'float'
1717+ close_on_exit = true, -- close the terminal window when the process exits
1818+ shell = vim.o.shell, -- change the default shell
1919+ float_opts = {
2020+ border = 'curved',
2121+ winblend = 0,
2222+ highlights = {
2323+ border = "Normal",
2424+ background = "Normal",
2525+ }
2626+ }
2727+}
2828+2929+for _, method in ipairs({ 'textDocument/diagnostic', 'workspace/diagnostic' }) do
3030+ local default_diagnostic_handler = vim.lsp.handlers[method]
3131+ vim.lsp.handlers[method] = function(err, result, context, config)
3232+ if err ~= nil and err.code == -32802 then
3333+ return
3434+ end
3535+ return default_diagnostic_handler(err, result, context, config)
3636+ end
3737+end
···11+-- Bootstrap lazy.nvim
22+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
33+if not (vim.uv or vim.loop).fs_stat(lazypath) then
44+ local lazyrepo = "https://github.com/folke/lazy.nvim.git"
55+ local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
66+ if vim.v.shell_error ~= 0 then
77+ vim.api.nvim_echo({
88+ { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
99+ { out, "WarningMsg" },
1010+ { "\nPress any key to exit..." },
1111+ }, true, {})
1212+ vim.fn.getchar()
1313+ os.exit(1)
1414+ end
1515+end
1616+vim.opt.rtp:prepend(lazypath)
1717+1818+-- Make sure to setup `mapleader` and `maplocalleader` before
1919+-- loading lazy.nvim so that mappings are correct.
2020+-- This is also a good place to setup other settings (vim.opt)
2121+vim.g.mapleader = " "
2222+vim.g.maplocalleader = "\\"
2323+2424+-- Setup lazy.nvim
2525+require("lazy").setup({
2626+ spec = {
2727+ -- import your plugins
2828+ { "LazyVim/LazyVim", import = "lazyvim.plugins" },
2929+-- { import = "lazyvim.plugins.extras.lang.rust" },
3030+ { import = "plugins" },
3131+ },
3232+ -- Configure any other settings here. See the documentation for more details.
3333+ -- colorscheme that will be used when installing plugins.
3434+ install = { colorscheme = { "habamax" } },
3535+ -- automatically check for plugin updates
3636+ checker = { enabled = true },
3737+})
3838+
+6
.config/nvim/lua/plugins/copilot-cmp.lua
···11+return {
22+ "zbirenbaum/copilot-cmp",
33+ config = function ()
44+ require("copilot_cmp").setup()
55+ end
66+}
···11+22+return {
33+ -- the colorscheme should be available when starting Neovim
44+ {
55+ "folke/tokyonight.nvim",
66+ lazy = false, -- make sure we load this during startup if it is your main colorscheme
77+ priority = 1000, -- make sure to load this before all the other start plugins
88+ config = function()
99+ -- load the colorscheme here
1010+ vim.cmd([[colorscheme tokyonight]])
1111+ end,
1212+ },
1313+1414+ -- I have a separate config.mappings file where I require which-key.
1515+ -- With lazy the plugin will be automatically loaded when it is required somewhere
1616+ { "folke/which-key.nvim", lazy = true },
1717+1818+ {
1919+ "nvim-neorg/neorg",
2020+ -- lazy-load on filetype
2121+ ft = "norg",
2222+ -- options for neorg. This will automatically call `require("neorg").setup(opts)`
2323+ opts = {
2424+ load = {
2525+ ["core.defaults"] = {},
2626+ },
2727+ },
2828+ },
2929+3030+ {
3131+ "dstein64/vim-startuptime",
3232+ -- lazy-load on a command
3333+ cmd = "StartupTime",
3434+ -- init is called during startup. Configuration for vim plugins typically should be set in an init function
3535+ init = function()
3636+ vim.g.startuptime_tries = 10
3737+ end,
3838+ },
3939+4040+ {
4141+ "hrsh7th/nvim-cmp",
4242+ -- load cmp on InsertEnter
4343+ event = "InsertEnter",
4444+ -- these dependencies will only be loaded when cmp loads
4545+ -- dependencies are always lazy-loaded unless specified otherwise
4646+ dependencies = {
4747+ "hrsh7th/cmp-nvim-lsp",
4848+ "hrsh7th/cmp-buffer",
4949+ },
5050+ enabled = true,
5151+ config = function()
5252+ -- ...
5353+ end,
5454+ },
5555+5656+ -- if some code requires a module from an unloaded plugin, it will be automatically loaded.
5757+ -- So for api plugins like devicons, we can always set lazy=true
5858+ { "nvim-tree/nvim-web-devicons", lazy = true },
5959+6060+ -- you can use the VeryLazy event for things that can
6161+ -- load later and are not important for the initial UI
6262+ { "stevearc/dressing.nvim", event = "VeryLazy" },
6363+6464+ {
6565+ "Wansmer/treesj",
6666+ keys = {
6767+ { "J", "<cmd>TSJToggle<cr>", desc = "Join Toggle" },
6868+ },
6969+ opts = { use_default_keymaps = false, max_join_length = 150 },
7070+ },
7171+7272+ {
7373+ "monaqa/dial.nvim",
7474+ -- lazy-load on keys
7575+ -- mode is `n` by default. For more advanced options, check the section on key mappings
7676+ keys = { "<C-a>", { "<C-x>", mode = "n" } },
7777+ },
7878+7979+ -- local plugins need to be explicitly configured with dir
8080+ -- { dir = "~/projects/secret.nvim" },
8181+8282+ -- you can use a custom url to fetch a plugin
8383+ { url = "git@github.com:folke/noice.nvim.git" },
8484+8585+ -- local plugins can also be configured with the dev option.
8686+ -- This will use {config.dev.path}/noice.nvim/ instead of fetching it from GitHub
8787+ -- With the dev option, you can easily switch between the local and installed version of a plugin
8888+ -- { "folke/noice.nvim", dev = true },
8989+9090+ -- amongst your other plugins
9191+ { "akinsho/toggleterm.nvim", version = "*", config = true },
9292+ {
9393+ "nvim-treesitter/nvim-treesitter",
9494+ opts = {
9595+ ensure_installed = {
9696+ "rust",
9797+ "go",
9898+ "gleam",
9999+ "javascript",
100100+ "typescript",
101101+ "zig",
102102+ "ruby",
103103+ "elixir",
104104+ "haskell",
105105+ "purescript",
106106+ "clojure",
107107+ "lua",
108108+ },
109109+ },
110110+ },
111111+}
···11+# : << 'EOF'
22+# Oh my tmux!
33+# 💛🩷💙🖤❤️🤍
44+# https://github.com/gpakosz/.tmux
55+# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
66+# without any warranty.
77+# Copyright 2012— Gregory Pakosz (@gpakosz).
88+#
99+# ------------------------------------------------------------------------------
1010+# 🚨 DO NOT MODIFY THIS FILE
1111+# instead, override your .local customization file copy, see README.md
1212+# ------------------------------------------------------------------------------
1313+1414+1515+# -- general -------------------------------------------------------------------
1616+1717+set -g default-terminal "screen-256color"
1818+1919+%if #{||:#{m/ri:mintty|iTerm,#{TERM_PROGRAM}},#{!=:#{XTERM_VERSION},}}
2020+set -g extended-keys on # needed by Control + Shift bindings
2121+%endif
2222+set -s escape-time 10 # faster command sequences
2323+set -sg repeat-time 600 # increase repeat timeout
2424+set -s focus-events on
2525+2626+set -g prefix2 C-a # GNU-Screen compatible prefix
2727+bind C-a send-prefix -2
2828+2929+set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
3030+setw -q -g utf8 on
3131+3232+set -g history-limit 5000 # boost history
3333+3434+# edit configuration
3535+%if #{>=:#{version},3.0}
3636+bind e new-window -n "#{TMUX_CONF_LOCAL}" -e EDITOR="$EDITOR" sh -c 'case "${EDITOR:-vim}" in *vim*) ${EDITOR:-vim} -c ":set syntax=tmux" "$TMUX_CONF_LOCAL";; *) $EDITOR "$TMUX_CONF_LOCAL";; esac && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
3737+%else
3838+set-environment -g EDITOR "$EDITOR"
3939+bind e new-window -n "#{TMUX_CONF_LOCAL}" sh -c 'case "${EDITOR:-vim}" in *vim*) ${EDITOR:-vim} -c ":set syntax=tmux" "$TMUX_CONF_LOCAL";; *) $EDITOR "$TMUX_CONF_LOCAL";; esac && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
4040+%endif
4141+4242+# reload configuration
4343+bind r run "sh -c '\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} source \"\$TMUX_CONF\"'" \; display "#{TMUX_CONF} sourced"
4444+4545+4646+# -- display -------------------------------------------------------------------
4747+4848+set -g base-index 1 # start windows numbering at 1
4949+setw -g pane-base-index 1 # make pane numbering consistent with windows
5050+5151+setw -g automatic-rename on # rename window to reflect current program
5252+set -g renumber-windows on # renumber windows when a window is closed
5353+5454+set -g set-titles on # set terminal title
5555+5656+set -g display-panes-time 800 # slightly longer pane indicators display time
5757+set -g display-time 1000 # slightly longer status messages display time
5858+5959+set -g status-interval 10 # redraw status line every 10 seconds
6060+6161+# clear both screen and history
6262+bind -n C-l send-keys C-l \; run 'sleep 0.2' \; clear-history
6363+6464+# activity
6565+set -g monitor-activity on
6666+set -g visual-activity off
6767+6868+6969+# -- navigation ----------------------------------------------------------------
7070+7171+# create session
7272+bind C-c new-session
7373+7474+# find session
7575+bind C-f command-prompt -p find-session 'switch-client -t %%'
7676+7777+# session navigation
7878+bind BTab switch-client -l # move to last session
7979+8080+# split current window horizontally
8181+bind - split-window -v
8282+# split current window vertically
8383+bind _ split-window -h
8484+8585+# pane navigation
8686+bind -r h select-pane -L # move left
8787+bind -r j select-pane -D # move down
8888+bind -r k select-pane -U # move up
8989+bind -r l select-pane -R # move right
9090+bind > swap-pane -D # swap current pane with the next one
9191+bind < swap-pane -U # swap current pane with the previous one
9292+9393+# maximize current pane
9494+bind + run "cut -c3- '#{TMUX_CONF}' | sh -s _maximize_pane '#{session_name}' '#D'"
9595+9696+# pane resizing
9797+bind -r H resize-pane -L 2
9898+bind -r J resize-pane -D 2
9999+bind -r K resize-pane -U 2
100100+bind -r L resize-pane -R 2
101101+102102+# window navigation
103103+unbind n
104104+unbind p
105105+bind -r C-h previous-window # select previous window
106106+bind -r C-l next-window # select next window
107107+bind -r C-S-H swap-window -t -1 \; select-window -t -1 # swap current window with the previous one
108108+bind -r C-S-L swap-window -t +1 \; select-window -t +1 # swap current window with the next one
109109+bind Tab last-window # move to last active window
110110+111111+# toggle mouse
112112+bind m run "cut -c3- '#{TMUX_CONF}' | sh -s _toggle_mouse"
113113+114114+115115+# -- facebook pathpicker -------------------------------------------------------
116116+117117+bind F run "cut -c3- '#{TMUX_CONF}' | sh -s _fpp '#{pane_id}' '#{pane_current_path}'"
118118+119119+120120+# -- copy mode -----------------------------------------------------------------
121121+122122+bind Enter copy-mode # enter copy mode
123123+124124+bind -T copy-mode-vi v send -X begin-selection
125125+bind -T copy-mode-vi C-v send -X rectangle-toggle
126126+bind -T copy-mode-vi y send -X copy-selection-and-cancel
127127+bind -T copy-mode-vi Escape send -X cancel
128128+bind -T copy-mode-vi H send -X start-of-line
129129+bind -T copy-mode-vi L send -X end-of-line
130130+131131+# copy to X11 clipboard
132132+if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} save-buffer - | xsel -i -b"'
133133+if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
134134+# copy to Wayland clipboard
135135+if -b '[ "$XDG_SESSION_TYPE" = "wayland" ] && command -v wl-copy > /dev/null 2>&1' 'bind y run -b "\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} save-buffer - | wl-copy"'
136136+# copy to macOS clipboard
137137+if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} save-buffer - | pbcopy"'
138138+# copy to Windows clipboard
139139+if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} save-buffer - | clip.exe"'
140140+if -b '[ -c /dev/clipboard ]' 'bind y run -b "\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} save-buffer - > /dev/clipboard"'
141141+142142+143143+# -- buffers -------------------------------------------------------------------
144144+145145+bind b list-buffers # list paste buffers
146146+bind p paste-buffer -p # paste from the top paste buffer
147147+bind P choose-buffer # choose which buffer to paste from
148148+149149+150150+# -- 8< ------------------------------------------------------------------------
151151+152152+%if #{==:#{TMUX_PROGRAM},}
153153+ run "exec sh -c 'TMUX_PROGRAM=\"\$(LSOF=\$(PATH=\"\$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\" command -v lsof); \$LSOF -b -w -a -d txt -p #{pid} -Fn 2>/dev/null | perl -n -e \"if (s/^n((?:.(?!dylib\$|so\$))+)\$/\\1/g && s/(?:\s+\\([^\\s]+?\\))?\$//g) { print; exit } } exit 1; {\" 2>/dev/null || readlink \"/proc/#{pid}/exe\" 2>/dev/null)\"; [ \"\$(\"\$TMUX_PROGRAM\" display -p \"#{l:#{pid}}\" 2>/dev/null)\" = \"#{pid}\" ] || TMUX_PROGRAM=\"\$(command -v tmux || printf tmux)\"; \"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_PROGRAM \"\$TMUX_PROGRAM\"'"
154154+%endif
155155+%if #{==:#{TMUX_SOCKET},}
156156+ run "exec sh -c '\"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_SOCKET \"#{socket_path}\"'"
157157+%endif
158158+%if #{==:#{TMUX_CONF},}
159159+ run "exec sh -c '\"\$TMUX_PROGRAM\" set-environment -g TMUX_CONF \$(for conf in \"\$HOME/.tmux.conf\" \"\$XDG_CONFIG_HOME/tmux/tmux.conf\" \"\$HOME/.config/tmux/tmux.conf\"; do [ -f \"\$conf\" ] && printf \"%s\" \"\$conf\" && break; done)'"
160160+%endif
161161+%if #{==:#{TMUX_CONF_LOCAL},}
162162+ run "exec sh -c '\"\$TMUX_PROGRAM\" set-environment -g TMUX_CONF_LOCAL \"\$TMUX_CONF.local\"'"
163163+%endif
164164+165165+run '"$TMUX_PROGRAM" -S #{socket_path} source "$TMUX_CONF_LOCAL"'
166166+run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
167167+168168+# EOF
169169+#
170170+# # exit the script if any statement returns a non-true return value
171171+# set -e
172172+#
173173+# unset SHELL
174174+#
175175+# unset GREP_OPTIONS
176176+# export LC_NUMERIC=C
177177+# # shellcheck disable=SC3041
178178+# if (set +H 2>/dev/null); then
179179+# set +H
180180+# fi
181181+#
182182+# if ! printf '' | sed -E 's///' 2>/dev/null; then
183183+# if printf '' | sed -r 's///' 2>/dev/null; then
184184+# sed() {
185185+# n=$#; while [ "$n" -gt 0 ]; do arg=$1; shift; case $arg in -E*) arg=-r${arg#-E};; esac; set -- "$@" "$arg"; n=$(( n - 1 )); done
186186+# command sed "$@"
187187+# }
188188+# fi
189189+# fi
190190+#
191191+# _uname_s=$(uname -s)
192192+#
193193+# [ -z "$TMUX" ] && exit 255
194194+# if [ -z "$TMUX_SOCKET" ]; then
195195+# TMUX_SOCKET=$(printf '%s' "$TMUX" | cut -d, -f1)
196196+# fi
197197+# if [ -z "$TMUX_PROGRAM" ]; then
198198+# TMUX_PID=$(printf '%s' "$TMUX" | cut -d, -f2)
199199+# TMUX_PROGRAM=$(lsof -b -w -a -d txt -p "$TMUX_PID" -Fn 2>/dev/null | perl -n -e "if (s/^n((?:.(?!dylib$|so$))+)$/\1/g) { print; exit } } exit 1; {" 2>/dev/null || readlink "/proc/$TMUX_PID/exe" 2>/dev/null)
200200+# [ "$("$TMUX_PROGRAM" -S "$TMUX_SOCKET" display -p '#{pid}' 2>/dev/null)" = "$TMUX_PID" ] || TMUX_PROGRAM=$(command -v tmux || printf tmux)
201201+# fi
202202+# if [ "$TMUX_PROGRAM" = "tmux" ]; then
203203+# tmux() {
204204+# command tmux ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} "$@"
205205+# }
206206+# else
207207+# tmux() {
208208+# "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} "$@"
209209+# }
210210+# fi
211211+#
212212+# _tmux_version=$(tmux -V | perl -n -e '($l, $r) = $_ =~ /^[^0-9]+([0-9.]+)([a-z])?(-rc.*)?$/; print $l * 1000 + ($r eq "" ? 0 : ord($r) - 96)')
213213+#
214214+# _is_true() {
215215+# case "$1" in
216216+# true|yes|1)
217217+# return 0
218218+# ;;
219219+# *)
220220+# return 1
221221+# ;;
222222+# esac
223223+# }
224224+#
225225+# _is_enabled() {
226226+# [ "$1" = "enabled" ]
227227+# }
228228+#
229229+# _is_disabled() {
230230+# [ "$1" = "disabled" ]
231231+# }
232232+#
233233+# _circled() {
234234+# circled_digits='⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳'
235235+# if [ "$1" -le 20 ] 2>/dev/null; then
236236+# i=$(( $1 + 1 ))
237237+# eval set -- "$circled_digits"
238238+# eval echo "\${$i}"
239239+# else
240240+# echo "$1"
241241+# fi
242242+# }
243243+#
244244+# _decode_unicode_escapes() {
245245+# printf '%s' "$*" | perl -CS -pe 's/(\\u([0-9A-Fa-f]{1,4})|\\U([0-9A-Fa-f]{1,8}))/chr(hex($2.$3))/eg' 2>/dev/null
246246+# }
247247+#
248248+# _pretty_path() {
249249+# max_length=${1:-auto}; shift
250250+# if [ "$max_length" = "auto" ]; then
251251+# max_length=$(($(tmux -q display -p '#{client_width}') / 4))
252252+# fi
253253+# { cd "$*" && pwd || printf '%s' "$*"; } | perl -s -p -E '
254254+# s|^$HOME|~|;
255255+# /^.{0,$max_length}$/ || s|(~?/[^/]+)(/[^/]+)(?:/.+)?(/[^/]+)$|$1$2/...$3|g;
256256+# /^.{0,$max_length}$/ || s|(~?/[^/]+)(/[^/]+)(?:/.+)(/[^/]+)$|$1/...$3|g;' -- -HOME="$HOME" -max_length="$max_length"
257257+# }
258258+#
259259+# if command -v pkill > /dev/null 2>&1; then
260260+# _pkillf() {
261261+# pkill -f "$@" || true
262262+# }
263263+# else
264264+# case "$_uname_s" in
265265+# *CYGWIN*)
266266+# _pkillf() {
267267+# while IFS= read -r pid; do
268268+# kill "$pid" || true
269269+# done << EOF
270270+# $(grep -Eao "$@" /proc/*/cmdline | xargs -0 | sed -E -n 's,/proc/([0-9]+)/.+$,\1,pg')
271271+# EOF
272272+# }
273273+# ;;
274274+# *)
275275+# # shellcheck disable=SC2009
276276+# _pkillf() {
277277+# while IFS= read -r pid; do
278278+# kill "$pid" || true
279279+# done << EOF
280280+# $(ps -x -o pid= -o command= | grep -E "$@" | cut -d' ' -f1)
281281+# EOF
282282+# }
283283+# ;;
284284+# esac
285285+# fi
286286+#
287287+# if perl -MTime::HiRes -e1; then
288288+# _timestamp() {
289289+# while IFS= read -r line; do
290290+# printf '\t%s\n' "$line" | perl -MPOSIX=strftime -MTime::HiRes=gettimeofday -pe '($s, $us) = gettimeofday(); printf ("[%s.%03d]", strftime("%Y-%m-%d %H:%M:%S", localtime $s), $us / 1000)'
291291+# done
292292+# }
293293+# else
294294+# case "$_uname_s" in
295295+# Darwin)
296296+# _timestamp() {
297297+# while IFS= read -r line; do
298298+# printf '[%s]\t%s\n' "$(date +"%Y-%m-%d %H:%M:%S.000")" "$line"
299299+# done
300300+# }
301301+# ;;
302302+# *)
303303+# _timestamp() {
304304+# while IFS= read -r line; do
305305+# printf '[%s]\t%s\n' "$(date +"%Y-%m-%d %H:%M:%S.%3N")" "$line"
306306+# done
307307+# }
308308+# ;;
309309+# esac
310310+# fi
311311+#
312312+# _bar() {
313313+# bar_palette=$(printf '%s' "$1" | tr ';' ',')
314314+# bar_symbol_empty=$2
315315+# bar_symbol_full=$3
316316+# bar_length=$4 # "auto" or number of columns
317317+# bar_value=$5 # value between 0 and 1
318318+#
319319+# if [ "$bar_length" = "auto" ]; then
320320+# columns=${6:-$(tmux -q display -p '#{client_width}' 2> /dev/null || echo 80)}
321321+# if [ "$columns" -ge 160 ]; then
322322+# bar_length=12
323323+# elif [ "$columns" -ge 130 ]; then
324324+# bar_length=10
325325+# elif [ "$columns" -ge 120 ]; then
326326+# bar_length=8
327327+# elif [ "$columns" -ge 100 ]; then
328328+# bar_length=6
329329+# else
330330+# bar_length=4
331331+# fi
332332+# fi
333333+#
334334+# if printf '%s' "$bar_palette" | grep -q -E '^(heat|gradient|gradient\((\s*[#a-zA-Z0-9]{7,9},?)+\))(\s*,\s*[#a-zA-Z0-9]{7,9})?$'; then
335335+# # shellcheck disable=SC2086
336336+# { set -f; IFS=', '; set -- $bar_palette; unset IFS; set +f; }
337337+# palette_style=$1
338338+# shift
339339+#
340340+# case "$palette_style" in
341341+# gradient)
342342+# palette="colour196 colour202 colour208 colour214 colour220 colour226 colour190 colour154 colour118 colour82 colour46"
343343+# ;;
344344+# heat)
345345+# palette="colour243 colour245 colour247 colour144 colour143 colour142 colour184 colour214 colour208 colour202 colour196"
346346+# ;;
347347+# gradient*)
348348+# palette=${palette_style##gradient(}
349349+# while [ $# -gt 0 ]; do
350350+# palette="$palette${1+ }${1%%)}"
351351+# [ "$1" != "${1%%)}" ] && break
352352+# shift
353353+# done
354354+# ;;
355355+# esac
356356+# bg=${2:-none}
357357+#
358358+# palette=$(printf '%s' "$palette" | awk -v n="$bar_length" '{ for (i = 0; i < n - 1; ++i) printf "%s ", $(1 + i * NF / n); printf $NF }')
359359+# # shellcheck disable=SC2086
360360+# set -- $palette
361361+#
362362+# full=$(awk "BEGIN { printf \"%.0f\", ($bar_value) * $bar_length }")
363363+# bar="#[bg=$bg]"
364364+# if [ "$full" -gt 0 ]; then
365365+# # shellcheck disable=SC2046
366366+# bar="$bar$(printf "#[fg=%s]$bar_symbol_full" $(printf '%s' "$palette" | cut -d' ' -f1-"$full"))"
367367+# fi
368368+# empty=$((bar_length - full))
369369+# if [ "$empty" -gt 0 ]; then
370370+# # shellcheck disable=SC2046
371371+# bar="$bar$(printf "#[fg=%s]$bar_symbol_empty" $(printf '%s' "$palette" | cut -d' ' -f$((full + 1))-$((full + empty))))"
372372+# fi
373373+# eval bar="$bar#[fg=\${$((full == 0 ? 1 : full))}]"
374374+# elif printf '%s' "$bar_palette" | grep -q -E '^(([#a-zA-Z0-9]{7,9}|none),?){3}$'; then
375375+# # shellcheck disable=SC2086
376376+# { set -f; IFS=,; set -- $bar_palette; unset IFS; set +f; }
377377+# full_fg=$1
378378+# empty_fg=$2
379379+# bg=${3:-none}
380380+#
381381+# full=$(awk "BEGIN { printf \"%.0f\", ($bar_value) * $bar_length }")
382382+# bar="#[bg=$bg]"
383383+# if [ "$full" -gt 0 ]; then
384384+# bar="$bar#[fg=$full_fg]$(printf "%0.s$bar_symbol_full" $(seq 1 "$full"))"
385385+# fi
386386+# empty=$((bar_length - full))
387387+# if [ "$empty" -gt 0 ]; then
388388+# bar="$bar#[fg=$empty_fg]$(printf "%0.s$bar_symbol_empty" $(seq 1 "$empty"))#[fg=$empty_fg]"
389389+# fi
390390+# fi
391391+#
392392+# printf '%s' "$bar"
393393+# }
394394+#
395395+# _hbar() {
396396+# hbar_palette=$(printf '%s' "$1" | tr ';' ',')
397397+# hbar_value=$2
398398+#
399399+# if printf '%s' "$hbar_palette" | grep -q -E '^(heat|gradient|gradient\((\s*[#a-zA-Z0-9]{7,9},?)+\))(\s*,\s*[#a-zA-Z0-9]{7,9})?$'; then
400400+# # shellcheck disable=SC2086
401401+# { set -f; IFS=', '; set -- $hbar_palette; unset IFS; set +f; }
402402+# palette_style=$1
403403+# shift
404404+#
405405+# case "$palette_style" in
406406+# gradient)
407407+# palette="colour196 colour202 colour208 colour214 colour220 colour226 colour190 colour154 colour118 colour82 colour46"
408408+# ;;
409409+# heat)
410410+# palette="colour243 colour245 colour247 colour144 colour143 colour142 colour184 colour214 colour208 colour202 colour196"
411411+# ;;
412412+# gradient*)
413413+# palette=${palette_style##gradient(}
414414+# while [ $# -gt 0 ]; do
415415+# palette="$palette${1+ }${1%%)}"
416416+# [ "$1" != "${1%%)}" ] && break
417417+# shift
418418+# done
419419+# ;;
420420+# esac
421421+# bg=${2:-none}
422422+#
423423+# palette=$(printf '%s' "$palette" | awk -v n=8 '{ for (i = 0; i < n - 1; ++i) printf "%s ", $(1 + i * NF / n); printf $NF }')
424424+# # shellcheck disable=SC2086
425425+# set -- $palette
426426+#
427427+# full=$(awk "BEGIN { printf \"%.0f\", ($hbar_value) * 8 }")
428428+# eval hbar_fg="\${$((full == 0 ? 1 : full))}"
429429+# elif printf '%s' "$hbar_palette" | grep -q -E '^([#a-zA-Z0-9]{7,9},?){3}$'; then
430430+# # shellcheck disable=SC2086
431431+# { set -f; IFS=,; set -- $hbar_palette; unset IFS; set +f; }
432432+#
433433+# # shellcheck disable=SC2046
434434+# eval $(awk "BEGIN { printf \"hbar_fg=$%d\", (($hbar_value) - 0.001) * $# + 1 }")
435435+# fi
436436+#
437437+# set -- ▏ ▎ ▍ ▌ ▋ ▊ ▉ █
438438+# # shellcheck disable=SC2046
439439+# eval $(awk "BEGIN { printf \"hbar_symbol=$%d\", ($hbar_value) * ($# - 1) + 1 }")
440440+# hbar="#[bg=$bg]#[fg=${hbar_fg?}]${hbar_symbol?}"
441441+#
442442+# printf '%s' "$hbar"
443443+# }
444444+#
445445+# _vbar() {
446446+# vbar_palette=$(printf '%s' "$1" | tr ';' ',')
447447+# vbar_value=$2
448448+#
449449+# if printf '%s' "$vbar_palette" | grep -q -E '^(heat|gradient|gradient\((\s*[#a-zA-Z0-9]{7,9},?)+\))(\s*,\s*[#a-zA-Z0-9]{7,9})?$'; then
450450+# # shellcheck disable=SC2086
451451+# { set -f; IFS=', '; set -- $vbar_palette; unset IFS; set +f; }
452452+# palette_style=$1
453453+# shift
454454+#
455455+# case "$palette_style" in
456456+# gradient)
457457+# palette="colour196 colour202 colour208 colour214 colour220 colour226 colour190 colour154 colour118 colour82 colour46"
458458+# ;;
459459+# heat)
460460+# palette="colour243 colour245 colour247 colour144 colour143 colour142 colour184 colour214 colour208 colour202 colour196"
461461+# ;;
462462+# gradient*)
463463+# palette=${palette_style##gradient(}
464464+# while [ $# -gt 0 ]; do
465465+# palette="$palette${1+ }${1%%)}"
466466+# [ "$1" != "${1%%)}" ] && break
467467+# shift
468468+# done
469469+# ;;
470470+# esac
471471+# bg=${2:-none}
472472+#
473473+# palette=$(printf '%s' "$palette" | awk -v n=8 '{ for (i = 0; i < n - 1; ++i) printf "%s ", $(1 + i * NF / n); printf $NF }')
474474+# # shellcheck disable=SC2086
475475+# set -- $palette
476476+#
477477+# full=$(awk "BEGIN { printf \"%.0f\", ($vbar_value) * 8 }")
478478+# eval vbar_fg="\${$((full == 0 ? 1 : full))}"
479479+# elif printf '%s' "$vbar_palette" | grep -q -E '^([#a-zA-Z0-9]{7,9},?){3}$'; then
480480+# # shellcheck disable=SC2086
481481+# { set -f; IFS=,; set -- $vbar_palette; unset IFS; set +f; }
482482+#
483483+# # shellcheck disable=SC2046
484484+# eval $(awk "BEGIN { printf \"vbar_fg=$%d\", (($vbar_value) - 0.001) * $# + 1 }")
485485+# fi
486486+#
487487+# set -- ▁ ▂ ▃ ▄ ▅ ▆ ▇ █
488488+# # shellcheck disable=SC2046
489489+# eval $(awk "BEGIN { printf \"vbar_symbol=$%d\", ($vbar_value) * ($# - 1) + 1 }")
490490+# vbar="#[bg=$bg]#[fg=${vbar_fg?}]${vbar_symbol?}"
491491+#
492492+# printf '%s' "$vbar"
493493+# }
494494+#
495495+# _maximize_pane() {
496496+# current_session=${1:-$(tmux display -p '#{session_name}')}
497497+# current_pane=${2:-$(tmux display -p '#{pane_id}')}
498498+#
499499+# dead_panes=$(tmux list-panes -s -t "$current_session" -F '#{pane_dead} #{pane_id} #{pane_start_command}' | grep -E -o '^1 %.+maximized.+$' || true)
500500+# restore=$(printf "%s" "$dead_panes" | sed -n -E -e "s/^1 $current_pane .+maximized.+'(%[0-9]+)'\"?$/tmux swap-pane -s \1 -t $current_pane \; kill-pane -t $current_pane/p"\
501501+# -e "s/^1 (%[0-9]+) .+maximized.+'$current_pane'\"?$/tmux swap-pane -s \1 -t $current_pane \; kill-pane -t \1/p")
502502+#
503503+# if [ -z "$restore" ]; then
504504+# [ "$(tmux list-panes -t "$current_session:" | wc -l | sed 's/^ *//g')" -eq 1 ] && tmux display "Can't maximize with only one pane" && return
505505+# info=$(tmux new-window -t "$current_session:" -F "#{session_name}:#{window_index}.#{pane_id}" -P "maximized... 2>/dev/null & \"$TMUX_PROGRAM\" ${TMUX_SOCKET:+-S \"$TMUX_SOCKET\"} setw -t \"$current_session:\" remain-on-exit on; printf \"\\033[\$(tput lines);0fPane has been maximized, press <prefix>+ to restore\n\" '$current_pane'")
506506+# session_window=${info%.*}
507507+# new_pane=${info#*.}
508508+#
509509+# retry=20
510510+# while [ "$("$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} list-panes -t "$session_window" -F '#{session_name}:#{window_index}.#{pane_id} #{pane_dead}' 2>/dev/null)" != "$info 1" ] && [ "$retry" -ne 0 ]; do
511511+# sleep 0.1
512512+# retry=$((retry - 1))
513513+# done
514514+# if [ "$retry" -eq 0 ]; then
515515+# tmux display 'Unable to maximize pane'
516516+# fi
517517+#
518518+# tmux setw -t "$session_window" remain-on-exit off \; swap-pane -s "$current_pane" -t "$new_pane"
519519+# else
520520+# $restore || tmux kill-pane
521521+# fi
522522+# }
523523+#
524524+# _toggle_mouse() {
525525+# old=$(tmux show -gv mouse)
526526+# new=""
527527+#
528528+# if [ "$old" = "on" ]; then
529529+# new="off"
530530+# else
531531+# new="on"
532532+# fi
533533+#
534534+# tmux set -g mouse $new
535535+# }
536536+#
537537+# _battery_info() {
538538+# battery_count=0
539539+# battery_charge=0
540540+# case "$_uname_s" in
541541+# *Darwin*)
542542+# while IFS= read -r line; do
543543+# [ -z "$line" ] && continue
544544+# percentage=$(printf '%s' "$line" | grep -E -o '[0-9]+%' || echo "0%")
545545+# battery_charge=$(awk -v charge="$battery_charge" -v percentage="${percentage%%%}" 'BEGIN { print charge + percentage / 100 }')
546546+# battery_count=$((battery_count + 1))
547547+# done << EOF
548548+# $(pmset -g batt | grep 'InternalBattery')
549549+# EOF
550550+# ;;
551551+# *Linux*)
552552+# while IFS= read -r batpath; do
553553+# [ -z "$batpath" ] && continue
554554+# grep -i -q device "$batpath/scope" 2> /dev/null && continue
555555+#
556556+# bat_capacity="$batpath/capacity"
557557+# if [ -r "$bat_capacity" ]; then
558558+# battery_charge=$(awk -v charge="$battery_charge" -v capacity="$(cat "$bat_capacity")" 'BEGIN { print charge + (capacity > 100 ? 100 : capacity) / 100 }')
559559+# else
560560+# bat_energy_full="$batpath/energy_full"
561561+# bat_energy_now="$batpath/energy_now"
562562+# if [ -r "$bat_energy_full" ] && [ -r "$bat_energy_now" ]; then
563563+# battery_charge=$(awk -v charge="$battery_charge" -v energy_now="$(cat "$bat_energy_now")" -v energy_full="$(cat "$bat_energy_full")" 'BEGIN { print charge + energy_now / energy_full }')
564564+# fi
565565+# fi
566566+# battery_count=$((battery_count + 1))
567567+# done << EOF
568568+# $(find /sys/class/power_supply -maxdepth 1 -iname '*bat*')
569569+# EOF
570570+# ;;
571571+# *CYGWIN*|*MSYS*|*MINGW*)
572572+# while IFS= read -r line; do
573573+# [ -z "$line" ] && continue
574574+# battery_charge=$(printf '%s' "$line" | awk -v charge="$battery_charge" '{ print charge + $2 / 100 }')
575575+# battery_count=$((battery_count + 1))
576576+# done << EOF
577577+# $(wmic path Win32_Battery get BatteryStatus, EstimatedChargeRemaining 2> /dev/null | tr -d '\r' | tail -n +2 || true)
578578+# EOF
579579+# ;;
580580+# *OpenBSD*)
581581+# for batid in 0 1 2; do
582582+# sysctl -n "hw.sensors.acpibat$batid.raw0" 2>&1 | grep -q 'not found' && continue
583583+# if sysctl -n "hw.sensors.acpibat$batid" | grep -q amphour; then
584584+# battery_charge=$(awk -v charge="$battery_charge" -v remaining="$(sysctl -n hw.sensors.acpibat$batid.amphour3 | cut -d' ' -f1)" -v full="$(sysctl -n hw.sensors.acpibat$batid.amphour0 | cut -d' ' -f1)" 'BEGIN { print charge + remaining / full }')
585585+# else
586586+# battery_charge=$(awk -v charge="$battery_charge" -v remaining="$(sysctl -n hw.sensors.acpibat$batid.watthour3 | cut -d' ' -f1)" -v full="$(sysctl -n hw.sensors.acpibat$batid.watthour0 | cut -d' ' -f1)" 'BEGIN { print charge + remaining / full }')
587587+# fi
588588+# battery_count=$((battery_count + 1))
589589+# done
590590+# ;;
591591+# *FreeBSD*)
592592+# battery_charge=$(awk -v charge="$(sysctl -n 'hw.acpi.battery.life')" 'BEGIN { print charge / 100 }')
593593+# battery_count=1
594594+# ;;
595595+# esac
596596+# if [ "$battery_count" -ne 0 ]; then
597597+# battery_charge=$(awk -v charge="$battery_charge" -v count="$battery_count" 'BEGIN { print charge / count }')
598598+# fi
599599+#
600600+# if [ "$battery_charge" = 0 ]; then
601601+# tmux set -ug '@battery_percentage' \;\
602602+# set -ug '@battery_charge'
603603+# else
604604+# battery_percentage="$(awk "BEGIN { printf \"%.0f%%\", ($battery_charge) * 100 }")"
605605+#
606606+# tmux set -g '@battery_percentage' "$battery_percentage" \;\
607607+# set -g '@battery_charge' "$battery_charge"
608608+# fi
609609+# }
610610+#
611611+# _battery_status() {
612612+# battery_status_charging=$1
613613+# battery_status_discharging=$2
614614+#
615615+# case "$_uname_s" in
616616+# *Darwin*)
617617+# while IFS= read -r line; do
618618+# [ -z "$line" ] && continue
619619+# battery_discharging=$(printf '%s' "$line" | grep -qi "discharging" && echo "true" || echo "false")
620620+# done << EOF
621621+# $(pmset -g batt | grep 'InternalBattery')
622622+# EOF
623623+# ;;
624624+# *Linux*)
625625+# while IFS= read -r batpath; do
626626+# [ -z "$batpath" ] && continue
627627+# grep -i -q device "$batpath/scope" 2> /dev/null && continue
628628+#
629629+# battery_discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false")
630630+# done << EOF
631631+# $(find /sys/class/power_supply -maxdepth 1 -iname '*bat*')
632632+# EOF
633633+# ;;
634634+# *CYGWIN*|*MSYS*|*MINGW*)
635635+# while IFS= read -r line; do
636636+# [ -z "$line" ] && continue
637637+# battery_discharging=$(printf '%s' "$line" | awk '{ s = ($1 == 1) ? "true" : "false"; print s }')
638638+# done << EOF
639639+# $(wmic path Win32_Battery get BatteryStatus, EstimatedChargeRemaining 2> /dev/null | tr -d '\r' | tail -n +2 || true)
640640+# EOF
641641+# ;;
642642+# *OpenBSD*)
643643+# for batid in 0 1 2; do
644644+# battery_discharging=$(sysctl -n "hw.sensors.acpibat$batid.raw0" | grep -q 1 && echo "true" || echo "false")
645645+# done
646646+# ;;
647647+# *FreeBSD*)
648648+# battery_discharging=$(sysctl -n 'hw.acpi.battery.state' | grep -q 1 && echo "true" || echo "false")
649649+# ;;
650650+# esac
651651+#
652652+# if [ -z "$battery_discharging" ]; then
653653+# tmux set -ug '@battery_status'
654654+# return
655655+# fi
656656+#
657657+# if [ "$battery_discharging" = "true" ]; then
658658+# battery_status="$battery_status_discharging"
659659+# else
660660+# battery_status="$battery_status_charging"
661661+# fi
662662+#
663663+# tmux set -g '@battery_status' "$battery_status" >/dev/null 2>/dev/null
664664+# }
665665+#
666666+# _pane_info() {
667667+# pane_pid="$1"
668668+# pane_tty="${2##/dev/}"
669669+# case "$_uname_s" in
670670+# *CYGWIN*)
671671+# ps -al | tail -n +2 | awk -v pane_pid="$pane_pid" -v tty="$pane_tty" -v ssh="$(command -v ssh)" '
672672+# ((/ssh/ && !/-W/ && !/tsh proxy ssh/ && !/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ && $5 == tty {
673673+# user[$1] = $6; if (!child[$2]) child[$2] = $1
674674+# }
675675+# END {
676676+# pid = pane_pid
677677+# while (child[pid]) {
678678+# if (match(command[pid], "^" ssh " |^ssh ")) {
679679+# break
680680+# }
681681+# pid = child[pid]
682682+# }
683683+#
684684+# file = "/proc/" pid "/cmdline"; getline command < file; close(file)
685685+# gsub(/\0/, " ", command)
686686+# "id -un " user[pid] | getline username
687687+# print pid":"username":"command
688688+# }
689689+# '
690690+# ;;
691691+# *Linux*)
692692+# ps -t "$pane_tty" --sort=lstart -o user=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -o pid= -o ppid= -o command= | awk -v pane_pid="$pane_pid" -v ssh="$(command -v ssh)" '
693693+# ((/ssh/ && !/-W/ && !/tsh proxy ssh/ && !/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ {
694694+# user[$2] = $1; if (!child[$3]) child[$3] = $2; pid=$2; $1 = $2 = $3 = ""; command[pid] = substr($0,4)
695695+# }
696696+# END {
697697+# pid = pane_pid
698698+# while (child[pid]) {
699699+# if (match(command[pid], "^" ssh " |^ssh ")) {
700700+# break
701701+# }
702702+# pid = child[pid]
703703+# }
704704+#
705705+# print pid":"user[pid]":"command[pid]
706706+# }
707707+# '
708708+# ;;
709709+# *)
710710+# ps -t "/dev/$pane_tty" -o user=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -o pid= -o ppid= -o command= | awk -v pane_pid="$pane_pid" -v ssh="$(command -v ssh)" '
711711+# ((/ssh/ && !/-W/ && !/tsh proxy ssh/ && !/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ {
712712+# user[$2] = $1; if (!child[$3]) child[$3] = $2; pid=$2; $1 = $2 = $3 = ""; command[pid] = substr($0,4)
713713+# }
714714+# END {
715715+# pid = pane_pid
716716+# while (child[pid]) {
717717+# if (match(command[pid], "^" ssh " |^ssh ")) {
718718+# break
719719+# }
720720+# pid = child[pid]
721721+# }
722722+#
723723+# print pid":"user[pid]":"command[pid]
724724+# }
725725+# '
726726+# ;;
727727+# esac
728728+# }
729729+#
730730+# _ssh_or_mosh_args() {
731731+# case "$1" in
732732+# *ssh*)
733733+# args=$(printf '%s' "$1" | perl -n -e 'print if s/.*?\bssh[\w_-]*\s*(.*)/\1/')
734734+# ;;
735735+# *mosh-client*)
736736+# args=$(printf '%s' "$1" | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/' -e 's/-[^ ]*//g' -e 's/\d:\d//g')
737737+# ;;
738738+# esac
739739+#
740740+# printf '%s' "$args"
741741+# }
742742+#
743743+# _username() {
744744+# pane_pid=${1:-$(tmux display -p '#{pane_pid}')}
745745+# pane_tty=${2:-$(tmux display -p '#{b:pane_tty}')}
746746+# ssh_only=$3
747747+#
748748+# pane_info=$(_pane_info "$pane_pid" "$pane_tty")
749749+# command=${pane_info#*:}
750750+# command=${command#*:}
751751+#
752752+# ssh_or_mosh_args=$(_ssh_or_mosh_args "$command")
753753+# if [ -n "$ssh_or_mosh_args" ]; then
754754+# # shellcheck disable=SC2086
755755+# username=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk '/^user / { print $2; exit }')
756756+# # shellcheck disable=SC2086
757757+# [ -z "$username" ] && username=$(ssh $ssh_or_mosh_args -T -o ControlPath=none -o ProxyCommand="sh -c 'echo %%username%% %r >&2'" 2>&1 | awk '/^%username% / { print $2; exit }')
758758+# # shellcheck disable=SC2086
759759+# [ -z "$username" ] && username=$(ssh $ssh_or_mosh_args -v -T -o ControlPath=none -o ProxyCommand=false -o IdentityFile='%%username%%/%r' 2>&1 | awk '/%username%/ { print substr($4,12); exit }')
760760+# else
761761+# if ! _is_true "$ssh_only"; then
762762+# username=${pane_info#*:}
763763+# username=${username%%:*}
764764+# fi
765765+# fi
766766+#
767767+# printf '%s\n' "$username"
768768+# }
769769+#
770770+# _hostname() {
771771+# pane_pid=${1:-$(tmux display -p '#{pane_pid}')}
772772+# pane_tty=${2:-$(tmux display -p '#{b:pane_tty}')}
773773+# ssh_only=$3
774774+# full=$4
775775+# h_or_H=$5
776776+#
777777+# pane_info=$(_pane_info "$pane_pid" "$pane_tty")
778778+# command=${pane_info#*:}
779779+# command=${command#*:}
780780+#
781781+# ssh_or_mosh_args=$(_ssh_or_mosh_args "$command")
782782+# if [ -n "$ssh_or_mosh_args" ]; then
783783+# # shellcheck disable=SC2086
784784+# hostname=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk '/^hostname / { print $2; exit }')
785785+# # shellcheck disable=SC2086
786786+# [ -z "$hostname" ] && hostname=$(ssh -T -o ControlPath=none -o ProxyCommand="sh -c 'echo %%hostname%% %h >&2'" $ssh_or_mosh_args 2>&1 | awk '/^%hostname% / { print $2; exit }')
787787+#
788788+# if ! _is_true "$full"; then
789789+# case "$hostname" in
790790+# *[a-z-].*)
791791+# hostname=${hostname%%.*}
792792+# ;;
793793+# 127.0.0.1)
794794+# hostname="localhost"
795795+# ;;
796796+# esac
797797+# fi
798798+# else
799799+# if ! _is_true "$ssh_only"; then
800800+# hostname="$h_or_H"
801801+# fi
802802+# fi
803803+#
804804+# printf '%s\n' "$hostname"
805805+# }
806806+#
807807+# _uptime() {
808808+# case "$_uname_s" in
809809+# *Darwin*|*FreeBSD*)
810810+# boot=$(sysctl -n kern.boottime 2>/dev/null | awk -F'[ ,:]+' '{ print $4 }')
811811+# now=$(date +%s)
812812+# ;;
813813+# *Linux*|*CYGWIN*|*MSYS*|*MINGW*)
814814+# boot=0
815815+# now=$(cut -d' ' -f1 < /proc/uptime)
816816+# ;;
817817+# *OpenBSD*)
818818+# boot=$(sysctl -n kern.boottime)
819819+# now=$(date +%s)
820820+# esac
821821+# # shellcheck disable=SC1004
822822+# awk -v tmux="$TMUX_PROGRAM ${TMUX_SOCKET:+-S "$TMUX_SOCKET"}" -v boot="$boot" -v now="$now" '
823823+# BEGIN {
824824+# uptime = now - boot
825825+# y = int(uptime / 31536000)
826826+# dy = int(uptime / 86400) % 365
827827+# d = int(uptime / 86400)
828828+# h = int(uptime / 3600) % 24
829829+# m = int(uptime / 60) % 60
830830+# s = int(uptime) % 60
831831+#
832832+# system(tmux " set -g @uptime_y " y + 0 " \\;" \
833833+# " set -g @uptime_dy " dy + 0 " \\;" \
834834+# " set -g @uptime_d " d + 0 " \\;" \
835835+# " set -g @uptime_h " h + 0 " \\;" \
836836+# " set -g @uptime_m " m + 0 " \\;" \
837837+# " set -g @uptime_s " s + 0)
838838+# }'
839839+# }
840840+#
841841+# _loadavg() {
842842+# case "$_uname_s" in
843843+# *Darwin*|*FreeBSD*)
844844+# tmux set -g @loadavg "$(sysctl -n vm.loadavg 2>/dev/null | cut -d' ' -f2)"
845845+# ;;
846846+# *Linux*|*CYGWIN*)
847847+# tmux set -g @loadavg "$(cut -d' ' -f1 < /proc/loadavg)"
848848+# ;;
849849+# *OpenBSD*)
850850+# tmux set -g @loadavg "$(sysctl -n vm.loadavg 2>/dev/null | cut -d' ' -f1)"
851851+# ;;
852852+# esac
853853+# }
854854+#
855855+# _new_window_ssh() {
856856+# pane_pid=${1:-$(tmux display -p '#{pane_pid}')}
857857+# pane_tty=${2:-$(tmux display -p '#{b:pane_tty}')}
858858+# shift 2
859859+#
860860+# pane_info=$(_pane_info "$pane_pid" "$pane_tty")
861861+# command=${pane_info#*:}
862862+# command=${command#*:}
863863+#
864864+# case "$command" in
865865+# *mosh-client*)
866866+# # shellcheck disable=SC2046
867867+# tmux new-window "$@" mosh $(echo "$command" | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/')
868868+# ;;
869869+# *ssh*)
870870+# # shellcheck disable=SC2046
871871+# tmux new-window "$@" $(echo "$command" | sed -e 's/;/\\;/g')
872872+# ;;
873873+# *)
874874+# tmux new-window "$@"
875875+# esac
876876+# }
877877+#
878878+# _new_window() {
879879+# _new_window_ssh "$@"
880880+# }
881881+#
882882+# _split_window_ssh() {
883883+# pane_pid=${1:-$(tmux display -p '#{pane_pid}')}
884884+# pane_tty=${2:-$(tmux display -p '#{b:pane_tty}')}
885885+# shift 2
886886+#
887887+# pane_info=$(_pane_info "$pane_pid" "$pane_tty")
888888+# command=${pane_info#*:}
889889+# command=${command#*:}
890890+#
891891+# case "$command" in
892892+# *mosh-client*)
893893+# # shellcheck disable=SC2046
894894+# tmux split-window "$@" mosh $(echo "$command" | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/')
895895+# ;;
896896+# *ssh*)
897897+# # shellcheck disable=SC2046
898898+# tmux split-window "$@" $(echo "$command" | sed -e 's/;/\\;/g')
899899+# ;;
900900+# *)
901901+# tmux split-window "$@"
902902+# esac
903903+# }
904904+#
905905+# _split_window() {
906906+# _split_window_ssh "$@"
907907+# }
908908+#
909909+# _apply_tmux_256color() {
910910+# case "$(tmux show -gv default-terminal)" in
911911+# tmux-256color|tmux-direct)
912912+# return
913913+# ;;
914914+# esac
915915+#
916916+# # when tmux-256color is available, use it
917917+# # on macOS though, make sure to use /usr/bin/infocmp to probe if it's availalbe system wide
918918+# case "$_uname_s" in
919919+# *Darwin*)
920920+# if /usr/bin/infocmp -x tmux-256color > /dev/null 2>&1; then
921921+# tmux set -g default-terminal 'tmux-256color'
922922+# fi
923923+# ;;
924924+# *)
925925+# if command infocmp -x tmux-256color > /dev/null 2>&1; then
926926+# tmux set -g default-terminal 'tmux-256color'
927927+# fi
928928+# ;;
929929+# esac
930930+# }
931931+#
932932+# _apply_24b() {
933933+# tmux_conf_theme_24b_colour=${tmux_conf_theme_24b_colour:-auto}
934934+# tmux_conf_24b_colour=${tmux_conf_24b_colour:-$tmux_conf_theme_24b_colour}
935935+# if [ "$tmux_conf_24b_colour" = "auto" ]; then
936936+# case "$COLORTERM" in
937937+# truecolor|24bit)
938938+# apply_24b=true
939939+# ;;
940940+# esac
941941+# if [ "$apply_24b" = "" ] && [ "$(tput colors)" = "16777216" ]; then
942942+# apply_24b=true
943943+# fi
944944+# elif _is_true "$tmux_conf_24b_colour"; then
945945+# apply_24b=true
946946+# fi
947947+# if [ "$apply_24b" = "true" ]; then
948948+# case "$TERM" in
949949+# screen-*|tmux-*)
950950+# ;;
951951+# *)
952952+# tmux set-option -ga terminal-overrides ",*256col*:Tc"
953953+# ;;
954954+# esac
955955+# fi
956956+# }
957957+#
958958+# _apply_bindings() {
959959+# cfg=$(mktemp) && trap 'rm -f $cfg*' EXIT
960960+#
961961+# tmux_conf_preserve_stock_bindings=${tmux_conf_preserve_stock_bindings:-false}
962962+# tmux list-keys | grep -vF 'TMUX_CONF_LOCAL' | grep -E 'new-window|split(-|_)window|new-session|copy-selection|copy-pipe' > "$cfg"
963963+# if _is_true "$tmux_conf_preserve_stock_bindings"; then
964964+# probe_socket="$(dirname "$TMUX_SOCKET")/tmux-stock-bindings-$$"
965965+# TMUX_SOCKET="$probe_socket" tmux -f /dev/null list-keys >> "$cfg"
966966+# rm -f "$probe_socket"
967967+# fi
968968+#
969969+# # tmux 3.0 doesn't include 02254d1e5c881be95fd2fc37b4c4209640b6b266 and the
970970+# # output of list-keys can be truncated
971971+# perl -p -i -e "s/'#\{\?window_zoomed_flag,Unzoom,Zoom\}' 'z' \{resize-pane -$/'#{?window_zoomed_flag,Unzoom,Zoom}' 'z' {resize-pane -Z}\"/g" "$cfg"
972972+#
973973+# tmux_conf_new_window_retain_current_path=${tmux_conf_new_window_retain_current_path:-true}
974974+# if ! _is_disabled "$tmux_conf_new_window_retain_current_path"; then
975975+# perl -p -i -e "
976976+# s/\brun-shell\b\s+(\"|')cut\s+-c3-\s+(.+?)\s+\|\s+sh\s+-s\s+_new_window\s+#\{pane_pid\}\s+#\{b:pane_tty\}([^\n\1]*?)(?:\s+-c\s+((?:\\\\{1,3}\")?|\"?|'?)#\{pane_current_path\}\4)([^\n\1]*?)\1/run-shell \1cut -c3- \2 | sh -s _new_window #\{pane_pid\} #\{b:pane_tty\}\3\5\1/g
977977+# ;
978978+# s/\brun-shell\b\s+(\"|')cut\s+-c3-\s+.+?\s+\|\s+sh\s+-s\s+_new_window\s+#\{pane_pid\}\s+#\{b:pane_tty\}(\s+.+?)?\1/new-window\2/g
979979+# ;
980980+# s/\bnew-window\b([^;}\n]*?)(?:\s+-c\s+((?:\\\\\")?|\"?|'?)#\{pane_current_path\}\2)/new-window\1/g" \
981981+# "$cfg"
982982+# fi
983983+#
984984+# perl -p -i -e "
985985+# s,\bnew-window\b((?:(?:[ \t]+-[bdfhIvP])|(?:[ \t]+-[celtF][ \t]+(?!\bssh\b)[^\s]+))*)?(?:\s+(\bssh\b))((?:(?:[ \t]+-[bdfhIvP])|(?:[ \t]+-[celtF][ \t]+(?!\bssh\b)[^\s]+))*)?,run-shell 'cut -c3- \"$TMUX_CONF\" | sh -s _new_window_ssh #\{pane_pid\} #\{b:pane_tty\}\1',g if /\bnew-window\b((?:(?:[ \t]+-[bdfhIvP])|(?:[ \t]+-[celtF][ \t]+(?!ssh)[^\s]+))*)?(?:\s+(ssh))((?:(?:[ \t]+-[bdfhIvP])|(?:[ \t]+-[celtF][ \t]+(?!ssh)[^\s]+))*)?/"\
986986+# "$cfg"
987987+#
988988+# tmux_conf_new_window_reconnect_ssh=${tmux_conf_new_window_reconnect_ssh:-false}
989989+# if ! _is_disabled "$tmux_conf_new_window_reconnect_ssh" && _is_true "$tmux_conf_new_window_reconnect_ssh"; then
990990+# perl -p -i -e "s,\bnew-window\b([^;}\n\"]*),run-shell 'cut -c3- \"$TMUX_CONF\" | sh -s _new_window #\{pane_pid\} #\{b:pane_tty\}\1',g" "$cfg"
991991+# fi
992992+#
993993+# tmux_conf_new_window_retain_current_path=${tmux_conf_new_window_retain_current_path:-false}
994994+# if ! _is_disabled "$tmux_conf_new_window_retain_current_path" && _is_true "$tmux_conf_new_window_retain_current_path"; then
995995+# perl -p -i -e "
996996+# s/\bnew-window\b(?!\s+(?:-|}))/{$&}/g if /\bdisplay-menu\b/
997997+# ;
998998+# s/\bnew-window\b/new-window -c '#{pane_current_path}'/g
999999+# ;
10001000+# s/\brun-shell\b\s+'cut\s+-c3-\s+(.+?)\s+\|\s+sh\s+-s\s+_new_window(_ssh)?\s+#\{pane_pid\}\s+#\{b:pane_tty\}([^}\n']*)'/run-shell 'cut -c3- \1 | sh -s _new_window\2 #\{pane_pid\} #\{b:pane_tty\} -c \\\\\"#\{pane_current_path\}\\\\\"\3'/g if /\bdisplay-menu\b/
10011001+# ;
10021002+# s/\brun-shell\b\s+'cut\s+-c3-\s+(.+?)\s+\|\s+sh\s+-s\s+_new_window(_ssh)?\s+#\{pane_pid\}\s+#\{b:pane_tty\}([^}\n']*)'/run-shell 'cut -c3- \1 | sh -s _new_window\2 #\{pane_pid\} #\{b:pane_tty\} -c \"#\{pane_current_path\}\"\3'/g" \
10031003+# "$cfg"
10041004+# fi
10051005+#
10061006+# tmux_conf_new_pane_retain_current_path=${tmux_conf_new_pane_retain_current_path:-true}
10071007+# if ! _is_disabled "$tmux_conf_new_pane_retain_current_path"; then
10081008+# perl -p -i -e "
10091009+# s/\brun-shell\b\s+(\"|')cut\s+-c3-\s+(.+?)\s+\|\s+sh\s+-s\s+_split_window\s+#\{pane_pid\}\s+#\{b:pane_tty\}([^\n\1]*?)(?:\s+-c\s+((?:\\\\{1,3}\")?|\"?|'?)#\{pane_current_path\}\4)([^\n\1]*?)\1/run-shell \1cut -c3- \2 | sh -s _split_window #\{pane_pid\} #\{b:pane_tty\}\3\5\1/g
10101010+# ;
10111011+# s/\brun-shell\b\s+(\"|')cut\s+-c3-\s+.+?\s+\|\s+sh\s+-s\s+_split_window\s+#\{pane_pid\}\s+#\{b:pane_tty\}(\s+.+?)?\1/split-window\2/g
10121012+# ;
10131013+# s/\bsplit-window\b([^;}\n]*?)(?:\s+-c\s+((?:\\\\\")?|\"?|'?)#\{pane_current_path\}\2)/split-window\1/g" \
10141014+# "$cfg"
10151015+# fi
10161016+#
10171017+# perl -p -i -e "
10181018+# s,\bsplit-window\b((?:(?:[ \t]+-[bdfhIvP])|(?:[ \t]+-[celtF][ \t]+(?!\bssh\b)[^\s]+))*)?(?:\s+(\bssh\b))((?:(?:[ \t]+-[bdfhIvP])|(?:[ \t]+-[celtF][ \t]+(?!\bssh\b)[^\s]+))*)?,run-shell 'cut -c3- \"$TMUX_CONF\" | sh -s _split_window_ssh #\{pane_pid\} #\{b:pane_tty\}\1',g if /\bsplit-window\b((?:(?:[ \t]+-[bdfhIvP])|(?:[ \t]+-[celtF][ \t]+(?!ssh)[^\s]+))*)?(?:\s+(ssh))((?:(?:[ \t]+-[bdfhIvP])|(?:[ \t]+-[celtF][ \t]+(?!ssh)[^\s]+))*)?/"\
10191019+# "$cfg"
10201020+#
10211021+# tmux_conf_new_pane_reconnect_ssh=${tmux_conf_new_pane_reconnect_ssh:-false}
10221022+# if ! _is_disabled "$tmux_conf_new_pane_reconnect_ssh" && _is_true "$tmux_conf_new_pane_reconnect_ssh"; then
10231023+# perl -p -i -e "s,\bsplit-window\b([^;}\n\"]*),run-shell 'cut -c3- \"$TMUX_CONF\" | sh -s _split_window #\{pane_pid\} #\{b:pane_tty\}\1',g" "$cfg"
10241024+# fi
10251025+#
10261026+# if ! _is_disabled "$tmux_conf_new_pane_retain_current_path" && _is_true "$tmux_conf_new_pane_retain_current_path"; then
10271027+# perl -p -i -e "
10281028+# s/\bsplit-window\b(?!\s+(?:-|}))/{$&}/g if /\bdisplay-menu\b/
10291029+# ;
10301030+# s/\bsplit-window\b/split-window -c '#{pane_current_path}'\1/g
10311031+# ;
10321032+# s/\brun-shell\b\s+'cut\s+-c3-\s+(.+?)\s+\|\s+sh\s+-s\s+_split_window(_ssh)?\s+#\{pane_pid\}\s+#\{b:pane_tty\}([^}\n']*)'/run-shell 'cut -c3- \1 | sh -s _split_window\2 #\{pane_pid\} #\{b:pane_tty\} -c \\\\\"#\{pane_current_path\}\\\\\"\3'/g if /\bdisplay-menu\b/
10331033+# ;
10341034+# s/\brun-shell\b\s+'cut\s+-c3-\s+(.+?)\s+\|\s+sh\s+-s\s+_split_window(_ssh)?\s+#\{pane_pid\}\s+#\{b:pane_tty\}([^}\n']*)'/run-shell 'cut -c3- \1 | sh -s _split_window\2 #\{pane_pid\} #\{b:pane_tty\} -c \"#\{pane_current_path\}\"\3'/g" \
10351035+# "$cfg"
10361036+# fi
10371037+#
10381038+# tmux_conf_new_session_prompt=${tmux_conf_new_session_prompt:-false}
10391039+# if ! _is_disabled "$tmux_conf_new_session_prompt" && _is_true "$tmux_conf_new_session_prompt"; then
10401040+# perl -p -i -e "
10411041+# s/(?<!command-prompt -p )\b(new-session)\b(?!\s+(?:-|}))/{$&}/g if /\bdisplay-menu\b/
10421042+# ;
10431043+# s/(?<!\bcommand-prompt -p )\bnew-session\b(?! -s)/command-prompt -p new-session \"new-session -s '%%'\"/g" \
10441044+# "$cfg"
10451045+# else
10461046+# perl -p -i -e "s/\bcommand-prompt\s+-p\s+new-session\s+\"new-session\s+-s\s+'%%'\"/new-session/g" "$cfg"
10471047+# fi
10481048+#
10491049+# tmux_conf_new_session_retain_current_path=${tmux_conf_new_session_retain_current_path:-false}
10501050+# if ! _is_disabled "$tmux_conf_new_session_retain_current_path" && _is_true "$tmux_conf_new_session_retain_current_path"; then
10511051+# perl -p -i -e "
10521052+# s/(?<!\bcommand-prompt -p )\bnew-session\b/new-session -c '#{pane_current_path}'/g" \
10531053+# "$cfg"
10541054+# else
10551055+# perl -p -i -e "
10561056+# s/\bnew-session\b([^;}\n]*?)(?:\s+-c\s+((?:\\\\\")?|\"?|'?)#\{pane_current_path\}\2)/new-session\1/g" \
10571057+# "$cfg"
10581058+# fi
10591059+#
10601060+# tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false}
10611061+# command -v xsel > /dev/null 2>&1 && command='xsel -i -b'
10621062+# ! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1 && command='xclip -i -selection clipboard > \/dev\/null 2>\&1'
10631063+# [ "$XDG_SESSION_TYPE" = "wayland" ] && command -v wl-copy > /dev/null 2>&1 && command='wl-copy'
10641064+# command -v pbcopy > /dev/null 2>&1 && command='pbcopy'
10651065+# command -v clip.exe > /dev/null 2>&1 && command='clip\.exe'
10661066+# [ -c /dev/clipboard ] && command='cat > \/dev\/clipboard'
10671067+#
10681068+# if [ -n "$command" ]; then
10691069+# if ! _is_disabled "$tmux_conf_copy_to_os_clipboard" && _is_true "$tmux_conf_copy_to_os_clipboard"; then
10701070+# perl -p -i -e "s/(?!.*?$command)\bcopy-(?:selection|pipe)(-end-of-line|-and-cancel|-end-of-line-and-cancel|-no-clear)?\b/copy-pipe\1 '$command'/g" "$cfg"
10711071+# else
10721072+# if [ "$_tmux_version" -ge 3200 ]; then
10731073+# perl -p -i -e "s/\bcopy-pipe(-end-of-line|-and-cancel|end-of-line-and-cancel|-no-clear)?\b\s+(\"|')?$command\2?/copy-pipe\1/g" "$cfg"
10741074+# else
10751075+# perl -p -i -e "s/\bcopy-pipe(-end-of-line|-and-cancel|end-of-line-and-cancel|-no-clear)?\b\s+(\"|')?$command\2?/copy-selection\1/g" "$cfg"
10761076+# fi
10771077+# fi
10781078+# fi
10791079+#
10801080+# # until tmux >= 3.0, output of tmux list-keys can't be consumed back by tmux source-file without applying some escapings
10811081+# awk < "$cfg" \
10821082+# '{i = $2 == "-T" ? 4 : 5; gsub(/^[;]$/, "\\\\&", $i); gsub(/^[$"#~]$/, "'"'"'&'"'"'", $i); gsub(/^['"'"']$/, "\"&\"", $i); print}' > "$cfg.in"
10831083+#
10841084+# # ignore bindings with errors
10851085+# if ! tmux source-file "$cfg.in"; then
10861086+# if tmux source-file -v /dev/null 2> /dev/null; then
10871087+# verbose_flag='-v'
10881088+# fi
10891089+# while ! out=$(tmux source-file "${verbose_flag:+$verbose_flag}" "$cfg.in"); do
10901090+# line=$(printf "%s" "$out" | tail -1 | cut -d':' -f2)
10911091+# perl -n -i -e "if ($. != $line) { print }" "$cfg.in"
10921092+# done
10931093+# fi
10941094+#
10951095+# tmux_conf_urlscan_options=${tmux_conf_urlscan_options:---compact --dedupe}
10961096+# if command -v urlscan > /dev/null 2>&1; then
10971097+# tmux bind U run "cut -c3- '#{TMUX_CONF}' | sh -s _urlscan '#{pane_id}' $tmux_conf_urlscan_options"
10981098+# elif command -v urlview > /dev/null 2>&1; then
10991099+# tmux bind U run "cut -c3- '#{TMUX_CONF}' | sh -s _urlview '#{pane_id}'"
11001100+# fi
11011101+# }
11021102+#
11031103+# _apply_theme() {
11041104+# tmux_conf_theme=${tmux_conf_theme:-enabled}
11051105+# if ! _is_disabled "$tmux_conf_theme"; then
11061106+#
11071107+# # -- default theme -------------------------------------------------------
11081108+#
11091109+# tmux_conf_theme_colour_1=${tmux_conf_theme_colour_1:-#080808} # dark gray
11101110+# tmux_conf_theme_colour_2=${tmux_conf_theme_colour_2:-#303030} # gray
11111111+# tmux_conf_theme_colour_3=${tmux_conf_theme_colour_3:-#8a8a8a} # light gray
11121112+# tmux_conf_theme_colour_4=${tmux_conf_theme_colour_4:-#00afff} # light blue
11131113+# tmux_conf_theme_colour_5=${tmux_conf_theme_colour_5:-#ffff00} # yellow
11141114+# tmux_conf_theme_colour_6=${tmux_conf_theme_colour_6:-#080808} # dark gray
11151115+# tmux_conf_theme_colour_7=${tmux_conf_theme_colour_7:-#e4e4e4} # white
11161116+# tmux_conf_theme_colour_8=${tmux_conf_theme_colour_8:-#080808} # dark gray
11171117+# tmux_conf_theme_colour_9=${tmux_conf_theme_colour_9:-#ffff00} # yellow
11181118+# tmux_conf_theme_colour_10=${tmux_conf_theme_colour_10:-#ff00af} # pink
11191119+# tmux_conf_theme_colour_11=${tmux_conf_theme_colour_11:-#5fff00} # green
11201120+# tmux_conf_theme_colour_12=${tmux_conf_theme_colour_12:-#8a8a8a} # light gray
11211121+# tmux_conf_theme_colour_13=${tmux_conf_theme_colour_13:-#e4e4e4} # white
11221122+# tmux_conf_theme_colour_14=${tmux_conf_theme_colour_14:-#080808} # dark gray
11231123+# tmux_conf_theme_colour_15=${tmux_conf_theme_colour_15:-#080808} # dark gray
11241124+# tmux_conf_theme_colour_16=${tmux_conf_theme_colour_16:-#d70000} # red
11251125+# tmux_conf_theme_colour_17=${tmux_conf_theme_colour_17:-#e4e4e4} # white
11261126+#
11271127+# # -- panes ---------------------------------------------------------------
11281128+#
11291129+# tmux_conf_theme_window_fg=${tmux_conf_theme_window_fg:-default}
11301130+# tmux_conf_theme_window_bg=${tmux_conf_theme_window_bg:-default}
11311131+# tmux_conf_theme_highlight_focused_pane=${tmux_conf_theme_highlight_focused_pane:-false}
11321132+# tmux_conf_theme_focused_pane_fg=${tmux_conf_theme_focused_pane_fg:-default}
11331133+# tmux_conf_theme_focused_pane_bg=${tmux_conf_theme_focused_pane_bg:-$tmux_conf_theme_colour_2}
11341134+#
11351135+# window_style="fg=$tmux_conf_theme_window_fg,bg=$tmux_conf_theme_window_bg"
11361136+# if _is_true "$tmux_conf_theme_highlight_focused_pane"; then
11371137+# window_active_style="fg=$tmux_conf_theme_focused_pane_fg,bg=$tmux_conf_theme_focused_pane_bg"
11381138+# else
11391139+# window_active_style="default"
11401140+# fi
11411141+#
11421142+# tmux_conf_theme_pane_border_style=${tmux_conf_theme_pane_border_style:-thin}
11431143+# tmux_conf_theme_pane_border=${tmux_conf_theme_pane_border:-$tmux_conf_theme_colour_2}
11441144+# tmux_conf_theme_pane_active_border=${tmux_conf_theme_pane_active_border:-$tmux_conf_theme_colour_4}
11451145+# tmux_conf_theme_pane_border_fg=${tmux_conf_theme_pane_border_fg:-$tmux_conf_theme_pane_border}
11461146+# tmux_conf_theme_pane_active_border_fg=${tmux_conf_theme_pane_active_border_fg:-$tmux_conf_theme_pane_active_border}
11471147+# case "$tmux_conf_theme_pane_border_style" in
11481148+# fat)
11491149+# tmux_conf_theme_pane_border_bg=${tmux_conf_theme_pane_border_bg:-$tmux_conf_theme_pane_border_fg}
11501150+# tmux_conf_theme_pane_active_border_bg=${tmux_conf_theme_pane_active_border_bg:-$tmux_conf_theme_pane_active_border_fg}
11511151+# ;;
11521152+# thin|*)
11531153+# tmux_conf_theme_pane_border_bg=${tmux_conf_theme_pane_border_bg:-default}
11541154+# tmux_conf_theme_pane_active_border_bg=${tmux_conf_theme_pane_active_border_bg:-default}
11551155+# ;;
11561156+# esac
11571157+#
11581158+# tmux_conf_theme_pane_indicator=${tmux_conf_theme_pane_indicator:-$tmux_conf_theme_colour_4}
11591159+# tmux_conf_theme_pane_active_indicator=${tmux_conf_theme_pane_active_indicator:-$tmux_conf_theme_colour_4}
11601160+#
11611161+# # -- status line ---------------------------------------------------------
11621162+#
11631163+# tmux_conf_theme_left_separator_main=$(_decode_unicode_escapes "${tmux_conf_theme_left_separator_main-}")
11641164+# tmux_conf_theme_left_separator_sub=$(_decode_unicode_escapes "${tmux_conf_theme_left_separator_sub-|}")
11651165+# tmux_conf_theme_right_separator_main=$(_decode_unicode_escapes "${tmux_conf_theme_right_separator_main-}")
11661166+# tmux_conf_theme_right_separator_sub=$(_decode_unicode_escapes "${tmux_conf_theme_right_separator_sub-|}")
11671167+#
11681168+# tmux_conf_theme_message_fg=${tmux_conf_theme_message_fg:-$tmux_conf_theme_colour_1}
11691169+# tmux_conf_theme_message_bg=${tmux_conf_theme_message_bg:-$tmux_conf_theme_colour_5}
11701170+# tmux_conf_theme_message_attr=${tmux_conf_theme_message_attr:-bold}
11711171+#
11721172+# tmux_conf_theme_message_command_fg=${tmux_conf_theme_message_command_fg:-$tmux_conf_theme_colour_5}
11731173+# tmux_conf_theme_message_command_bg=${tmux_conf_theme_message_command_bg:-$tmux_conf_theme_colour_1}
11741174+# tmux_conf_theme_message_command_attr=${tmux_conf_theme_message_command_attr:-bold}
11751175+#
11761176+# tmux_conf_theme_mode_fg=${tmux_conf_theme_mode_fg:-$tmux_conf_theme_colour_1}
11771177+# tmux_conf_theme_mode_bg=${tmux_conf_theme_mode_bg:-$tmux_conf_theme_colour_5}
11781178+# tmux_conf_theme_mode_attr=${tmux_conf_theme_mode_attr:-bold}
11791179+#
11801180+# tmux_conf_theme_status_fg=${tmux_conf_theme_status_fg:-$tmux_conf_theme_colour_3}
11811181+# tmux_conf_theme_status_bg=${tmux_conf_theme_status_bg:-$tmux_conf_theme_colour_1}
11821182+# tmux_conf_theme_status_attr=${tmux_conf_theme_status_attr:-none}
11831183+#
11841184+# tmux_conf_theme_terminal_title=${tmux_conf_theme_terminal_title:-#h ❐ #S ● #I #W}
11851185+#
11861186+# tmux_conf_theme_window_status_fg=${tmux_conf_theme_window_status_fg:-$tmux_conf_theme_colour_3}
11871187+# tmux_conf_theme_window_status_bg=${tmux_conf_theme_window_status_bg:-$tmux_conf_theme_colour_1}
11881188+# tmux_conf_theme_window_status_attr=${tmux_conf_theme_window_status_attr:-none}
11891189+# tmux_conf_theme_window_status_format=${tmux_conf_theme_window_status_format:-'#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}'}
11901190+#
11911191+# tmux_conf_theme_window_status_current_fg=${tmux_conf_theme_window_status_current_fg:-$tmux_conf_theme_colour_1}
11921192+# tmux_conf_theme_window_status_current_bg=${tmux_conf_theme_window_status_current_bg:-$tmux_conf_theme_colour_4}
11931193+# tmux_conf_theme_window_status_current_attr=${tmux_conf_theme_window_status_current_attr:-bold}
11941194+# tmux_conf_theme_window_status_current_format=${tmux_conf_theme_window_status_current_format:-'#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}'}
11951195+#
11961196+# tmux_conf_theme_window_status_activity_fg=${tmux_conf_theme_window_status_activity_fg:-default}
11971197+# tmux_conf_theme_window_status_activity_bg=${tmux_conf_theme_window_status_activity_bg:-default}
11981198+# tmux_conf_theme_window_status_activity_attr=${tmux_conf_theme_window_status_activity_attr:-underscore}
11991199+#
12001200+# tmux_conf_theme_window_status_bell_fg=${tmux_conf_theme_window_status_bell_fg:-$tmux_conf_theme_colour_5}
12011201+# tmux_conf_theme_window_status_bell_bg=${tmux_conf_theme_window_status_bell_bg:-default}
12021202+# tmux_conf_theme_window_status_bell_attr=${tmux_conf_theme_window_status_bell_attr:-blink,bold}
12031203+#
12041204+# tmux_conf_theme_window_status_last_fg=${tmux_conf_theme_window_status_last_fg:-$tmux_conf_theme_colour_4}
12051205+# tmux_conf_theme_window_status_last_bg=${tmux_conf_theme_window_status_last_bg:-default}
12061206+# tmux_conf_theme_window_status_last_attr=${tmux_conf_theme_window_status_last_attr:-none}
12071207+#
12081208+# if [ "$tmux_conf_theme_window_status_bg" = "$tmux_conf_theme_status_bg" ] || [ "$tmux_conf_theme_window_status_bg" = "default" ]; then
12091209+# spacer=''
12101210+# spacer_current=' '
12111211+# else
12121212+# spacer=' '
12131213+# spacer_current=' '
12141214+# fi
12151215+# if [ "$tmux_conf_theme_window_status_last_bg" = "$tmux_conf_theme_status_bg" ] || [ "$tmux_conf_theme_window_status_last_bg" = "default" ] ; then
12161216+# spacer_last=''
12171217+# else
12181218+# spacer_last=' '
12191219+# fi
12201220+# if [ "$tmux_conf_theme_window_status_activity_bg" = "$tmux_conf_theme_status_bg" ] || [ "$tmux_conf_theme_window_status_activity_bg" = "default" ] ; then
12211221+# spacer_activity=''
12221222+# spacer_last_activity="$spacer_last"
12231223+# else
12241224+# spacer_activity=' '
12251225+# spacer_last_activity=' '
12261226+# fi
12271227+# if [ "$tmux_conf_theme_window_status_bell_bg" = "$tmux_conf_theme_status_bg" ] || [ "$tmux_conf_theme_window_status_bell_bg" = "default" ] ; then
12281228+# spacer_bell=''
12291229+# spacer_last_bell="$spacer_last"
12301230+# spacer_activity_bell="$spacer_activity"
12311231+# spacer_last_activity_bell="$spacer_last_activity"
12321232+# else
12331233+# spacer_bell=' '
12341234+# spacer_last_bell=' '
12351235+# spacer_activity_bell=' '
12361236+# spacer_last_activity_bell=' '
12371237+# fi
12381238+# spacer="#{?window_last_flag,#{?window_activity_flag,#{?window_bell_flag,$spacer_last_activity_bell,$spacer_last_activity},#{?window_bell_flag,$spacer_last_bell,$spacer_last}},#{?window_activity_flag,#{?window_bell_flag,$spacer_activity_bell,$spacer_activity},#{?window_bell_flag,$spacer_bell,$spacer}}}"
12391239+# if [ "$(tmux show -g -v status-justify)" = "right" ]; then
12401240+# if [ -z "$tmux_conf_theme_right_separator_main" ]; then
12411241+# window_status_separator=' '
12421242+# else
12431243+# window_status_separator=''
12441244+# fi
12451245+# window_status_format="#[fg=$tmux_conf_theme_window_status_bg,bg=$tmux_conf_theme_status_bg,none]#{?window_last_flag,$(printf '%s' "$tmux_conf_theme_window_status_last_bg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_activity_flag,$(printf '%s' "$tmux_conf_theme_window_status_activity_bg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_bell_flag,$(printf '%s' "$tmux_conf_theme_window_status_bell_bg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}$tmux_conf_theme_right_separator_main#[fg=$tmux_conf_theme_window_status_fg,bg=$tmux_conf_theme_window_status_bg,$tmux_conf_theme_window_status_attr]#{?window_last_flag,$(printf '%s' "$tmux_conf_theme_window_status_last_fg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_last_flag,$(printf '%s' "$tmux_conf_theme_window_status_last_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}#{?window_activity_flag,$(printf '%s' "$tmux_conf_theme_window_status_activity_fg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_activity_flag,$(printf '%s' "$tmux_conf_theme_window_status_activity_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}#{?window_bell_flag,$(printf '%s' "$tmux_conf_theme_window_status_bell_fg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_bell_flag,$(printf '%s' "$tmux_conf_theme_window_status_bell_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}$spacer$(printf '%s' "$tmux_conf_theme_window_status_last_attr" | perl -n -e 'print "#{?window_last_flag,#[none],}" if !/default/ ; s/([a-z]+),?/#{?window_last_flag,#[\1],}/g; print if !/default/')$(printf '%s' "$tmux_conf_theme_window_status_activity_attr" | perl -n -e 'print "#{?window_activity_flag?,#[none],}" if !/default/ ; s/([a-z]+),?/#{?window_activity_flag,#[\1],}/g; print if !/default/')$(printf '%s' "$tmux_conf_theme_window_status_bell_attr" | perl -n -e 'print "#{?window_bell_flag,#[none],}" if !/default/ ; s/([a-z]+),?/#{?window_bell_flag,#[\1],}/g; print if !/default/')$tmux_conf_theme_window_status_format#[none]$spacer#[fg=$tmux_conf_theme_status_bg,bg=$tmux_conf_theme_window_status_bg]#{?window_last_flag,$(printf '%s' "$tmux_conf_theme_window_status_last_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}#{?window_activity_flag,$(printf '%s' "$tmux_conf_theme_window_status_activity_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}#{?window_bell_flag,$(printf '%s' "$tmux_conf_theme_window_status_bell_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}#[none]$tmux_conf_theme_right_separator_main"
12461246+# window_status_current_format="#[fg=$tmux_conf_theme_window_status_current_bg,bg=$tmux_conf_theme_status_bg,none]$tmux_conf_theme_right_separator_main#[fg=$tmux_conf_theme_window_status_current_fg,bg=$tmux_conf_theme_window_status_current_bg,$tmux_conf_theme_window_status_current_attr]$spacer_current$tmux_conf_theme_window_status_current_format$spacer_current#[fg=$tmux_conf_theme_status_bg,bg=$tmux_conf_theme_window_status_current_bg,none]$tmux_conf_theme_right_separator_main"
12471247+# else
12481248+# if [ -z "$tmux_conf_theme_left_separator_main" ]; then
12491249+# window_status_separator=' '
12501250+# else
12511251+# window_status_separator=''
12521252+# fi
12531253+# window_status_format="#[fg=$tmux_conf_theme_status_bg,bg=$tmux_conf_theme_window_status_bg,none]#{?window_last_flag,$(printf '%s' "$tmux_conf_theme_window_status_last_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}#{?window_activity_flag,$(printf '%s' "$tmux_conf_theme_window_status_activity_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}#{?window_bell_flag,$(printf '%s' "$tmux_conf_theme_window_status_bell_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}$tmux_conf_theme_left_separator_main#[fg=$tmux_conf_theme_window_status_fg,bg=$tmux_conf_theme_window_status_bg,$tmux_conf_theme_window_status_attr]#{?window_last_flag,$(printf '%s' "$tmux_conf_theme_window_status_last_fg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_last_flag,$(printf '%s' "$tmux_conf_theme_window_status_last_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}#{?window_activity_flag,$(printf '%s' "$tmux_conf_theme_window_status_activity_fg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_activity_flag,$(printf '%s' "$tmux_conf_theme_window_status_activity_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}#{?window_bell_flag,$(printf '%s' "$tmux_conf_theme_window_status_bell_fg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_bell_flag,$(printf '%s' "$tmux_conf_theme_window_status_bell_bg" | perl -n -e "s/.+/#[bg=$&]/; print if !/default/"),}$spacer$(printf '%s' "$tmux_conf_theme_window_status_last_attr" | perl -n -e 'print "#{?window_last_flag,#[none],}" if !/default/ ; s/([a-z]+),?/#{?window_last_flag,#[\1],}/g; print if !/default/')$(printf '%s' "$tmux_conf_theme_window_status_activity_attr" | perl -n -e 'print "#{?window_activity_flag,#[none],}" if !/default/ ; s/([a-z]+),?/#{?window_activity_flag,#[\1],}/g; print if !/default/')$(printf '%s' "$tmux_conf_theme_window_status_bell_attr" | perl -n -e 'print "#{?window_bell_flag,#[none],}" if /!default/ ; s/([a-z]+),?/#{?window_bell_flag,#[\1],}/g; print if !/default/')$tmux_conf_theme_window_status_format#[none]$spacer#[fg=$tmux_conf_theme_window_status_bg,bg=$tmux_conf_theme_status_bg]#{?window_last_flag,$(printf '%s' "$tmux_conf_theme_window_status_last_bg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_activity_flag,$(printf '%s' "$tmux_conf_theme_window_status_activity_bg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}#{?window_bell_flag,$(printf '%s' "$tmux_conf_theme_window_status_bell_bg" | perl -n -e "s/.+/#[fg=$&]/; print if !/default/"),}$tmux_conf_theme_left_separator_main"
12541254+# window_status_current_format="#[fg=$tmux_conf_theme_status_bg,bg=$tmux_conf_theme_window_status_current_bg,none]$tmux_conf_theme_left_separator_main#[fg=$tmux_conf_theme_window_status_current_fg,bg=$tmux_conf_theme_window_status_current_bg,$tmux_conf_theme_window_status_current_attr]$spacer_current$tmux_conf_theme_window_status_current_format$spacer_current#[fg=$tmux_conf_theme_window_status_current_bg,bg=$tmux_conf_theme_status_bg]$tmux_conf_theme_left_separator_main"
12551255+# fi
12561256+#
12571257+# # -- indicators
12581258+#
12591259+# tmux_conf_theme_pairing=${tmux_conf_theme_pairing:-⚇} # U+2687
12601260+# tmux_conf_theme_pairing_fg=${tmux_conf_theme_pairing_fg:-none}
12611261+# tmux_conf_theme_pairing_bg=${tmux_conf_theme_pairing_bg:-none}
12621262+# tmux_conf_theme_pairing_attr=${tmux_conf_theme_pairing_attr:-none}
12631263+#
12641264+# tmux_conf_theme_prefix=${tmux_conf_theme_prefix:-⌨} # U+2328
12651265+# tmux_conf_theme_prefix_fg=${tmux_conf_theme_prefix_fg:-none}
12661266+# tmux_conf_theme_prefix_bg=${tmux_conf_theme_prefix_bg:-none}
12671267+# tmux_conf_theme_prefix_attr=${tmux_conf_theme_prefix_attr:-none}
12681268+#
12691269+# tmux_conf_theme_mouse=${tmux_conf_theme_mouse:-↗} # U+2197
12701270+# tmux_conf_theme_mouse_fg=${tmux_conf_theme_mouse_fg:-none}
12711271+# tmux_conf_theme_mouse_bg=${tmux_conf_theme_mouse_bg:-none}
12721272+# tmux_conf_theme_mouse_attr=${tmux_conf_theme_mouse_attr:-none}
12731273+#
12741274+# tmux_conf_theme_root=${tmux_conf_theme_root:-!}
12751275+# tmux_conf_theme_root_fg=${tmux_conf_theme_root_fg:-none}
12761276+# tmux_conf_theme_root_bg=${tmux_conf_theme_root_bg:-none}
12771277+# tmux_conf_theme_root_attr=${tmux_conf_theme_root_attr:-bold,blink}
12781278+#
12791279+# tmux_conf_theme_synchronized=${tmux_conf_theme_synchronized:-⚏} # U+268F
12801280+# tmux_conf_theme_synchronized_fg=${tmux_conf_theme_synchronized_fg:-none}
12811281+# tmux_conf_theme_synchronized_bg=${tmux_conf_theme_synchronized_bg:-none}
12821282+# tmux_conf_theme_synchronized_attr=${tmux_conf_theme_synchronized_attr:-none}
12831283+#
12841284+# # -- status-left style
12851285+#
12861286+# tmux_conf_theme_status_left=${tmux_conf_theme_status_left-' ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} '}
12871287+# tmux_conf_theme_status_left_fg=${tmux_conf_theme_status_left_fg:-$tmux_conf_theme_colour_6,$tmux_conf_theme_colour_7,$tmux_conf_theme_colour_8}
12881288+# tmux_conf_theme_status_left_bg=${tmux_conf_theme_status_left_bg:-$tmux_conf_theme_colour_9,$tmux_conf_theme_colour_10,$tmux_conf_theme_colour_11}
12891289+# tmux_conf_theme_status_left_attr=${tmux_conf_theme_status_left_attr:-bold,none,none}
12901290+#
12911291+# if [ -n "$tmux_conf_theme_status_left" ]; then
12921292+# status_left=$(echo "$tmux_conf_theme_status_left" | sed \
12931293+# -e "s/#{pairing}/#[fg=$tmux_conf_theme_pairing_fg]#[bg=$tmux_conf_theme_pairing_bg]#[$tmux_conf_theme_pairing_attr]#{pairing}#[inherit]/g" \
12941294+# -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{prefix}#[inherit]/g" \
12951295+# -e "s/#{mouse}/#[fg=$tmux_conf_theme_mouse_fg]#[bg=$tmux_conf_theme_mouse_bg]#[$tmux_conf_theme_mouse_attr]#{mouse}#[inherit]/g" \
12961296+# -e "s/#{synchronized}/#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{synchronized}#[inherit]/g" \
12971297+# -e "s/#{root}/#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#{root}#[inherit]/g")
12981298+#
12991299+# status_left=$(printf '%s' "$status_left" | awk \
13001300+# -v status_bg="$tmux_conf_theme_status_bg" \
13011301+# -v fg_="$tmux_conf_theme_status_left_fg" \
13021302+# -v bg_="$tmux_conf_theme_status_left_bg" \
13031303+# -v attr_="$tmux_conf_theme_status_left_attr" \
13041304+# -v mainsep="$tmux_conf_theme_left_separator_main" \
13051305+# -v subsep="$tmux_conf_theme_left_separator_sub" '
13061306+# function subsplit(s, l, i, a, r)
13071307+# {
13081308+# l = split(s, a, ",")
13091309+# for (i = 1; i <= l; ++i)
13101310+# {
13111311+# o = split(a[i], _, "(") - 1
13121312+# c = split(a[i], _, ")") - 1
13131313+# open += o - c
13141314+# o_ = split(a[i], _, "{") - 1
13151315+# c_ = split(a[i], _, "}") - 1
13161316+# open_ += o_ - c_
13171317+# o__ = split(a[i], _, "[") - 1
13181318+# c__ = split(a[i], _, "]") - 1
13191319+# open__ += o__ - c__
13201320+#
13211321+# if (i == l)
13221322+# r = sprintf("%s%s", r, a[i])
13231323+# else if (open || open_ || open__)
13241324+# r = sprintf("%s%s,", r, a[i])
13251325+# else
13261326+# r = sprintf("%s%s#[fg=%s,bg=%s,%s]%s", r, a[i], fg[j], bg[j], attr[j], subsep)
13271327+# }
13281328+#
13291329+# gsub(/#\[inherit\]/, sprintf("#[default]#[fg=%s,bg=%s,%s]", fg[j], bg[j], attr[j]), r)
13301330+# return r
13311331+# }
13321332+# BEGIN {
13331333+# FS = "|"
13341334+# l1 = split(fg_, fg, ",")
13351335+# l2 = split(bg_, bg, ",")
13361336+# l3 = split(attr_, attr, ",")
13371337+# l = l1 < l2 ? (l1 < l3 ? l1 : l3) : (l2 < l3 ? l2 : l3)
13381338+# }
13391339+# {
13401340+# for (i = j = 1; i <= NF; ++i)
13411341+# {
13421342+# if (open || open_ || open__)
13431343+# printf "|%s", subsplit($i)
13441344+# else
13451345+# {
13461346+# if (i > 1)
13471347+# printf "#[fg=%s,bg=%s,none]%s#[fg=%s,bg=%s,%s]%s", bg[j_], bg[j], mainsep, fg[j], bg[j], attr[j], subsplit($i)
13481348+# else
13491349+# printf "#[fg=%s,bg=%s,%s]%s", fg[j], bg[j], attr[j], subsplit($i)
13501350+# }
13511351+#
13521352+# if (!open && !open_ && !open__)
13531353+# {
13541354+# j_ = j
13551355+# j = j % l + 1
13561356+# }
13571357+# }
13581358+# printf "#[fg=%s,bg=%s,none]%s", bg[j_], status_bg, mainsep
13591359+# }')
13601360+# fi
13611361+# status_left="$status_left "
13621362+#
13631363+# # -- status-right style
13641364+#
13651365+# tmux_conf_theme_status_right=${tmux_conf_theme_status_right-' #{prefix}#{mouse}#{pairing}#{synchronized}#{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} '}
13661366+# tmux_conf_theme_status_right_fg=${tmux_conf_theme_status_right_fg:-$tmux_conf_theme_colour_12,$tmux_conf_theme_colour_13,$tmux_conf_theme_colour_14}
13671367+# tmux_conf_theme_status_right_bg=${tmux_conf_theme_status_right_bg:-$tmux_conf_theme_colour_15,$tmux_conf_theme_colour_16,$tmux_conf_theme_colour_17}
13681368+# tmux_conf_theme_status_right_attr=${tmux_conf_theme_status_right_attr:-none,none,bold}
13691369+#
13701370+# if [ -n "$tmux_conf_theme_status_right" ]; then
13711371+# status_right=$(echo "$tmux_conf_theme_status_right" | sed \
13721372+# -e "s/#{pairing}/#[fg=$tmux_conf_theme_pairing_fg]#[bg=$tmux_conf_theme_pairing_bg]#[$tmux_conf_theme_pairing_attr]#{pairing}#[inherit]/g" \
13731373+# -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{prefix}#[inherit]/g" \
13741374+# -e "s/#{mouse}/#[fg=$tmux_conf_theme_mouse_fg]#[bg=$tmux_conf_theme_mouse_bg]#[$tmux_conf_theme_mouse_attr]#{mouse}#[inherit]/g" \
13751375+# -e "s/#{synchronized}/#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{synchronized}#[inherit]/g" \
13761376+# -e "s/#{root}/#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#{root}#[inherit]/g")
13771377+#
13781378+# status_right=$(printf '%s' "$status_right" | awk \
13791379+# -v status_bg="$tmux_conf_theme_status_bg" \
13801380+# -v fg_="$tmux_conf_theme_status_right_fg" \
13811381+# -v bg_="$tmux_conf_theme_status_right_bg" \
13821382+# -v attr_="$tmux_conf_theme_status_right_attr" \
13831383+# -v mainsep="$tmux_conf_theme_right_separator_main" \
13841384+# -v subsep="$tmux_conf_theme_right_separator_sub" '
13851385+# function subsplit(s, l, i, a, r)
13861386+# {
13871387+# l = split(s, a, ",")
13881388+# for (i = 1; i <= l; ++i)
13891389+# {
13901390+# o = split(a[i], _, "(") - 1
13911391+# c = split(a[i], _, ")") - 1
13921392+# open += o - c
13931393+# o_ = split(a[i], _, "{") - 1
13941394+# c_ = split(a[i], _, "}") - 1
13951395+# open_ += o_ - c_
13961396+# o__ = split(a[i], _, "[") - 1
13971397+# c__ = split(a[i], _, "]") - 1
13981398+# open__ += o__ - c__
13991399+#
14001400+# if (i == l)
14011401+# r = sprintf("%s%s", r, a[i])
14021402+# else if (open || open_ || open__)
14031403+# r = sprintf("%s%s,", r, a[i])
14041404+# else
14051405+# r = sprintf("%s%s#[fg=%s,bg=%s,%s]%s", r, a[i], fg[j], bg[j], attr[j], subsep)
14061406+# }
14071407+#
14081408+# gsub(/#\[inherit\]/, sprintf("#[default]#[fg=%s,bg=%s,%s]", fg[j], bg[j], attr[j]), r)
14091409+# return r
14101410+# }
14111411+# BEGIN {
14121412+# FS = "|"
14131413+# l1 = split(fg_, fg, ",")
14141414+# l2 = split(bg_, bg, ",")
14151415+# l3 = split(attr_, attr, ",")
14161416+# l = l1 < l2 ? (l1 < l3 ? l1 : l3) : (l2 < l3 ? l2 : l3)
14171417+# }
14181418+# {
14191419+# for (i = j = 1; i <= NF; ++i)
14201420+# {
14211421+# if (open_ || open || open__)
14221422+# printf "|%s", subsplit($i)
14231423+# else
14241424+# printf "#[fg=%s,bg=%s,none]%s#[fg=%s,bg=%s,%s]%s", bg[j], (i == 1) ? status_bg : bg[j_], mainsep, fg[j], bg[j], attr[j], subsplit($i)
14251425+#
14261426+# if (!open && !open_ && !open__)
14271427+# {
14281428+# j_ = j
14291429+# j = j % l + 1
14301430+# }
14311431+# }
14321432+# }')
14331433+# fi
14341434+# status_right=${status_right-}
14351435+#
14361436+# # -- clock ---------------------------------------------------------------
14371437+#
14381438+# tmux_conf_theme_clock_colour=${tmux_conf_theme_clock_colour:-$tmux_conf_theme_colour_4}
14391439+# tmux_conf_theme_clock_style=${tmux_conf_theme_clock_style:-24}
14401440+#
14411441+# tmux setw -g window-style "$window_style" \; setw -g window-active-style "$window_active_style" \;\
14421442+# setw -g pane-border-style "fg=$tmux_conf_theme_pane_border_fg,bg=$tmux_conf_theme_pane_border_bg" \; set -g pane-active-border-style "fg=$tmux_conf_theme_pane_active_border_fg,bg=$tmux_conf_theme_pane_active_border_bg" \;\
14431443+# set -g display-panes-colour "$tmux_conf_theme_pane_indicator" \; set -g display-panes-active-colour "$tmux_conf_theme_pane_active_indicator" \;\
14441444+# set -g message-style "fg=$tmux_conf_theme_message_fg,bg=$tmux_conf_theme_message_bg,$tmux_conf_theme_message_attr" \;\
14451445+# set -g message-command-style "fg=$tmux_conf_theme_message_command_fg,bg=$tmux_conf_theme_message_command_bg,$tmux_conf_theme_message_command_attr" \;\
14461446+# setw -g mode-style "fg=$tmux_conf_theme_mode_fg,bg=$tmux_conf_theme_mode_bg,$tmux_conf_theme_mode_attr" \;\
14471447+# set -g status-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\
14481448+# set -g status-left-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\
14491449+# set -g status-right-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\
14501450+# setw -g window-status-style "fg=$tmux_conf_theme_window_status_fg,bg=$tmux_conf_theme_window_status_bg,$tmux_conf_theme_window_status_attr" \;\
14511451+# setw -g window-status-current-style "fg=$tmux_conf_theme_window_status_current_fg,bg=$tmux_conf_theme_window_status_current_bg,$tmux_conf_theme_window_status_current_attr" \;\
14521452+# setw -g window-status-activity-style "fg=$tmux_conf_theme_window_status_activity_fg,bg=$tmux_conf_theme_window_status_activity_bg,$tmux_conf_theme_window_status_activity_attr" \;\
14531453+# setw -g window-status-bell-style "fg=$tmux_conf_theme_window_status_bell_fg,bg=$tmux_conf_theme_window_status_bell_bg,$tmux_conf_theme_window_status_bell_attr" \;\
14541454+# setw -g window-status-last-style "fg=$tmux_conf_theme_window_status_last_fg,bg=$tmux_conf_theme_window_status_last_bg,$tmux_conf_theme_window_status_last_attr" \;\
14551455+# setw -g window-status-separator "$window_status_separator" \;\
14561456+# setw -g clock-mode-colour "$tmux_conf_theme_clock_colour" \;\
14571457+# setw -g clock-mode-style "$tmux_conf_theme_clock_style"
14581458+# fi
14591459+#
14601460+# # -- variables -------------------------------------------------------------
14611461+#
14621462+# set_titles_string=$(printf '%s' "${tmux_conf_theme_terminal_title:-$(tmux show -gv set-titles-string)}" | sed \
14631463+# -e "s%#{circled_window_index}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#I')%g" \
14641464+# -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \
14651465+# -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \
14661466+# -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \
14671467+# -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \
14681468+# -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \
14691469+# -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \
14701470+# -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \
14711471+# -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g")
14721472+#
14731473+# window_status_format=$(printf '%s' "${window_status_format:-$(tmux show -gv window-status-format)}" | sed \
14741474+# -e "s%#{circled_window_index}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#I')%g" \
14751475+# -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \
14761476+# -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \
14771477+# -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \
14781478+# -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \
14791479+# -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \
14801480+# -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \
14811481+# -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \
14821482+# -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g")
14831483+#
14841484+# window_status_current_format=$(printf '%s' "${window_status_current_format:-$(tmux show -gv window-status-current-format)}" | sed \
14851485+# -e "s%#{circled_window_index}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#I')%g" \
14861486+# -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \
14871487+# -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \
14881488+# -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \
14891489+# -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \
14901490+# -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \
14911491+# -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \
14921492+# -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \
14931493+# -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g")
14941494+#
14951495+# status_left=$(printf '%s' "${status_left-$(tmux show -gv status-left)}" | sed \
14961496+# -e "s/#{pairing}/#{?session_many_attached,$tmux_conf_theme_pairing ,}/g" \
14971497+# -e "s/#{prefix}/#{?client_prefix,$tmux_conf_theme_prefix ,$(printf '%s' "$tmux_conf_theme_prefix" | sed -e 's/./ /g') }/g" \
14981498+# -e "s/#{mouse}/#{?mouse,$tmux_conf_theme_mouse ,$(printf '%s' "$tmux_conf_theme_mouse" | sed -e 's/./ /g') }/g" \
14991499+# -e "s%#{synchronized}%#{?pane_synchronized,$tmux_conf_theme_synchronized ,}%g" \
15001500+# -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \
15011501+# -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \
15021502+# -e "s%#{root}%#{?#{==:#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' '#D'),root},$tmux_conf_theme_root,}%g")
15031503+#
15041504+# status_right=$(printf '%s' "${status_right-$(tmux show -gv status-right)}" | sed \
15051505+# -e "s/#{pairing}/#{?session_many_attached,$tmux_conf_theme_pairing ,}/g" \
15061506+# -e "s/#{prefix}/#{?client_prefix,$tmux_conf_theme_prefix ,$(printf '%s' "$tmux_conf_theme_prefix" | sed -e 's/./ /g') }/g" \
15071507+# -e "s/#{mouse}/#{?mouse,$tmux_conf_theme_mouse ,$(printf '%s' "$tmux_conf_theme_mouse" | sed -e 's/./ /g') }/g" \
15081508+# -e "s%#{synchronized}%#{?pane_synchronized,$tmux_conf_theme_synchronized ,}%g" \
15091509+# -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \
15101510+# -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \
15111511+# -e "s%#{root}%#{?#{==:#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' '#D'),root},$tmux_conf_theme_root,}%g")
15121512+#
15131513+# tmux_conf_battery_bar_symbol_full=$(_decode_unicode_escapes "${tmux_conf_battery_bar_symbol_full:-◼}")
15141514+# tmux_conf_battery_bar_symbol_empty=$(_decode_unicode_escapes "${tmux_conf_battery_bar_symbol_empty:-◻}")
15151515+# tmux_conf_battery_bar_length=${tmux_conf_battery_bar_length:-auto}
15161516+# tmux_conf_battery_bar_palette=${tmux_conf_battery_bar_palette:-gradient}
15171517+# tmux_conf_battery_hbar_palette=${tmux_conf_battery_hbar_palette:-gradient}
15181518+# tmux_conf_battery_vbar_palette=${tmux_conf_battery_vbar_palette:-gradient}
15191519+# tmux_conf_battery_status_charging=$(_decode_unicode_escapes "${tmux_conf_battery_status_charging:-↑}") # U+2191
15201520+# tmux_conf_battery_status_discharging=$(_decode_unicode_escapes "${tmux_conf_battery_status_discharging:-↓}") # U+2193
15211521+#
15221522+# _pkillf 'sh -s _battery_info'
15231523+# _battery_info
15241524+# if [ "$battery_charge" != 0 ]; then
15251525+# case "$status_left $status_right" in
15261526+# *'#{battery_'*|*'#{?battery_'*)
15271527+# status_left=$(echo "$status_left" | sed -E \
15281528+# -e 's%#\{\?battery_bar%#\{?@battery_percentage%g' \
15291529+# -e 's%#\{\?battery_hbar%#\{?@battery_percentage%g' \
15301530+# -e 's%#\{\?battery_vbar%#\{?@battery_percentage%g' \
15311531+# -e "s%#\{battery_bar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _bar '$(printf '%s' "$tmux_conf_battery_bar_palette" | tr ',' ';')' '$tmux_conf_battery_bar_symbol_empty' '$tmux_conf_battery_bar_symbol_full' '$tmux_conf_battery_bar_length' '#{@battery_charge}' '#{client_width}')%g" \
15321532+# -e "s%#\{battery_hbar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _hbar '$(printf '%s' "$tmux_conf_battery_hbar_palette" | tr ',' ';')' '#{@battery_charge}')%g" \
15331533+# -e "s%#\{battery_vbar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _vbar '$(printf '%s' "$tmux_conf_battery_vbar_palette" | tr ',' ';')' '#{@battery_charge}')%g" \
15341534+# -e 's%#\{(\?)?battery_status%#\{\1@battery_status%g' \
15351535+# -e 's%#\{(\?)?battery_percentage%#\{\1@battery_percentage%g')
15361536+# status_right=$(echo "$status_right" | sed -E \
15371537+# -e 's%#\{\?battery_bar%#\{?@battery_percentage%g' \
15381538+# -e 's%#\{\?battery_hbar%#\{?@battery_percentage%g' \
15391539+# -e 's%#\{\?battery_vbar%#\{?@battery_percentage%g' \
15401540+# -e "s%#\{battery_bar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _bar '$(printf '%s' "$tmux_conf_battery_bar_palette" | tr ',' ';')' '$tmux_conf_battery_bar_symbol_empty' '$tmux_conf_battery_bar_symbol_full' '$tmux_conf_battery_bar_length' '#{@battery_charge}' '#{client_width}')%g" \
15411541+# -e "s%#\{battery_hbar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _hbar '$(printf '%s' "$tmux_conf_battery_hbar_palette" | tr ',' ';')' '#{@battery_charge}')%g" \
15421542+# -e "s%#\{battery_vbar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _vbar '$(printf '%s' "$tmux_conf_battery_vbar_palette" | tr ',' ';')' '#{@battery_charge}')%g" \
15431543+# -e 's%#\{(\?)?battery_status%#\{\1@battery_status%g' \
15441544+# -e 's%#\{(\?)?battery_percentage%#\{\1@battery_percentage%g')
15451545+# status_right="#(echo; nice cut -c3- '$TMUX_CONF' | sh -s _battery_status '$tmux_conf_battery_status_charging' '$tmux_conf_battery_status_discharging')$status_right"
15461546+# interval=60
15471547+# if [ "$_tmux_version" -eq 3500 ]; then
15481548+# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = \"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
15491549+# elif [ "$_tmux_version" -ge 3200 ]; then
15501550+# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
15511551+# elif [ "$_tmux_version" -ge 2800 ]; then
15521552+# status_right="#(echo; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right"
15531553+# elif [ "$_tmux_version" -gt 2400 ]; then
15541554+# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right"
15551555+# else
15561556+# status_right="#(nice cut -c3- '$TMUX_CONF' | sh -s _battery_info)$status_right"
15571557+# fi
15581558+# ;;
15591559+# esac
15601560+# fi
15611561+#
15621562+# case "$status_left $status_right" in
15631563+# *'#{username}'*|*'#{hostname}'*|*'#{hostname_full}'*|*'#{username_ssh}'*|*'#{hostname_ssh}'*|*'#{hostname_full_ssh}'*)
15641564+# status_left=$(echo "$status_left" | sed \
15651565+# -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \
15661566+# -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \
15671567+# -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \
15681568+# -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \
15691569+# -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \
15701570+# -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g")
15711571+# status_right=$(echo "$status_right" | sed \
15721572+# -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \
15731573+# -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \
15741574+# -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \
15751575+# -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \
15761576+# -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \
15771577+# -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g")
15781578+# ;;
15791579+# esac
15801580+#
15811581+# _pkillf 'sh -s _uptime'
15821582+# case "$status_left $status_right" in
15831583+# *'#{uptime_'*|*'#{?uptime_'*)
15841584+# status_left=$(echo "$status_left" | perl -p -e '
15851585+# ; s/#\{(\?)?uptime_y\b/#\{\1\@uptime_y/g
15861586+# ; s/#\{(\?)?uptime_d\b/#\{\1\@uptime_d/g
15871587+# ; s/\@uptime_d\b/\@uptime_dy/g if /\@uptime_y\b/
15881588+# ; s/#\{(\?)?uptime_h\b/#\{\1\@uptime_h/g
15891589+# ; s/#\{(\?)?uptime_m\b/#\{\1\@uptime_m/g
15901590+# ; s/#\{(\?)?uptime_s\b/#\{\1\@uptime_s/g')
15911591+# status_right=$(echo "$status_right" | perl -p -e '
15921592+# ; s/#\{(\?)?uptime_y\b/#\{\1\@uptime_y/g
15931593+# ; s/#\{(\?)?uptime_d\b/#\{\1\@uptime_d/g
15941594+# ; s/\@uptime_d\b/\@uptime_dy/g if /\@uptime_y\b/
15951595+# ; s/#\{(\?)?uptime_h\b/#\{\1\@uptime_h/g
15961596+# ; s/#\{(\?)?uptime_m\b/#\{\1\@uptime_m/g
15971597+# ; s/#\{(\?)?uptime_s\b/#\{\1\@uptime_s/g')
15981598+# interval=60
15991599+# case "$status_left $status_right" in
16001600+# *'#{@uptime_s}'*)
16011601+# interval=$(tmux show -gv status-interval)
16021602+# ;;
16031603+# esac
16041604+# if [ "$_tmux_version" -eq 3500 ]; then
16051605+# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = \"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
16061606+# elif [ "$_tmux_version" -ge 3200 ]; then
16071607+# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
16081608+# elif [ "$_tmux_version" -ge 2800 ]; then
16091609+# status_right="#(echo; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right"
16101610+# elif [ "$_tmux_version" -gt 2400 ]; then
16111611+# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right"
16121612+# else
16131613+# status_right="#(nice cut -c3- '$TMUX_CONF' | sh -s _uptime)$status_right"
16141614+# fi
16151615+# ;;
16161616+# esac
16171617+#
16181618+# _pkillf 'sh -s _loadavg'
16191619+# case "$status_left $status_right" in
16201620+# *'#{loadavg'*|*'#{?loadavg'*)
16211621+# status_left=$(echo "$status_left" | sed -E \
16221622+# -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g')
16231623+# status_right=$(echo "$status_right" | sed -E \
16241624+# -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g')
16251625+# interval=$(tmux show -gv status-interval)
16261626+# if [ "$_tmux_version" -eq 3500 ]; then
16271627+# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = \"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
16281628+# elif [ "$_tmux_version" -ge 3200 ]; then
16291629+# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
16301630+# elif [ "$_tmux_version" -ge 2800 ]; then
16311631+# status_right="#(echo; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right"
16321632+# elif [ "$_tmux_version" -gt 2400 ]; then
16331633+# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right"
16341634+# else
16351635+# status_right="#(nice cut -c3- '$TMUX_CONF' | sh -s _loadavg)$status_right"
16361636+# fi
16371637+# ;;
16381638+# esac
16391639+#
16401640+# # -- custom variables ------------------------------------------------------
16411641+#
16421642+# if [ -f "$TMUX_CONF_LOCAL" ] && [ "$(cut -c3- "$TMUX_CONF_LOCAL" | sh 2>/dev/null -s printf probe)" = "probe" ]; then
16431643+# replacements=$(perl -n -e 'print if s!^#\s+([^_][^()\s]+)\s*\(\)\s*{\s*(?:#.*)?\n!s%#\\\{\1((?:\\s+(?:[^\{\}]+?|#\\{(?:[^\{\}]+?)\}))*)\\\}%#(cut -c3- '"'"$TMUX_CONF_LOCAL"'"' | sh -s \1\\1)%g; !p' "$TMUX_CONF_LOCAL")
16441644+# status_left=$(echo "$status_left" | perl -p -e "$replacements" || echo "$status_left")
16451645+# status_right=$(echo "$status_right" | perl -p -e "$replacements" || echo "$status_right")
16461646+# fi
16471647+#
16481648+# # --------------------------------------------------------------------------
16491649+#
16501650+# tmux set -g set-titles-string "$(_decode_unicode_escapes "$set_titles_string")" \;\
16511651+# setw -g window-status-format "$(_decode_unicode_escapes "$window_status_format")" \;\
16521652+# setw -g window-status-current-format "$(_decode_unicode_escapes "$window_status_current_format")" \;\
16531653+# set -g status-left-length 1000 \; set -g status-left "$(_decode_unicode_escapes "$status_left")" \;\
16541654+# set -g status-right-length 1000 \; set -g status-right "$(_decode_unicode_escapes "$status_right")"
16551655+# }
16561656+#
16571657+# __apply_plugins() {
16581658+# TMUX_PLUGIN_MANAGER_PATH="$1"
16591659+# window_active="$2"
16601660+# tmux_conf_update_plugins_on_launch="$3"
16611661+# tmux_conf_update_plugins_on_reload="$4"
16621662+# tmux_conf_uninstall_plugins_on_reload="$5"
16631663+#
16641664+# if [ -z "$TMUX_PLUGIN_MANAGER_PATH" ]; then
16651665+# return 255
16661666+# fi
16671667+# mkdir -p "$TMUX_PLUGIN_MANAGER_PATH"
16681668+#
16691669+# __discover_plugins() (
16701670+# probe_socket="$(dirname "$TMUX_SOCKET")/tmux-discover-plugins-$$"
16711671+# TMUX_SOCKET="$probe_socket" tmux -f /dev/null start-server \; set-option exit-empty off
16721672+# ___discover_plugins() {
16731673+# depth=$((${depth:-0} + 1))
16741674+# IFS=${_IFS:-$IFS}
16751675+# [ "$depth" -le 100 ] || return
16761676+# for current_file in "$@"; do
16771677+# current_file="$(cd "${current_file%/*}" 2>/dev/null && pwd)/${current_file##*/}" || continue
16781678+# while IFS= read -r line; do
16791679+# if plugin=$(printf '%s\n' "$line" | perl -s -n -E 'print if s/^set-option\s+-g\s+\@plugin\s+//g or die' 2>/dev/null); then
16801680+# discovered_plugins="${discovered_plugins}${discovered_plugins:+ }${plugin}"
16811681+# elif next_files=$(printf '%s\n' "$line" | perl -s -n -E 's/(?<!\@)current_file/\@current_file/g ; print if s/^source(?:-file)?(?:\s+-[qF]+)*\s*(.+?)$/\1/g or die' 2>/dev/null); then
16821682+# next_files=$(TMUX_SOCKET="$probe_socket" tmux -f /dev/null \
16831683+# set -g @current_file "$current_file" \; \
16841684+# display -pF "$next_files")
16851685+#
16861686+# _IFS="$IFS"
16871687+# IFS=$(printf '\n\nx')
16881688+# IFS=${IFS%?}
16891689+# # we don't want quoting here as we want wildcard expansion
16901690+# # shellcheck disable=SC2046
16911691+# ___discover_plugins $(printf '%s\n' "$next_files" | xargs printf '%s\n\n')
16921692+# fi
16931693+# done << EOF
16941694+# $(TMUX_SOCKET="$probe_socket" tmux -f /dev/null source -nvq "$current_file" | perl -s -n -E 'print if s/^$current_file:\d+:\s*(set-option\s+-g\s+\@plugin\s+|source-file)/\1/g' -- -current_file="$current_file")
16951695+# EOF
16961696+# done
16971697+# }
16981698+# ___discover_plugins "$@"
16991699+# TMUX_SOCKET="$probe_socket" tmux -f /dev/null kill-server
17001700+# rm -rf "$probe_socket"
17011701+# printf '%s\n' "$discovered_plugins"
17021702+# )
17031703+#
17041704+# tpm_plugins=$(tmux show -gvq '@tpm_plugins' 2>/dev/null)
17051705+# tpm_plugins=$(cat << EOF | tr ' ' '\n' | awk '/^\s*$/ {next;}; !seen[$0]++ { gsub(/^[ \t]+/,"",$0); gsub(/[ \t]+$/,"",$0); print $0 }'
17061706+# $tpm_plugins
17071707+# $(__discover_plugins "$TMUX_CONF_LOCAL")
17081708+# EOF
17091709+# )
17101710+# if [ -z "$tpm_plugins" ]; then
17111711+# if _is_true "$tmux_conf_uninstall_plugins_on_reload" && [ -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then
17121712+# tmux display 'Uninstalling tpm and plugins...'
17131713+# tmux set-environment -gu TMUX_PLUGIN_MANAGER_PATH
17141714+# rm -rf "$TMUX_PLUGIN_MANAGER_PATH"
17151715+# tmux display 'Done uninstalling tpm and plugins...'
17161716+# fi
17171717+# else
17181718+# if [ "$(command tmux display -p '#{pid} #{version} #{socket_path}')" = "$("$TMUX_PROGRAM" display -p '#{pid} #{version} #{socket_path}')" ]; then
17191719+# tmux set-environment -g TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGIN_MANAGER_PATH"
17201720+# tmux set -g '@tpm_plugins' "$tpm_plugins"
17211721+#
17221722+# if [ -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then
17231723+# [ -z "$(tmux show -gqv '@tpm-install')" ] && tmux set -g '@tpm-install' 'I'
17241724+# [ -z "$(tmux show -gqv '@tpm-update')" ] && tmux set -g '@tpm-update' 'u'
17251725+# [ -z "$(tmux show -gqv '@tpm-clean')" ] && tmux set -g '@tpm-clean' 'M-u'
17261726+# "$TMUX_PLUGIN_MANAGER_PATH/tpm/tpm" || tmux display "One or more tpm plugin(s) failed"
17271727+# fi
17281728+#
17291729+# if git ls-remote -hq https://github.com/gpakosz/.tmux.git master > /dev/null; then
17301730+# if [ ! -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then
17311731+# install_tpm=true
17321732+# tmux display 'Installing tpm and plugins...'
17331733+# git clone --depth 1 https://github.com/tmux-plugins/tpm "$TMUX_PLUGIN_MANAGER_PATH/tpm"
17341734+# elif { [ -z "$window_active" ] && _is_true "$tmux_conf_update_plugins_on_launch"; } || { [ -n "$window_active" ] && _is_true "$tmux_conf_update_plugins_on_reload"; }; then
17351735+# update_tpm=true
17361736+# tmux display 'Updating tpm and plugins...'
17371737+# (cd "$TMUX_PLUGIN_MANAGER_PATH/tpm" && git fetch -q -p && git checkout -q master && git reset -q --hard origin/master)
17381738+# fi
17391739+# if [ "$install_tpm" = "true" ] || [ "$update_tpm" = "true" ]; then
17401740+# perl -0777 -p -i -e 's/git clone(?!\s+--depth\s+1)/git clone --depth 1/g
17411741+# ;s/(install_plugin(.(?!&))*)\n(\s+)done/\1&\n\3done\n\3wait/g' "$TMUX_PLUGIN_MANAGER_PATH/tpm/scripts/install_plugins.sh"
17421742+# perl -p -i -e 's/git submodule update --init --recursive(?!\s+--depth\s+1)/git submodule update --init --recursive --depth 1/g' "$TMUX_PLUGIN_MANAGER_PATH/tpm/scripts/update_plugin.sh"
17431743+# perl -p -i -e 's,\$tmux_file\s+>/dev/null\s+2>\&1,$& || { tmux display "Plugin \$(basename \${plugin_path}) failed" && false; },' "$TMUX_PLUGIN_MANAGER_PATH/tpm/scripts/source_plugins.sh"
17441744+# fi
17451745+# if [ "$update_tpm" = "true" ]; then
17461746+# {
17471747+# {
17481748+# printf 'List of discovered tpm plugins: %s\n' "$(printf '%s\n' "$tpm_plugins" | paste -s -d ' ' -)" | _timestamp
17491749+# printf '%s\n' "Invoking $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins" | _timestamp
17501750+# "$TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins" 2>&1 | _timestamp
17511751+# printf '%s\n' "Invoking $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/update_plugins all" | _timestamp
17521752+# "$TMUX_PLUGIN_MANAGER_PATH/tpm/bin/update_plugins" all 2>&1 | _timestamp
17531753+# printf '%s\n' "Invoking $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/clean_plugins all" | _timestamp
17541754+# "$TMUX_PLUGIN_MANAGER_PATH/tpm/bin/clean_plugins" all 2>&1 | _timestamp
17551755+# cut -c3- "$TMUX_CONF" | sh -s _apply_important
17561756+# printf 'Done.\n' | _timestamp
17571757+# printf '\n'
17581758+# } >> "$TMUX_PLUGIN_MANAGER_PATH/tpm_log.txt"
17591759+#
17601760+# tmux display 'Done updating tpm and plugins...'
17611761+# } || tmux display 'Failed updating tpm and plugins...'
17621762+# elif [ "$install_tpm" = "true" ]; then
17631763+# {
17641764+# {
17651765+# printf 'List of discovered tpm plugins: %s\n' "$(printf '%s\n' "$tpm_plugins" | paste -s -d ' ' -)" | _timestamp
17661766+# printf '%s\n' "Invoking $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins" | _timestamp
17671767+# "$TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins" 2>&1 | _timestamp
17681768+# cut -c3- "$TMUX_CONF" | sh -s _apply_important
17691769+# printf 'Done.\n' | _timestamp
17701770+# printf '\n' >> "$TMUX_PLUGIN_MANAGER_PATH/tpm_log.txt"
17711771+# } >> "$TMUX_PLUGIN_MANAGER_PATH/tpm_log.txt"
17721772+#
17731773+# tmux display 'Done installing tpm and plugins...'
17741774+#
17751775+# [ -z "$(tmux show -gqv '@tpm-install')" ] && tmux set -g '@tpm-install' 'I'
17761776+# [ -z "$(tmux show -gqv '@tpm-update')" ] && tmux set -g '@tpm-update' 'u'
17771777+# [ -z "$(tmux show -gqv '@tpm-clean')" ] && tmux set -g '@tpm-clean' 'M-u'
17781778+# "$TMUX_PLUGIN_MANAGER_PATH/tpm/tpm" || tmux display "One or more tpm plugin(s) failed"
17791779+# } || tmux display 'Failed installing tpm and plugins...'
17801780+# fi
17811781+# else
17821782+# tmux display "GitHub doesn't seem to be reachable, skipping installing and/or updating tpm and plugins..."
17831783+# fi
17841784+# else
17851785+# if [ "$_tmux_version" -ge 3200 ]; then
17861786+# tmux run -b "exec sh -c 'sleep \$((#{display-time} / 1000)) && \"$TMUX_PROGRAM\" display -N -d 3000 \"Cannot use tpm which assumes a globally installed tmux\"'"
17871787+# else
17881788+# tmux run -b "exec sh -c 'sleep \$((#{display-time} / 1000)) && \"$TMUX_PROGRAM\" set display-time 3000 \; display \"Cannot use tpm which assumes a globally installed tmux\" \; set -u display-time'"
17891789+# fi
17901790+# fi
17911791+#
17921792+# if [ "$_tmux_version" -gt 2600 ]; then
17931793+# tmux set -gu '@tpm-install' \; set -gu '@tpm-update' \; set -gu '@tpm-clean' \; set -gu '@plugin' \; set -gu '@tpm_plugins'
17941794+# else
17951795+# tmux set -g '@tpm-install' '' \; set -g '@tpm-update' '' \; set -g '@tpm-clean' '' \; set -g '@plugin' '' \; set-gu '@tpm_plugins' ''
17961796+# fi
17971797+# fi
17981798+# }
17991799+#
18001800+# _apply_plugins() {
18011801+# tmux_conf_update_plugins_on_launch=${tmux_conf_update_plugins_on_launch:-true}
18021802+# tmux_conf_update_plugins_on_reload=${tmux_conf_update_plugins_on_reload:-true}
18031803+# tmux_conf_uninstall_plugins_on_reload=${tmux_conf_uninstall_plugins_on_reload:-true}
18041804+#
18051805+# if [ -z "$TMUX_PLUGIN_MANAGER_PATH" ]; then
18061806+# if [ "$(dirname "$TMUX_CONF")" = "$HOME" ]; then
18071807+# TMUX_PLUGIN_MANAGER_PATH="$HOME/.tmux/plugins"
18081808+# else
18091809+# TMUX_PLUGIN_MANAGER_PATH="$(dirname "$TMUX_CONF")/plugins"
18101810+# fi
18111811+# fi
18121812+# tmux run -b "cut -c3- '$TMUX_CONF' | sh -s __apply_plugins '$TMUX_PLUGIN_MANAGER_PATH' '$window_active' '$tmux_conf_update_plugins_on_launch' '$tmux_conf_update_plugins_on_reload' '$tmux_conf_uninstall_plugins_on_reload'"
18131813+# }
18141814+#
18151815+# _apply_important() {
18161816+# cfg=$(mktemp) && trap 'rm -f $cfg*' EXIT
18171817+#
18181818+# if perl -n -e 'print if /^\s*(?:set|bind|unbind).+?#!important\s*$/' "$TMUX_CONF_LOCAL" 2>/dev/null > "$cfg.local"; then
18191819+# if ! tmux source-file "$cfg.local"; then
18201820+# if tmux source-file -v /dev/null 2> /dev/null; then
18211821+# verbose_flag='-v'
18221822+# fi
18231823+# while ! out=$(tmux source-file "${verbose_flag:+$verbose_flag}" "$cfg.local"); do
18241824+# line=$(printf "%s" "$out" | tail -1 | cut -d':' -f2)
18251825+# perl -n -i -e "if ($. != $line) { print }" "$cfg.local"
18261826+# done
18271827+# fi
18281828+# fi
18291829+# }
18301830+#
18311831+# _apply_configuration() {
18321832+# window_active="$(tmux display -p '#{window_active}' 2>/dev/null || true)"
18331833+# if [ -z "$window_active" ]; then
18341834+# if [ "$_tmux_version" -lt 2600 ]; then
18351835+# tmux run -b 'tmux set display-time 3000 \; display "This configuration requires tmux 2.6+" \; set -u display-time \; run "sleep 3" \; kill-server'
18361836+# return
18371837+# fi
18381838+# if [ "$_tmux_version" -ge 3200 ]; then
18391839+# for cmd in perl sed awk; do
18401840+# if ! command -v "$cmd" > /dev/null 2>&1; then
18411841+# tmux run -b "tmux display -N -d 3000 'This configuration requires $cmd' \; run 'sleep 3' \; kill-server"
18421842+# return
18431843+# fi
18441844+# done
18451845+# else
18461846+# for cmd in perl sed awk; do
18471847+# if ! command -v "$cmd" > /dev/null 2>&1; then
18481848+# tmux run -b "tmux set display-time 3000 \; display 'This configuration requires $cmd' \; set -u display-time \; run 'sleep 3' \; kill-server"
18491849+# return
18501850+# fi
18511851+# done
18521852+# fi
18531853+# fi
18541854+#
18551855+# case "$_uname_s" in
18561856+# *CYGWIN*|*MSYS*)
18571857+# # prevent Cygwin and MSYS2 from cd-ing into home directory when evaluating /etc/profile
18581858+# tmux setenv -g CHERE_INVOKING 1
18591859+# ;;
18601860+# esac
18611861+#
18621862+# _apply_tmux_256color
18631863+# _apply_24b&
18641864+# _apply_theme&
18651865+# _apply_bindings&
18661866+# wait
18671867+#
18681868+# _apply_plugins
18691869+# _apply_important
18701870+#
18711871+# # shellcheck disable=SC2046
18721872+# tmux setenv -gu tmux_conf_dummy $(printenv | grep -E -o '^tmux_conf_[^=]+' | awk '{printf "; setenv -gu %s", $0}')
18731873+# }
18741874+#
18751875+# _urlview() {
18761876+# pane_id="$1"; shift
18771877+# tmux capture-pane -J -S - -E - -b "urlview-$pane_id" -t "$pane_id"
18781878+# tmux split-window "'$TMUX_PROGRAM' ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} show-buffer -b 'urlview-$pane_id' | urlview || true; '$TMUX_PROGRAM' ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} delete-buffer -b 'urlview-$pane_id'"
18791879+# }
18801880+#
18811881+# _urlscan() {
18821882+# pane_id="$1"; shift
18831883+# tmux capture-pane -J -S - -E - -b "urlscan-$pane_id" -t "$pane_id"
18841884+# tmux split-window "'$TMUX_PROGRAM' ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} show-buffer -b 'urlscan-$pane_id' | urlscan $* || true; '$TMUX_PROGRAM' ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} delete-buffer -b 'urlscan-$pane_id'"
18851885+# }
18861886+#
18871887+# _fpp() {
18881888+# tmux capture-pane -J -S - -E - -b "fpp-$1" -t "$1"
18891889+# tmux split-window -c "$2" "'$TMUX_PROGRAM' ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} show-buffer -b 'fpp-$1' | fpp || true; '$TMUX_PROGRAM' ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} delete-buffer -b 'fpp-$1'"
18901890+# }
18911891+#
18921892+# "$@"
+508
.tmux.conf.local
···11+# : << 'EOF'
22+# Oh my tmux!
33+# 💛🩷💙🖤❤️🤍
44+# https://github.com/gpakosz/.tmux
55+# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
66+# without any warranty.
77+# Copyright 2012— Gregory Pakosz (@gpakosz).
88+99+1010+# -- bindings ------------------------------------------------------------------
1111+1212+# preserve tmux stock bindings,
1313+# while adding bindings that don't conflict with these stock bindings
1414+# /!\ this disables some of Oh my tmux! bindings described in README.md
1515+# - true
1616+# - false (default)
1717+tmux_conf_preserve_stock_bindings=false
1818+1919+2020+# -- session creation ----------------------------------------------------------
2121+2222+# prompt for session name when creating a new session, possible values are:
2323+# - true
2424+# - false (default)
2525+# - disabled (do not modify new-session bindings)
2626+tmux_conf_new_session_prompt=false
2727+2828+# new session retains current path, possible values are:
2929+# - true
3030+# - false (default)
3131+# - disabled (do not modify new-session bindings)
3232+tmux_conf_new_session_retain_current_path=false
3333+3434+3535+# -- windows & pane creation ---------------------------------------------------
3636+3737+# new window retains current path, possible values are:
3838+# - true
3939+# - false (default)
4040+# - disabled (do not modify new-window bindings)
4141+tmux_conf_new_window_retain_current_path=false
4242+4343+# new window tries to reconnect ssh sessions, possible values are:
4444+# - true
4545+# - false (default)
4646+# - disabled (do not modify new-window bindings)
4747+tmux_conf_new_window_reconnect_ssh=false
4848+4949+# new pane retains current path, possible values are:
5050+# - true (default)
5151+# - false
5252+# - disabled (do not modify split-window bindings)
5353+tmux_conf_new_pane_retain_current_path=true
5454+5555+# new pane tries to reconnect ssh sessions, possible values are:
5656+# - true
5757+# - false (default)
5858+# - disabled (do not modify split-window bindings)
5959+tmux_conf_new_pane_reconnect_ssh=false
6060+6161+6262+# -- display -------------------------------------------------------------------
6363+6464+# RGB 24-bit colour support, possible values are:
6565+# - true
6666+# - false
6767+# - auto (default)
6868+#
6969+# automatic detection relies on the COLORTERM environment variable being defined
7070+# to 'truecolor' or '24bit' or '$ tput colors' answering '16777216'
7171+# see https://github.com/termstandard/colors
7272+tmux_conf_24b_colour=auto
7373+7474+7575+# -- theming -------------------------------------------------------------------
7676+7777+# enable or disable theming:
7878+# - enabled (default)
7979+# - disabled
8080+# when disabled, all tmux_conf_theme_xxx variables are ignored except:
8181+# - tmux_conf_theme_pairing
8282+# - tmux_conf_theme_prefix
8383+# - tmux_conf_theme_mouse
8484+# - tmux_conf_theme_root
8585+# - tmux_conf_theme_synchronized
8686+tmux_conf_theme=enabled
8787+8888+# default theme
8989+tmux_conf_theme_colour_1="#080808" # dark gray
9090+tmux_conf_theme_colour_2="#303030" # gray
9191+tmux_conf_theme_colour_3="#8a8a8a" # light gray
9292+tmux_conf_theme_colour_4="#00afff" # light blue
9393+tmux_conf_theme_colour_5="#ffff00" # yellow
9494+tmux_conf_theme_colour_6="#080808" # dark gray
9595+tmux_conf_theme_colour_7="#e4e4e4" # white
9696+tmux_conf_theme_colour_8="#080808" # dark gray
9797+tmux_conf_theme_colour_9="#ffff00" # yellow
9898+tmux_conf_theme_colour_10="#ff00af" # pink
9999+tmux_conf_theme_colour_11="#5fff00" # green
100100+tmux_conf_theme_colour_12="#8a8a8a" # light gray
101101+tmux_conf_theme_colour_13="#e4e4e4" # white
102102+tmux_conf_theme_colour_14="#080808" # dark gray
103103+tmux_conf_theme_colour_15="#080808" # dark gray
104104+tmux_conf_theme_colour_16="#d70000" # red
105105+tmux_conf_theme_colour_17="#e4e4e4" # white
106106+107107+# default theme (ansi)
108108+#tmux_conf_theme_colour_1="colour0"
109109+#tmux_conf_theme_colour_2="colour8"
110110+#tmux_conf_theme_colour_3="colour8"
111111+#tmux_conf_theme_colour_4="colour14"
112112+#tmux_conf_theme_colour_5="colour11"
113113+#tmux_conf_theme_colour_6="colour0"
114114+#tmux_conf_theme_colour_7="colour15"
115115+#tmux_conf_theme_colour_8="colour0"
116116+#tmux_conf_theme_colour_9="colour11"
117117+#tmux_conf_theme_colour_10="colour13"
118118+#tmux_conf_theme_colour_11="colour10"
119119+#tmux_conf_theme_colour_12="colour8"
120120+#tmux_conf_theme_colour_13="colour15"
121121+#tmux_conf_theme_colour_14="colour0"
122122+#tmux_conf_theme_colour_15="colour0"
123123+#tmux_conf_theme_colour_16="colour1"
124124+#tmux_conf_theme_colour_17="colour15"
125125+126126+# window style
127127+tmux_conf_theme_window_fg="default"
128128+tmux_conf_theme_window_bg="default"
129129+130130+# highlight focused pane, possible values are:
131131+# - true
132132+# - false (default)
133133+tmux_conf_theme_highlight_focused_pane=false
134134+135135+# focused pane colours:
136136+tmux_conf_theme_focused_pane_bg="$tmux_conf_theme_colour_2"
137137+138138+# pane border style, possible values are:
139139+# - thin (default)
140140+# - fat
141141+tmux_conf_theme_pane_border_style=thin
142142+143143+# pane borders colours:
144144+tmux_conf_theme_pane_border="$tmux_conf_theme_colour_2"
145145+tmux_conf_theme_pane_active_border="$tmux_conf_theme_colour_4"
146146+%if #{>=:#{version},3.2}
147147+tmux_conf_theme_pane_active_border="#{?pane_in_mode,$tmux_conf_theme_colour_9,#{?synchronize-panes,$tmux_conf_theme_colour_16,$tmux_conf_theme_colour_4}}"
148148+%endif
149149+150150+# pane indicator colours (when you hit <prefix> + q)
151151+tmux_conf_theme_pane_indicator="$tmux_conf_theme_colour_4"
152152+tmux_conf_theme_pane_active_indicator="$tmux_conf_theme_colour_4"
153153+154154+# status line style
155155+tmux_conf_theme_message_fg="$tmux_conf_theme_colour_1"
156156+tmux_conf_theme_message_bg="$tmux_conf_theme_colour_5"
157157+tmux_conf_theme_message_attr="bold"
158158+159159+# status line command style (<prefix> : Escape)
160160+tmux_conf_theme_message_command_fg="$tmux_conf_theme_colour_5"
161161+tmux_conf_theme_message_command_bg="$tmux_conf_theme_colour_1"
162162+tmux_conf_theme_message_command_attr="bold"
163163+164164+# window modes style
165165+tmux_conf_theme_mode_fg="$tmux_conf_theme_colour_1"
166166+tmux_conf_theme_mode_bg="$tmux_conf_theme_colour_5"
167167+tmux_conf_theme_mode_attr="bold"
168168+169169+# status line style
170170+tmux_conf_theme_status_fg="$tmux_conf_theme_colour_3"
171171+tmux_conf_theme_status_bg="$tmux_conf_theme_colour_1"
172172+tmux_conf_theme_status_attr="none"
173173+174174+# terminal title
175175+# - built-in variables are:
176176+# - #{circled_window_index}
177177+# - #{circled_session_name}
178178+# - #{hostname}
179179+# - #{hostname_ssh}
180180+# - #{hostname_full}
181181+# - #{hostname_full_ssh}
182182+# - #{username}
183183+# - #{username_ssh}
184184+tmux_conf_theme_terminal_title="#h ❐ #S ● #I #W"
185185+186186+# window status style
187187+# - built-in variables are:
188188+# - #{circled_window_index}
189189+# - #{circled_session_name}
190190+# - #{hostname}
191191+# - #{hostname_ssh}
192192+# - #{hostname_full}
193193+# - #{hostname_full_ssh}
194194+# - #{username}
195195+# - #{username_ssh}
196196+tmux_conf_theme_window_status_fg="$tmux_conf_theme_colour_3"
197197+tmux_conf_theme_window_status_bg="$tmux_conf_theme_colour_1"
198198+tmux_conf_theme_window_status_attr="none"
199199+tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
200200+#tmux_conf_theme_window_status_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
201201+#tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
202202+203203+# window current status style
204204+# - built-in variables are:
205205+# - #{circled_window_index}
206206+# - #{circled_session_name}
207207+# - #{hostname}
208208+# - #{hostname_ssh}
209209+# - #{hostname_full}
210210+# - #{hostname_full_ssh}
211211+# - #{username}
212212+# - #{username_ssh}
213213+tmux_conf_theme_window_status_current_fg="$tmux_conf_theme_colour_1"
214214+tmux_conf_theme_window_status_current_bg="$tmux_conf_theme_colour_4"
215215+tmux_conf_theme_window_status_current_attr="bold"
216216+tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
217217+#tmux_conf_theme_window_status_current_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}"
218218+#tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
219219+220220+# window activity status style
221221+tmux_conf_theme_window_status_activity_fg="default"
222222+tmux_conf_theme_window_status_activity_bg="default"
223223+tmux_conf_theme_window_status_activity_attr="underscore"
224224+225225+# window bell status style
226226+tmux_conf_theme_window_status_bell_fg="$tmux_conf_theme_colour_5"
227227+tmux_conf_theme_window_status_bell_bg="default"
228228+tmux_conf_theme_window_status_bell_attr="blink,bold"
229229+230230+# window last status style
231231+tmux_conf_theme_window_status_last_fg="$tmux_conf_theme_colour_4"
232232+tmux_conf_theme_window_status_last_bg="$tmux_conf_theme_colour_2"
233233+tmux_conf_theme_window_status_last_attr="none"
234234+235235+# status left/right sections separators
236236+tmux_conf_theme_left_separator_main=""
237237+tmux_conf_theme_left_separator_sub="|"
238238+tmux_conf_theme_right_separator_main=""
239239+tmux_conf_theme_right_separator_sub="|"
240240+#tmux_conf_theme_left_separator_main='\uE0B0' # /!\ you don't need to install Powerline
241241+#tmux_conf_theme_left_separator_sub='\uE0B1' # you only need fonts patched with
242242+#tmux_conf_theme_right_separator_main='\uE0B2' # Powerline symbols or the standalone
243243+#tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see README.md
244244+245245+# status left/right content:
246246+# - separate main sections with "|"
247247+# - separate subsections with ","
248248+# - built-in variables are:
249249+# - #{battery_bar}
250250+# - #{battery_hbar}
251251+# - #{battery_percentage}
252252+# - #{battery_status}
253253+# - #{battery_vbar}
254254+# - #{circled_session_name}
255255+# - #{hostname_ssh}
256256+# - #{hostname}
257257+# - #{hostname_full}
258258+# - #{hostname_full_ssh}
259259+# - #{loadavg}
260260+# - #{mouse}
261261+# - #{pairing}
262262+# - #{prefix}
263263+# - #{root}
264264+# - #{synchronized}
265265+# - #{uptime_y}
266266+# - #{uptime_d} (modulo 365 when #{uptime_y} is used)
267267+# - #{uptime_h}
268268+# - #{uptime_m}
269269+# - #{uptime_s}
270270+# - #{username}
271271+# - #{username_ssh}
272272+tmux_conf_theme_status_left=" ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} "
273273+#tmux_conf_theme_status_left=" ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} | #{pretty_pane_current_path} "
274274+tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized}#{?battery_status,#{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} "
275275+276276+# status left style
277277+tmux_conf_theme_status_left_fg="$tmux_conf_theme_colour_6,$tmux_conf_theme_colour_7,$tmux_conf_theme_colour_8"
278278+tmux_conf_theme_status_left_bg="$tmux_conf_theme_colour_9,$tmux_conf_theme_colour_10,$tmux_conf_theme_colour_11"
279279+tmux_conf_theme_status_left_attr="bold,none,none"
280280+281281+# status right style
282282+tmux_conf_theme_status_right_fg="$tmux_conf_theme_colour_12,$tmux_conf_theme_colour_13,$tmux_conf_theme_colour_14"
283283+tmux_conf_theme_status_right_bg="$tmux_conf_theme_colour_15,$tmux_conf_theme_colour_16,$tmux_conf_theme_colour_17"
284284+tmux_conf_theme_status_right_attr="none,none,bold"
285285+286286+# pairing indicator
287287+tmux_conf_theme_pairing="⚇" # U+2687
288288+tmux_conf_theme_pairing_fg="none"
289289+tmux_conf_theme_pairing_bg="none"
290290+tmux_conf_theme_pairing_attr="none"
291291+292292+# prefix indicator
293293+tmux_conf_theme_prefix="⌨" # U+2328
294294+tmux_conf_theme_prefix_fg="none"
295295+tmux_conf_theme_prefix_bg="none"
296296+tmux_conf_theme_prefix_attr="none"
297297+298298+# mouse indicator
299299+tmux_conf_theme_mouse="↗" # U+2197
300300+tmux_conf_theme_mouse_fg="none"
301301+tmux_conf_theme_mouse_bg="none"
302302+tmux_conf_theme_mouse_attr="none"
303303+304304+# root indicator
305305+tmux_conf_theme_root="!"
306306+tmux_conf_theme_root_fg="none"
307307+tmux_conf_theme_root_bg="none"
308308+tmux_conf_theme_root_attr="bold,blink"
309309+310310+# synchronized indicator
311311+tmux_conf_theme_synchronized="⚏" # U+268F
312312+tmux_conf_theme_synchronized_fg="none"
313313+tmux_conf_theme_synchronized_bg="none"
314314+tmux_conf_theme_synchronized_attr="none"
315315+316316+# battery bar symbols
317317+tmux_conf_battery_bar_symbol_full="◼"
318318+tmux_conf_battery_bar_symbol_empty="◻"
319319+#tmux_conf_battery_bar_symbol_full="♥"
320320+#tmux_conf_battery_bar_symbol_empty="·"
321321+322322+# battery bar length (in number of symbols), possible values are:
323323+# - auto
324324+# - a number, e.g. 5
325325+tmux_conf_battery_bar_length="auto"
326326+327327+# battery bar palette, possible values are:
328328+# - gradient (default)
329329+# - heat
330330+# - "colour_full_fg,colour_empty_fg,colour_bg"
331331+# - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n)
332332+tmux_conf_battery_bar_palette="gradient"
333333+#tmux_conf_battery_bar_palette="#d70000,#e4e4e4,#000000" # red, white, black
334334+#tmux_conf_battery_bar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)"
335335+336336+# battery hbar palette, possible values are:
337337+# - gradient (default)
338338+# - heat
339339+# - "colour_low,colour_half,colour_full"
340340+# - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n)
341341+tmux_conf_battery_hbar_palette="gradient"
342342+#tmux_conf_battery_hbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green
343343+#tmux_conf_battery_hbar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)"
344344+345345+# battery vbar palette, possible values are:
346346+# - gradient (default)
347347+# - heat
348348+# - "colour_low,colour_half,colour_full"
349349+# - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n)
350350+tmux_conf_battery_vbar_palette="gradient"
351351+#tmux_conf_battery_vbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green
352352+#tmux_conf_battery_vbar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)"
353353+354354+# symbols used to indicate whether battery is charging or discharging
355355+tmux_conf_battery_status_charging="↑" # U+2191
356356+tmux_conf_battery_status_discharging="↓" # U+2193
357357+#tmux_conf_battery_status_charging="🔌" # U+1F50C
358358+#tmux_conf_battery_status_discharging="🔋" # U+1F50B
359359+360360+# clock style (when you hit <prefix> + t)
361361+# you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right
362362+tmux_conf_theme_clock_colour="$tmux_conf_theme_colour_4"
363363+tmux_conf_theme_clock_style="24"
364364+365365+366366+# -- clipboard -----------------------------------------------------------------
367367+368368+# in copy mode, copying selection also copies to the OS clipboard
369369+# - true
370370+# - false (default)
371371+# - disabled
372372+# on Linux, this requires xsel, xclip or wl-copy
373373+tmux_conf_copy_to_os_clipboard=false
374374+375375+376376+# -- urlscan -------------------------------------------------------------------
377377+378378+# options passed to urlscan
379379+tmux_conf_urlscan_options="--compact --dedupe"
380380+381381+382382+# -- user customizations -------------------------------------------------------
383383+384384+# this is the place to override or undo settings
385385+386386+# increase history size
387387+#set -g history-limit 10000
388388+389389+# start with mouse mode enabled
390390+#set -g mouse on
391391+392392+# force Vi mode
393393+# really you should export VISUAL or EDITOR environment variable, see manual
394394+#set -g status-keys vi
395395+#set -g mode-keys vi
396396+397397+# replace C-b by C-a instead of using both prefixes
398398+# set -gu prefix2
399399+# unbind C-a
400400+# unbind C-b
401401+# set -g prefix C-a
402402+# bind C-a send-prefix
403403+404404+# if you don't want Oh my tmux! to alter a binding or a setting, use #!important
405405+# bind c new-window -c '#{pane_current_path}' #!important
406406+407407+# display a message after toggling mouse support
408408+bind m run "cut -c3- '#{TMUX_CONF}' | sh -s _toggle_mouse" \; display 'mouse #{?#{mouse},on,off}'
409409+410410+# move status line to top
411411+#set -g status-position top
412412+413413+414414+# -- tpm -----------------------------------------------------------------------
415415+416416+# while I don't use tpm myself, many people requested official support so here
417417+# is a seamless integration that automatically installs plugins in parallel
418418+419419+# whenever a plugin introduces a variable to be used in 'status-left' or
420420+# 'status-right', you can use it in 'tmux_conf_theme_status_left' and
421421+# 'tmux_conf_theme_status_right' variables.
422422+423423+# by default, launching tmux will update tpm and all plugins
424424+# - true (default)
425425+# - false
426426+tmux_conf_update_plugins_on_launch=true
427427+428428+# by default, reloading the configuration will update tpm and all plugins
429429+# - true (default)
430430+# - false
431431+tmux_conf_update_plugins_on_reload=true
432432+433433+# by default, reloading the configuration will uninstall tpm and plugins when no
434434+# plugins are enabled
435435+# - true (default)
436436+# - false
437437+tmux_conf_uninstall_plugins_on_reload=true
438438+439439+# /!\ the tpm bindings differ slightly from upstream:
440440+# - installing plugins: <prefix> + I
441441+# - uninstalling plugins: <prefix> + Alt + u
442442+# - updating plugins: <prefix> + u
443443+444444+# /!\ do not add set -g @plugin 'tmux-plugins/tpm'
445445+# /!\ do not add run '~/.tmux/plugins/tpm/tpm'
446446+447447+# to enable a plugin, use the 'set -g @plugin' syntax:
448448+# visit https://github.com/tmux-plugins for available plugins
449449+#set -g @plugin 'tmux-plugins/tmux-copycat'
450450+#set -g @plugin 'tmux-plugins/tmux-cpu'
451451+#set -g @plugin 'tmux-plugins/tmux-resurrect'
452452+#set -g @plugin 'tmux-plugins/tmux-continuum'
453453+#set -g @continuum-restore 'on'
454454+455455+456456+# -- custom variables ----------------------------------------------------------
457457+458458+# to define a custom #{foo} variable, define a POSIX shell function between the
459459+# '# EOF' and the '# "$@"' lines. Please note that the opening brace { character
460460+# must be on the same line as the function name otherwise the parse won't detect
461461+# it.
462462+#
463463+# then, use #{foo} in e.g. the 'tmux_conf_theme_status_left' or the
464464+# 'tmux_conf_theme_status_right' variables.
465465+466466+# ------------------------------------------------------------------------------
467467+468468+# # /!\ do not remove the following line
469469+# EOF
470470+#
471471+# # /!\ do not "uncomment" the functions: the leading "# " characters are needed
472472+#
473473+# # usage: #{weather}
474474+# weather() { # see https://github.com/chubin/wttr.in#one-line-output
475475+# curl -f -s -m 2 'wttr.in?format=3' || printf '\n' # /!\ make sure curl is installed
476476+# sleep 900 # sleep for 15 minutes, throttle network requests whatever the value of status-interval
477477+# }
478478+#
479479+# # usage: #{online}
480480+# online() {
481481+# ping -c 1 1.1.1.1 >/dev/null 2>&1 && printf '✔' || printf '✘'
482482+# }
483483+#
484484+# # usage: #{wan_ip_v4}
485485+# wan_ip_v4() {
486486+# curl -f -s -m 2 -4 ifconfig.me
487487+# sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval
488488+# }
489489+#
490490+# # usage: #{wan_ip_v6}
491491+# wan_ip_v6() {
492492+# curl -f -s -m 2 -6 ifconfig.me
493493+# sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval
494494+# }
495495+#
496496+# # usage: #{github_stars}, #{github_stars tmux/tmux}, ...
497497+# github_stars() {
498498+# repository=${1##*https://github.com/}
499499+# repository=${repository%% *}
500500+# repository=${repository%%.git}
501501+# url="https://api.github.com/repos/${repository:-gpakosz/.tmux}"
502502+# curl -s "$url" | perl -MJSON::PP=decode_json -CO -0777 -E '$response = decode_json(readline *STDIN); say ($response->{stargazers_count})'
503503+# sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval
504504+# }
505505+#
506506+# "$@"
507507+# # /!\ do not remove the previous line
508508+# # do not write below this line
+19
LICENSE
···11+Copyright (c) 2025 Tsiry Sandratraina <tsiry.sndr@rocksky.app>
22+33+Permission is hereby granted, free of charge, to any person obtaining a copy
44+of this software and associated documentation files (the "Software"), to deal
55+in the Software without restriction, including without limitation the rights
66+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
77+copies of the Software, and to permit persons to whom the Software is
88+furnished to do so, subject to the following conditions:
99+1010+The above copyright notice and this permission notice shall be included in all
1111+copies or substantial portions of the Software.
1212+1313+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1414+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1515+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1616+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919+SOFTWARE.