this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Initial Commit

+2766
+37
.config/nvim/init.lua
··· 1 + 2 + require("config.lazy") 3 + 4 + require("toggleterm").setup{ 5 + -- size can be a number or function which is passed the current terminal 6 + size = 20, 7 + open_mapping = [[<c-\>]], 8 + hide_numbers = true, -- hide the number column in toggleterm buffers 9 + shade_filetypes = {}, 10 + shade_terminals = true, 11 + shading_factor = '1', -- the degree by which to darken to terminal colour, default: 1 12 + start_in_insert = true, 13 + insert_mappings = true, -- whether or not the open mapping applies in insert mode 14 + terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals 15 + persist_size = true, 16 + direction = 'horizontal', -- 'vertical' | 'horizontal' | 'window' | 'float' 17 + close_on_exit = true, -- close the terminal window when the process exits 18 + shell = vim.o.shell, -- change the default shell 19 + float_opts = { 20 + border = 'curved', 21 + winblend = 0, 22 + highlights = { 23 + border = "Normal", 24 + background = "Normal", 25 + } 26 + } 27 + } 28 + 29 + for _, method in ipairs({ 'textDocument/diagnostic', 'workspace/diagnostic' }) do 30 + local default_diagnostic_handler = vim.lsp.handlers[method] 31 + vim.lsp.handlers[method] = function(err, result, context, config) 32 + if err ~= nil and err.code == -32802 then 33 + return 34 + end 35 + return default_diagnostic_handler(err, result, context, config) 36 + end 37 + end
+58
.config/nvim/lazy-lock.json
··· 1 + { 2 + "LazyVim": { "branch": "main", "commit": "3660c52017462dfc472ff436261100a98ebea34d" }, 3 + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, 4 + "blink.cmp": { "branch": "main", "commit": "1cc3b1a908fbcfd15451c4772759549724f38524" }, 5 + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, 6 + "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, 7 + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 8 + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, 9 + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, 10 + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 11 + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, 12 + "conform.nvim": { "branch": "master", "commit": "6dc21d4ce050c2e592d9635b7983d67baf216e3d" }, 13 + "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, 14 + "copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" }, 15 + "dial.nvim": { "branch": "master", "commit": "34bbd9c387c358190e61ce71017faad3dffa7a74" }, 16 + "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, 17 + "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, 18 + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, 19 + "fzf-lua": { "branch": "main", "commit": "fbe21aeb147b3dc8b188b5753a8e288ecedcee5e" }, 20 + "gitsigns.nvim": { "branch": "main", "commit": "817bd848fffe82e697b4da656e3f2834cd0665c5" }, 21 + "grug-far.nvim": { "branch": "main", "commit": "8e8f3429038d45a6d4144c0642d92f470e5480f3" }, 22 + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, 23 + "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, 24 + "lsp-zero.nvim": { "branch": "v4.x", "commit": "baff1ca10ecad7efe04f02f06d2647dd2ae90074" }, 25 + "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, 26 + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, 27 + "mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" }, 28 + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 29 + "mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" }, 30 + "mini.icons": { "branch": "main", "commit": "910db5df9724d65371182948f921fce23c2c881e" }, 31 + "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, 32 + "neo-tree.nvim": { "branch": "main", "commit": "d175a0ce24bcb022ec1c93635841c043d764418e" }, 33 + "neorg": { "branch": "main", "commit": "29993a7bb8279ffa0ba473a3f393daa28c645825" }, 34 + "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, 35 + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, 36 + "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, 37 + "nvim-lint": { "branch": "master", "commit": "dfa45de973c3ce7bd1b9a6d346f896a68ad07e44" }, 38 + "nvim-lspconfig": { "branch": "master", "commit": "14b5a806c928390fac9ff4a5630d20eb902afad8" }, 39 + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, 40 + "nvim-tree.lua": { "branch": "master", "commit": "d529a99f88e0dff02e0aa275db2f595cd252a2c8" }, 41 + "nvim-treesitter": { "branch": "master", "commit": "5da195ac3dfafd08d8b10756d975f0e01e1d563a" }, 42 + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, 43 + "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, 44 + "nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" }, 45 + "pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" }, 46 + "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, 47 + "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, 48 + "snacks.nvim": { "branch": "main", "commit": "74feefc52284e2ebf93ad815ec5aaeec918d4dc2" }, 49 + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, 50 + "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, 51 + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, 52 + "tokyonight.nvim": { "branch": "main", "commit": "775f82f08a3d1fb55a37fc6d3a4ab10cd7ed8a10" }, 53 + "treesj": { "branch": "main", "commit": "ec234a9a13d61a7b95900abdb02fabaea1afd9f3" }, 54 + "trouble.nvim": { "branch": "main", "commit": "50481f414bd3c1a40122c1d759d7e424d5fafe84" }, 55 + "ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" }, 56 + "vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" }, 57 + "which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" } 58 + }
+9
.config/nvim/lazyvim.json
··· 1 + { 2 + "extras": [ 3 + 4 + ], 5 + "news": { 6 + "NEWS.md": "10960" 7 + }, 8 + "version": 7 9 + }
+38
.config/nvim/lua/config/lazy.lua
··· 1 + -- Bootstrap lazy.nvim 2 + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 3 + if not (vim.uv or vim.loop).fs_stat(lazypath) then 4 + local lazyrepo = "https://github.com/folke/lazy.nvim.git" 5 + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) 6 + if vim.v.shell_error ~= 0 then 7 + vim.api.nvim_echo({ 8 + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, 9 + { out, "WarningMsg" }, 10 + { "\nPress any key to exit..." }, 11 + }, true, {}) 12 + vim.fn.getchar() 13 + os.exit(1) 14 + end 15 + end 16 + vim.opt.rtp:prepend(lazypath) 17 + 18 + -- Make sure to setup `mapleader` and `maplocalleader` before 19 + -- loading lazy.nvim so that mappings are correct. 20 + -- This is also a good place to setup other settings (vim.opt) 21 + vim.g.mapleader = " " 22 + vim.g.maplocalleader = "\\" 23 + 24 + -- Setup lazy.nvim 25 + require("lazy").setup({ 26 + spec = { 27 + -- import your plugins 28 + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, 29 + -- { import = "lazyvim.plugins.extras.lang.rust" }, 30 + { import = "plugins" }, 31 + }, 32 + -- Configure any other settings here. See the documentation for more details. 33 + -- colorscheme that will be used when installing plugins. 34 + install = { colorscheme = { "habamax" } }, 35 + -- automatically check for plugin updates 36 + checker = { enabled = true }, 37 + }) 38 +
+6
.config/nvim/lua/plugins/copilot-cmp.lua
··· 1 + return { 2 + "zbirenbaum/copilot-cmp", 3 + config = function () 4 + require("copilot_cmp").setup() 5 + end 6 + }
+13
.config/nvim/lua/plugins/copilot.lua
··· 1 + return { 2 + "zbirenbaum/copilot.lua", 3 + cmd = "Copilot", 4 + event = "InsertEnter", 5 + config = function() 6 + require("copilot").setup({ 7 + suggestion = { 8 + enabled = true, 9 + auto_trigger = true, 10 + }, 11 + }) 12 + end, 13 + }
+111
.config/nvim/lua/plugins/custom.lua
··· 1 + 2 + return { 3 + -- the colorscheme should be available when starting Neovim 4 + { 5 + "folke/tokyonight.nvim", 6 + lazy = false, -- make sure we load this during startup if it is your main colorscheme 7 + priority = 1000, -- make sure to load this before all the other start plugins 8 + config = function() 9 + -- load the colorscheme here 10 + vim.cmd([[colorscheme tokyonight]]) 11 + end, 12 + }, 13 + 14 + -- I have a separate config.mappings file where I require which-key. 15 + -- With lazy the plugin will be automatically loaded when it is required somewhere 16 + { "folke/which-key.nvim", lazy = true }, 17 + 18 + { 19 + "nvim-neorg/neorg", 20 + -- lazy-load on filetype 21 + ft = "norg", 22 + -- options for neorg. This will automatically call `require("neorg").setup(opts)` 23 + opts = { 24 + load = { 25 + ["core.defaults"] = {}, 26 + }, 27 + }, 28 + }, 29 + 30 + { 31 + "dstein64/vim-startuptime", 32 + -- lazy-load on a command 33 + cmd = "StartupTime", 34 + -- init is called during startup. Configuration for vim plugins typically should be set in an init function 35 + init = function() 36 + vim.g.startuptime_tries = 10 37 + end, 38 + }, 39 + 40 + { 41 + "hrsh7th/nvim-cmp", 42 + -- load cmp on InsertEnter 43 + event = "InsertEnter", 44 + -- these dependencies will only be loaded when cmp loads 45 + -- dependencies are always lazy-loaded unless specified otherwise 46 + dependencies = { 47 + "hrsh7th/cmp-nvim-lsp", 48 + "hrsh7th/cmp-buffer", 49 + }, 50 + enabled = true, 51 + config = function() 52 + -- ... 53 + end, 54 + }, 55 + 56 + -- if some code requires a module from an unloaded plugin, it will be automatically loaded. 57 + -- So for api plugins like devicons, we can always set lazy=true 58 + { "nvim-tree/nvim-web-devicons", lazy = true }, 59 + 60 + -- you can use the VeryLazy event for things that can 61 + -- load later and are not important for the initial UI 62 + { "stevearc/dressing.nvim", event = "VeryLazy" }, 63 + 64 + { 65 + "Wansmer/treesj", 66 + keys = { 67 + { "J", "<cmd>TSJToggle<cr>", desc = "Join Toggle" }, 68 + }, 69 + opts = { use_default_keymaps = false, max_join_length = 150 }, 70 + }, 71 + 72 + { 73 + "monaqa/dial.nvim", 74 + -- lazy-load on keys 75 + -- mode is `n` by default. For more advanced options, check the section on key mappings 76 + keys = { "<C-a>", { "<C-x>", mode = "n" } }, 77 + }, 78 + 79 + -- local plugins need to be explicitly configured with dir 80 + -- { dir = "~/projects/secret.nvim" }, 81 + 82 + -- you can use a custom url to fetch a plugin 83 + { url = "git@github.com:folke/noice.nvim.git" }, 84 + 85 + -- local plugins can also be configured with the dev option. 86 + -- This will use {config.dev.path}/noice.nvim/ instead of fetching it from GitHub 87 + -- With the dev option, you can easily switch between the local and installed version of a plugin 88 + -- { "folke/noice.nvim", dev = true }, 89 + 90 + -- amongst your other plugins 91 + { "akinsho/toggleterm.nvim", version = "*", config = true }, 92 + { 93 + "nvim-treesitter/nvim-treesitter", 94 + opts = { 95 + ensure_installed = { 96 + "rust", 97 + "go", 98 + "gleam", 99 + "javascript", 100 + "typescript", 101 + "zig", 102 + "ruby", 103 + "elixir", 104 + "haskell", 105 + "purescript", 106 + "clojure", 107 + "lua", 108 + }, 109 + }, 110 + }, 111 + }
+23
.config/nvim/lua/plugins/lsp-zero.lua
··· 1 + local M = { 2 + 'VonHeikemen/lsp-zero.nvim', 3 + branch = "v4.x", 4 + dependencies = { 5 + -- LSP support 6 + 'neovim/nvim-lspconfig', 7 + 8 + -- Autocompletetion 9 + 'hrsh7th/nvim-cmp', 10 + 'hrsh7th/cmp-buffer', 11 + 'hrsh7th/cmp-path', 12 + 'saadparwaiz1/cmp_luasnip', 13 + 'hrsh7th/cmp-nvim-lsp', 14 + 'hrsh7th/cmp-nvim-lua', 15 + 16 + -- Snippets 17 + 'L3MON4D3/LuaSnip', 18 + 'rafamadriz/friendly-snippets', 19 + }, 20 + } 21 + 22 + return M 23 +
+36
.config/nvim/lua/plugins/mason.lua
··· 1 + local M = { 2 + 'williamboman/mason.nvim', 3 + dependencies = { 4 + 'williamboman/mason-lspconfig.nvim', 5 + 'nvim-lua/plenary.nvim', 6 + }, 7 + } 8 + 9 + M.servers = { 10 + "lua_ls", 11 + "rust_analyzer", 12 + "clangd" 13 + } 14 + 15 + function M.config() 16 + 17 + local lsp = require("lsp-zero") 18 + lsp.preset("recommended") 19 + 20 + require("lsp-zero").setup() 21 + require("mason").setup() 22 + 23 + require("mason-lspconfig").setup_handlers { 24 + function (server_name) 25 + require "lspconfig" [server_name].setup {} 26 + end 27 + } 28 + 29 + require("mason-lspconfig").setup { 30 + ensure_installed = M.servers, 31 + automatic_installation = true, 32 + } 33 + 34 + end 35 + 36 + return M
+11
.config/nvim/lua/plugins/nvim-tree.lua
··· 1 + return { 2 + "nvim-tree/nvim-tree.lua", 3 + version = "*", 4 + lazy = false, 5 + dependencies = { 6 + "nvim-tree/nvim-web-devicons", 7 + }, 8 + config = function() 9 + require("nvim-tree").setup {} 10 + end, 11 + }
+5
.config/nvim/lua/plugins/telescope.lua
··· 1 + return { 2 + 'nvim-telescope/telescope.nvim', tag = '0.1.8', 3 + -- or , branch = '0.1.x', 4 + dependencies = { 'nvim-lua/plenary.nvim' } 5 + }
+1892
.tmux.conf
··· 1 + # : << 'EOF' 2 + # Oh my tmux! 3 + # 💛🩷💙🖤❤️🤍 4 + # https://github.com/gpakosz/.tmux 5 + # (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, 6 + # without any warranty. 7 + # Copyright 2012— Gregory Pakosz (@gpakosz). 8 + # 9 + # ------------------------------------------------------------------------------ 10 + # 🚨 DO NOT MODIFY THIS FILE 11 + # instead, override your .local customization file copy, see README.md 12 + # ------------------------------------------------------------------------------ 13 + 14 + 15 + # -- general ------------------------------------------------------------------- 16 + 17 + set -g default-terminal "screen-256color" 18 + 19 + %if #{||:#{m/ri:mintty|iTerm,#{TERM_PROGRAM}},#{!=:#{XTERM_VERSION},}} 20 + set -g extended-keys on # needed by Control + Shift bindings 21 + %endif 22 + set -s escape-time 10 # faster command sequences 23 + set -sg repeat-time 600 # increase repeat timeout 24 + set -s focus-events on 25 + 26 + set -g prefix2 C-a # GNU-Screen compatible prefix 27 + bind C-a send-prefix -2 28 + 29 + set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2) 30 + setw -q -g utf8 on 31 + 32 + set -g history-limit 5000 # boost history 33 + 34 + # edit configuration 35 + %if #{>=:#{version},3.0} 36 + 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"' 37 + %else 38 + set-environment -g EDITOR "$EDITOR" 39 + 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"' 40 + %endif 41 + 42 + # reload configuration 43 + bind r run "sh -c '\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} source \"\$TMUX_CONF\"'" \; display "#{TMUX_CONF} sourced" 44 + 45 + 46 + # -- display ------------------------------------------------------------------- 47 + 48 + set -g base-index 1 # start windows numbering at 1 49 + setw -g pane-base-index 1 # make pane numbering consistent with windows 50 + 51 + setw -g automatic-rename on # rename window to reflect current program 52 + set -g renumber-windows on # renumber windows when a window is closed 53 + 54 + set -g set-titles on # set terminal title 55 + 56 + set -g display-panes-time 800 # slightly longer pane indicators display time 57 + set -g display-time 1000 # slightly longer status messages display time 58 + 59 + set -g status-interval 10 # redraw status line every 10 seconds 60 + 61 + # clear both screen and history 62 + bind -n C-l send-keys C-l \; run 'sleep 0.2' \; clear-history 63 + 64 + # activity 65 + set -g monitor-activity on 66 + set -g visual-activity off 67 + 68 + 69 + # -- navigation ---------------------------------------------------------------- 70 + 71 + # create session 72 + bind C-c new-session 73 + 74 + # find session 75 + bind C-f command-prompt -p find-session 'switch-client -t %%' 76 + 77 + # session navigation 78 + bind BTab switch-client -l # move to last session 79 + 80 + # split current window horizontally 81 + bind - split-window -v 82 + # split current window vertically 83 + bind _ split-window -h 84 + 85 + # pane navigation 86 + bind -r h select-pane -L # move left 87 + bind -r j select-pane -D # move down 88 + bind -r k select-pane -U # move up 89 + bind -r l select-pane -R # move right 90 + bind > swap-pane -D # swap current pane with the next one 91 + bind < swap-pane -U # swap current pane with the previous one 92 + 93 + # maximize current pane 94 + bind + run "cut -c3- '#{TMUX_CONF}' | sh -s _maximize_pane '#{session_name}' '#D'" 95 + 96 + # pane resizing 97 + bind -r H resize-pane -L 2 98 + bind -r J resize-pane -D 2 99 + bind -r K resize-pane -U 2 100 + bind -r L resize-pane -R 2 101 + 102 + # window navigation 103 + unbind n 104 + unbind p 105 + bind -r C-h previous-window # select previous window 106 + bind -r C-l next-window # select next window 107 + bind -r C-S-H swap-window -t -1 \; select-window -t -1 # swap current window with the previous one 108 + bind -r C-S-L swap-window -t +1 \; select-window -t +1 # swap current window with the next one 109 + bind Tab last-window # move to last active window 110 + 111 + # toggle mouse 112 + bind m run "cut -c3- '#{TMUX_CONF}' | sh -s _toggle_mouse" 113 + 114 + 115 + # -- facebook pathpicker ------------------------------------------------------- 116 + 117 + bind F run "cut -c3- '#{TMUX_CONF}' | sh -s _fpp '#{pane_id}' '#{pane_current_path}'" 118 + 119 + 120 + # -- copy mode ----------------------------------------------------------------- 121 + 122 + bind Enter copy-mode # enter copy mode 123 + 124 + bind -T copy-mode-vi v send -X begin-selection 125 + bind -T copy-mode-vi C-v send -X rectangle-toggle 126 + bind -T copy-mode-vi y send -X copy-selection-and-cancel 127 + bind -T copy-mode-vi Escape send -X cancel 128 + bind -T copy-mode-vi H send -X start-of-line 129 + bind -T copy-mode-vi L send -X end-of-line 130 + 131 + # copy to X11 clipboard 132 + 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"' 133 + 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"' 134 + # copy to Wayland clipboard 135 + 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"' 136 + # copy to macOS clipboard 137 + if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} save-buffer - | pbcopy"' 138 + # copy to Windows clipboard 139 + 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"' 140 + if -b '[ -c /dev/clipboard ]' 'bind y run -b "\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:+-S \"\$TMUX_SOCKET\"} save-buffer - > /dev/clipboard"' 141 + 142 + 143 + # -- buffers ------------------------------------------------------------------- 144 + 145 + bind b list-buffers # list paste buffers 146 + bind p paste-buffer -p # paste from the top paste buffer 147 + bind P choose-buffer # choose which buffer to paste from 148 + 149 + 150 + # -- 8< ------------------------------------------------------------------------ 151 + 152 + %if #{==:#{TMUX_PROGRAM},} 153 + 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\"'" 154 + %endif 155 + %if #{==:#{TMUX_SOCKET},} 156 + run "exec sh -c '\"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_SOCKET \"#{socket_path}\"'" 157 + %endif 158 + %if #{==:#{TMUX_CONF},} 159 + 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)'" 160 + %endif 161 + %if #{==:#{TMUX_CONF_LOCAL},} 162 + run "exec sh -c '\"\$TMUX_PROGRAM\" set-environment -g TMUX_CONF_LOCAL \"\$TMUX_CONF.local\"'" 163 + %endif 164 + 165 + run '"$TMUX_PROGRAM" -S #{socket_path} source "$TMUX_CONF_LOCAL"' 166 + run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration' 167 + 168 + # EOF 169 + # 170 + # # exit the script if any statement returns a non-true return value 171 + # set -e 172 + # 173 + # unset SHELL 174 + # 175 + # unset GREP_OPTIONS 176 + # export LC_NUMERIC=C 177 + # # shellcheck disable=SC3041 178 + # if (set +H 2>/dev/null); then 179 + # set +H 180 + # fi 181 + # 182 + # if ! printf '' | sed -E 's///' 2>/dev/null; then 183 + # if printf '' | sed -r 's///' 2>/dev/null; then 184 + # sed() { 185 + # n=$#; while [ "$n" -gt 0 ]; do arg=$1; shift; case $arg in -E*) arg=-r${arg#-E};; esac; set -- "$@" "$arg"; n=$(( n - 1 )); done 186 + # command sed "$@" 187 + # } 188 + # fi 189 + # fi 190 + # 191 + # _uname_s=$(uname -s) 192 + # 193 + # [ -z "$TMUX" ] && exit 255 194 + # if [ -z "$TMUX_SOCKET" ]; then 195 + # TMUX_SOCKET=$(printf '%s' "$TMUX" | cut -d, -f1) 196 + # fi 197 + # if [ -z "$TMUX_PROGRAM" ]; then 198 + # TMUX_PID=$(printf '%s' "$TMUX" | cut -d, -f2) 199 + # 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) 200 + # [ "$("$TMUX_PROGRAM" -S "$TMUX_SOCKET" display -p '#{pid}' 2>/dev/null)" = "$TMUX_PID" ] || TMUX_PROGRAM=$(command -v tmux || printf tmux) 201 + # fi 202 + # if [ "$TMUX_PROGRAM" = "tmux" ]; then 203 + # tmux() { 204 + # command tmux ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} "$@" 205 + # } 206 + # else 207 + # tmux() { 208 + # "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} "$@" 209 + # } 210 + # fi 211 + # 212 + # _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)') 213 + # 214 + # _is_true() { 215 + # case "$1" in 216 + # true|yes|1) 217 + # return 0 218 + # ;; 219 + # *) 220 + # return 1 221 + # ;; 222 + # esac 223 + # } 224 + # 225 + # _is_enabled() { 226 + # [ "$1" = "enabled" ] 227 + # } 228 + # 229 + # _is_disabled() { 230 + # [ "$1" = "disabled" ] 231 + # } 232 + # 233 + # _circled() { 234 + # circled_digits='⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳' 235 + # if [ "$1" -le 20 ] 2>/dev/null; then 236 + # i=$(( $1 + 1 )) 237 + # eval set -- "$circled_digits" 238 + # eval echo "\${$i}" 239 + # else 240 + # echo "$1" 241 + # fi 242 + # } 243 + # 244 + # _decode_unicode_escapes() { 245 + # 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 246 + # } 247 + # 248 + # _pretty_path() { 249 + # max_length=${1:-auto}; shift 250 + # if [ "$max_length" = "auto" ]; then 251 + # max_length=$(($(tmux -q display -p '#{client_width}') / 4)) 252 + # fi 253 + # { cd "$*" && pwd || printf '%s' "$*"; } | perl -s -p -E ' 254 + # s|^$HOME|~|; 255 + # /^.{0,$max_length}$/ || s|(~?/[^/]+)(/[^/]+)(?:/.+)?(/[^/]+)$|$1$2/...$3|g; 256 + # /^.{0,$max_length}$/ || s|(~?/[^/]+)(/[^/]+)(?:/.+)(/[^/]+)$|$1/...$3|g;' -- -HOME="$HOME" -max_length="$max_length" 257 + # } 258 + # 259 + # if command -v pkill > /dev/null 2>&1; then 260 + # _pkillf() { 261 + # pkill -f "$@" || true 262 + # } 263 + # else 264 + # case "$_uname_s" in 265 + # *CYGWIN*) 266 + # _pkillf() { 267 + # while IFS= read -r pid; do 268 + # kill "$pid" || true 269 + # done << EOF 270 + # $(grep -Eao "$@" /proc/*/cmdline | xargs -0 | sed -E -n 's,/proc/([0-9]+)/.+$,\1,pg') 271 + # EOF 272 + # } 273 + # ;; 274 + # *) 275 + # # shellcheck disable=SC2009 276 + # _pkillf() { 277 + # while IFS= read -r pid; do 278 + # kill "$pid" || true 279 + # done << EOF 280 + # $(ps -x -o pid= -o command= | grep -E "$@" | cut -d' ' -f1) 281 + # EOF 282 + # } 283 + # ;; 284 + # esac 285 + # fi 286 + # 287 + # if perl -MTime::HiRes -e1; then 288 + # _timestamp() { 289 + # while IFS= read -r line; do 290 + # 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)' 291 + # done 292 + # } 293 + # else 294 + # case "$_uname_s" in 295 + # Darwin) 296 + # _timestamp() { 297 + # while IFS= read -r line; do 298 + # printf '[%s]\t%s\n' "$(date +"%Y-%m-%d %H:%M:%S.000")" "$line" 299 + # done 300 + # } 301 + # ;; 302 + # *) 303 + # _timestamp() { 304 + # while IFS= read -r line; do 305 + # printf '[%s]\t%s\n' "$(date +"%Y-%m-%d %H:%M:%S.%3N")" "$line" 306 + # done 307 + # } 308 + # ;; 309 + # esac 310 + # fi 311 + # 312 + # _bar() { 313 + # bar_palette=$(printf '%s' "$1" | tr ';' ',') 314 + # bar_symbol_empty=$2 315 + # bar_symbol_full=$3 316 + # bar_length=$4 # "auto" or number of columns 317 + # bar_value=$5 # value between 0 and 1 318 + # 319 + # if [ "$bar_length" = "auto" ]; then 320 + # columns=${6:-$(tmux -q display -p '#{client_width}' 2> /dev/null || echo 80)} 321 + # if [ "$columns" -ge 160 ]; then 322 + # bar_length=12 323 + # elif [ "$columns" -ge 130 ]; then 324 + # bar_length=10 325 + # elif [ "$columns" -ge 120 ]; then 326 + # bar_length=8 327 + # elif [ "$columns" -ge 100 ]; then 328 + # bar_length=6 329 + # else 330 + # bar_length=4 331 + # fi 332 + # fi 333 + # 334 + # 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 335 + # # shellcheck disable=SC2086 336 + # { set -f; IFS=', '; set -- $bar_palette; unset IFS; set +f; } 337 + # palette_style=$1 338 + # shift 339 + # 340 + # case "$palette_style" in 341 + # gradient) 342 + # palette="colour196 colour202 colour208 colour214 colour220 colour226 colour190 colour154 colour118 colour82 colour46" 343 + # ;; 344 + # heat) 345 + # palette="colour243 colour245 colour247 colour144 colour143 colour142 colour184 colour214 colour208 colour202 colour196" 346 + # ;; 347 + # gradient*) 348 + # palette=${palette_style##gradient(} 349 + # while [ $# -gt 0 ]; do 350 + # palette="$palette${1+ }${1%%)}" 351 + # [ "$1" != "${1%%)}" ] && break 352 + # shift 353 + # done 354 + # ;; 355 + # esac 356 + # bg=${2:-none} 357 + # 358 + # palette=$(printf '%s' "$palette" | awk -v n="$bar_length" '{ for (i = 0; i < n - 1; ++i) printf "%s ", $(1 + i * NF / n); printf $NF }') 359 + # # shellcheck disable=SC2086 360 + # set -- $palette 361 + # 362 + # full=$(awk "BEGIN { printf \"%.0f\", ($bar_value) * $bar_length }") 363 + # bar="#[bg=$bg]" 364 + # if [ "$full" -gt 0 ]; then 365 + # # shellcheck disable=SC2046 366 + # bar="$bar$(printf "#[fg=%s]$bar_symbol_full" $(printf '%s' "$palette" | cut -d' ' -f1-"$full"))" 367 + # fi 368 + # empty=$((bar_length - full)) 369 + # if [ "$empty" -gt 0 ]; then 370 + # # shellcheck disable=SC2046 371 + # bar="$bar$(printf "#[fg=%s]$bar_symbol_empty" $(printf '%s' "$palette" | cut -d' ' -f$((full + 1))-$((full + empty))))" 372 + # fi 373 + # eval bar="$bar#[fg=\${$((full == 0 ? 1 : full))}]" 374 + # elif printf '%s' "$bar_palette" | grep -q -E '^(([#a-zA-Z0-9]{7,9}|none),?){3}$'; then 375 + # # shellcheck disable=SC2086 376 + # { set -f; IFS=,; set -- $bar_palette; unset IFS; set +f; } 377 + # full_fg=$1 378 + # empty_fg=$2 379 + # bg=${3:-none} 380 + # 381 + # full=$(awk "BEGIN { printf \"%.0f\", ($bar_value) * $bar_length }") 382 + # bar="#[bg=$bg]" 383 + # if [ "$full" -gt 0 ]; then 384 + # bar="$bar#[fg=$full_fg]$(printf "%0.s$bar_symbol_full" $(seq 1 "$full"))" 385 + # fi 386 + # empty=$((bar_length - full)) 387 + # if [ "$empty" -gt 0 ]; then 388 + # bar="$bar#[fg=$empty_fg]$(printf "%0.s$bar_symbol_empty" $(seq 1 "$empty"))#[fg=$empty_fg]" 389 + # fi 390 + # fi 391 + # 392 + # printf '%s' "$bar" 393 + # } 394 + # 395 + # _hbar() { 396 + # hbar_palette=$(printf '%s' "$1" | tr ';' ',') 397 + # hbar_value=$2 398 + # 399 + # 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 400 + # # shellcheck disable=SC2086 401 + # { set -f; IFS=', '; set -- $hbar_palette; unset IFS; set +f; } 402 + # palette_style=$1 403 + # shift 404 + # 405 + # case "$palette_style" in 406 + # gradient) 407 + # palette="colour196 colour202 colour208 colour214 colour220 colour226 colour190 colour154 colour118 colour82 colour46" 408 + # ;; 409 + # heat) 410 + # palette="colour243 colour245 colour247 colour144 colour143 colour142 colour184 colour214 colour208 colour202 colour196" 411 + # ;; 412 + # gradient*) 413 + # palette=${palette_style##gradient(} 414 + # while [ $# -gt 0 ]; do 415 + # palette="$palette${1+ }${1%%)}" 416 + # [ "$1" != "${1%%)}" ] && break 417 + # shift 418 + # done 419 + # ;; 420 + # esac 421 + # bg=${2:-none} 422 + # 423 + # palette=$(printf '%s' "$palette" | awk -v n=8 '{ for (i = 0; i < n - 1; ++i) printf "%s ", $(1 + i * NF / n); printf $NF }') 424 + # # shellcheck disable=SC2086 425 + # set -- $palette 426 + # 427 + # full=$(awk "BEGIN { printf \"%.0f\", ($hbar_value) * 8 }") 428 + # eval hbar_fg="\${$((full == 0 ? 1 : full))}" 429 + # elif printf '%s' "$hbar_palette" | grep -q -E '^([#a-zA-Z0-9]{7,9},?){3}$'; then 430 + # # shellcheck disable=SC2086 431 + # { set -f; IFS=,; set -- $hbar_palette; unset IFS; set +f; } 432 + # 433 + # # shellcheck disable=SC2046 434 + # eval $(awk "BEGIN { printf \"hbar_fg=$%d\", (($hbar_value) - 0.001) * $# + 1 }") 435 + # fi 436 + # 437 + # set -- ▏ ▎ ▍ ▌ ▋ ▊ ▉ █ 438 + # # shellcheck disable=SC2046 439 + # eval $(awk "BEGIN { printf \"hbar_symbol=$%d\", ($hbar_value) * ($# - 1) + 1 }") 440 + # hbar="#[bg=$bg]#[fg=${hbar_fg?}]${hbar_symbol?}" 441 + # 442 + # printf '%s' "$hbar" 443 + # } 444 + # 445 + # _vbar() { 446 + # vbar_palette=$(printf '%s' "$1" | tr ';' ',') 447 + # vbar_value=$2 448 + # 449 + # 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 450 + # # shellcheck disable=SC2086 451 + # { set -f; IFS=', '; set -- $vbar_palette; unset IFS; set +f; } 452 + # palette_style=$1 453 + # shift 454 + # 455 + # case "$palette_style" in 456 + # gradient) 457 + # palette="colour196 colour202 colour208 colour214 colour220 colour226 colour190 colour154 colour118 colour82 colour46" 458 + # ;; 459 + # heat) 460 + # palette="colour243 colour245 colour247 colour144 colour143 colour142 colour184 colour214 colour208 colour202 colour196" 461 + # ;; 462 + # gradient*) 463 + # palette=${palette_style##gradient(} 464 + # while [ $# -gt 0 ]; do 465 + # palette="$palette${1+ }${1%%)}" 466 + # [ "$1" != "${1%%)}" ] && break 467 + # shift 468 + # done 469 + # ;; 470 + # esac 471 + # bg=${2:-none} 472 + # 473 + # palette=$(printf '%s' "$palette" | awk -v n=8 '{ for (i = 0; i < n - 1; ++i) printf "%s ", $(1 + i * NF / n); printf $NF }') 474 + # # shellcheck disable=SC2086 475 + # set -- $palette 476 + # 477 + # full=$(awk "BEGIN { printf \"%.0f\", ($vbar_value) * 8 }") 478 + # eval vbar_fg="\${$((full == 0 ? 1 : full))}" 479 + # elif printf '%s' "$vbar_palette" | grep -q -E '^([#a-zA-Z0-9]{7,9},?){3}$'; then 480 + # # shellcheck disable=SC2086 481 + # { set -f; IFS=,; set -- $vbar_palette; unset IFS; set +f; } 482 + # 483 + # # shellcheck disable=SC2046 484 + # eval $(awk "BEGIN { printf \"vbar_fg=$%d\", (($vbar_value) - 0.001) * $# + 1 }") 485 + # fi 486 + # 487 + # set -- ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ 488 + # # shellcheck disable=SC2046 489 + # eval $(awk "BEGIN { printf \"vbar_symbol=$%d\", ($vbar_value) * ($# - 1) + 1 }") 490 + # vbar="#[bg=$bg]#[fg=${vbar_fg?}]${vbar_symbol?}" 491 + # 492 + # printf '%s' "$vbar" 493 + # } 494 + # 495 + # _maximize_pane() { 496 + # current_session=${1:-$(tmux display -p '#{session_name}')} 497 + # current_pane=${2:-$(tmux display -p '#{pane_id}')} 498 + # 499 + # dead_panes=$(tmux list-panes -s -t "$current_session" -F '#{pane_dead} #{pane_id} #{pane_start_command}' | grep -E -o '^1 %.+maximized.+$' || true) 500 + # 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"\ 501 + # -e "s/^1 (%[0-9]+) .+maximized.+'$current_pane'\"?$/tmux swap-pane -s \1 -t $current_pane \; kill-pane -t \1/p") 502 + # 503 + # if [ -z "$restore" ]; then 504 + # [ "$(tmux list-panes -t "$current_session:" | wc -l | sed 's/^ *//g')" -eq 1 ] && tmux display "Can't maximize with only one pane" && return 505 + # 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'") 506 + # session_window=${info%.*} 507 + # new_pane=${info#*.} 508 + # 509 + # retry=20 510 + # 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 511 + # sleep 0.1 512 + # retry=$((retry - 1)) 513 + # done 514 + # if [ "$retry" -eq 0 ]; then 515 + # tmux display 'Unable to maximize pane' 516 + # fi 517 + # 518 + # tmux setw -t "$session_window" remain-on-exit off \; swap-pane -s "$current_pane" -t "$new_pane" 519 + # else 520 + # $restore || tmux kill-pane 521 + # fi 522 + # } 523 + # 524 + # _toggle_mouse() { 525 + # old=$(tmux show -gv mouse) 526 + # new="" 527 + # 528 + # if [ "$old" = "on" ]; then 529 + # new="off" 530 + # else 531 + # new="on" 532 + # fi 533 + # 534 + # tmux set -g mouse $new 535 + # } 536 + # 537 + # _battery_info() { 538 + # battery_count=0 539 + # battery_charge=0 540 + # case "$_uname_s" in 541 + # *Darwin*) 542 + # while IFS= read -r line; do 543 + # [ -z "$line" ] && continue 544 + # percentage=$(printf '%s' "$line" | grep -E -o '[0-9]+%' || echo "0%") 545 + # battery_charge=$(awk -v charge="$battery_charge" -v percentage="${percentage%%%}" 'BEGIN { print charge + percentage / 100 }') 546 + # battery_count=$((battery_count + 1)) 547 + # done << EOF 548 + # $(pmset -g batt | grep 'InternalBattery') 549 + # EOF 550 + # ;; 551 + # *Linux*) 552 + # while IFS= read -r batpath; do 553 + # [ -z "$batpath" ] && continue 554 + # grep -i -q device "$batpath/scope" 2> /dev/null && continue 555 + # 556 + # bat_capacity="$batpath/capacity" 557 + # if [ -r "$bat_capacity" ]; then 558 + # battery_charge=$(awk -v charge="$battery_charge" -v capacity="$(cat "$bat_capacity")" 'BEGIN { print charge + (capacity > 100 ? 100 : capacity) / 100 }') 559 + # else 560 + # bat_energy_full="$batpath/energy_full" 561 + # bat_energy_now="$batpath/energy_now" 562 + # if [ -r "$bat_energy_full" ] && [ -r "$bat_energy_now" ]; then 563 + # 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 }') 564 + # fi 565 + # fi 566 + # battery_count=$((battery_count + 1)) 567 + # done << EOF 568 + # $(find /sys/class/power_supply -maxdepth 1 -iname '*bat*') 569 + # EOF 570 + # ;; 571 + # *CYGWIN*|*MSYS*|*MINGW*) 572 + # while IFS= read -r line; do 573 + # [ -z "$line" ] && continue 574 + # battery_charge=$(printf '%s' "$line" | awk -v charge="$battery_charge" '{ print charge + $2 / 100 }') 575 + # battery_count=$((battery_count + 1)) 576 + # done << EOF 577 + # $(wmic path Win32_Battery get BatteryStatus, EstimatedChargeRemaining 2> /dev/null | tr -d '\r' | tail -n +2 || true) 578 + # EOF 579 + # ;; 580 + # *OpenBSD*) 581 + # for batid in 0 1 2; do 582 + # sysctl -n "hw.sensors.acpibat$batid.raw0" 2>&1 | grep -q 'not found' && continue 583 + # if sysctl -n "hw.sensors.acpibat$batid" | grep -q amphour; then 584 + # 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 }') 585 + # else 586 + # 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 }') 587 + # fi 588 + # battery_count=$((battery_count + 1)) 589 + # done 590 + # ;; 591 + # *FreeBSD*) 592 + # battery_charge=$(awk -v charge="$(sysctl -n 'hw.acpi.battery.life')" 'BEGIN { print charge / 100 }') 593 + # battery_count=1 594 + # ;; 595 + # esac 596 + # if [ "$battery_count" -ne 0 ]; then 597 + # battery_charge=$(awk -v charge="$battery_charge" -v count="$battery_count" 'BEGIN { print charge / count }') 598 + # fi 599 + # 600 + # if [ "$battery_charge" = 0 ]; then 601 + # tmux set -ug '@battery_percentage' \;\ 602 + # set -ug '@battery_charge' 603 + # else 604 + # battery_percentage="$(awk "BEGIN { printf \"%.0f%%\", ($battery_charge) * 100 }")" 605 + # 606 + # tmux set -g '@battery_percentage' "$battery_percentage" \;\ 607 + # set -g '@battery_charge' "$battery_charge" 608 + # fi 609 + # } 610 + # 611 + # _battery_status() { 612 + # battery_status_charging=$1 613 + # battery_status_discharging=$2 614 + # 615 + # case "$_uname_s" in 616 + # *Darwin*) 617 + # while IFS= read -r line; do 618 + # [ -z "$line" ] && continue 619 + # battery_discharging=$(printf '%s' "$line" | grep -qi "discharging" && echo "true" || echo "false") 620 + # done << EOF 621 + # $(pmset -g batt | grep 'InternalBattery') 622 + # EOF 623 + # ;; 624 + # *Linux*) 625 + # while IFS= read -r batpath; do 626 + # [ -z "$batpath" ] && continue 627 + # grep -i -q device "$batpath/scope" 2> /dev/null && continue 628 + # 629 + # battery_discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false") 630 + # done << EOF 631 + # $(find /sys/class/power_supply -maxdepth 1 -iname '*bat*') 632 + # EOF 633 + # ;; 634 + # *CYGWIN*|*MSYS*|*MINGW*) 635 + # while IFS= read -r line; do 636 + # [ -z "$line" ] && continue 637 + # battery_discharging=$(printf '%s' "$line" | awk '{ s = ($1 == 1) ? "true" : "false"; print s }') 638 + # done << EOF 639 + # $(wmic path Win32_Battery get BatteryStatus, EstimatedChargeRemaining 2> /dev/null | tr -d '\r' | tail -n +2 || true) 640 + # EOF 641 + # ;; 642 + # *OpenBSD*) 643 + # for batid in 0 1 2; do 644 + # battery_discharging=$(sysctl -n "hw.sensors.acpibat$batid.raw0" | grep -q 1 && echo "true" || echo "false") 645 + # done 646 + # ;; 647 + # *FreeBSD*) 648 + # battery_discharging=$(sysctl -n 'hw.acpi.battery.state' | grep -q 1 && echo "true" || echo "false") 649 + # ;; 650 + # esac 651 + # 652 + # if [ -z "$battery_discharging" ]; then 653 + # tmux set -ug '@battery_status' 654 + # return 655 + # fi 656 + # 657 + # if [ "$battery_discharging" = "true" ]; then 658 + # battery_status="$battery_status_discharging" 659 + # else 660 + # battery_status="$battery_status_charging" 661 + # fi 662 + # 663 + # tmux set -g '@battery_status' "$battery_status" >/dev/null 2>/dev/null 664 + # } 665 + # 666 + # _pane_info() { 667 + # pane_pid="$1" 668 + # pane_tty="${2##/dev/}" 669 + # case "$_uname_s" in 670 + # *CYGWIN*) 671 + # ps -al | tail -n +2 | awk -v pane_pid="$pane_pid" -v tty="$pane_tty" -v ssh="$(command -v ssh)" ' 672 + # ((/ssh/ && !/-W/ && !/tsh proxy ssh/ && !/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ && $5 == tty { 673 + # user[$1] = $6; if (!child[$2]) child[$2] = $1 674 + # } 675 + # END { 676 + # pid = pane_pid 677 + # while (child[pid]) { 678 + # if (match(command[pid], "^" ssh " |^ssh ")) { 679 + # break 680 + # } 681 + # pid = child[pid] 682 + # } 683 + # 684 + # file = "/proc/" pid "/cmdline"; getline command < file; close(file) 685 + # gsub(/\0/, " ", command) 686 + # "id -un " user[pid] | getline username 687 + # print pid":"username":"command 688 + # } 689 + # ' 690 + # ;; 691 + # *Linux*) 692 + # 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)" ' 693 + # ((/ssh/ && !/-W/ && !/tsh proxy ssh/ && !/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ { 694 + # user[$2] = $1; if (!child[$3]) child[$3] = $2; pid=$2; $1 = $2 = $3 = ""; command[pid] = substr($0,4) 695 + # } 696 + # END { 697 + # pid = pane_pid 698 + # while (child[pid]) { 699 + # if (match(command[pid], "^" ssh " |^ssh ")) { 700 + # break 701 + # } 702 + # pid = child[pid] 703 + # } 704 + # 705 + # print pid":"user[pid]":"command[pid] 706 + # } 707 + # ' 708 + # ;; 709 + # *) 710 + # 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)" ' 711 + # ((/ssh/ && !/-W/ && !/tsh proxy ssh/ && !/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ { 712 + # user[$2] = $1; if (!child[$3]) child[$3] = $2; pid=$2; $1 = $2 = $3 = ""; command[pid] = substr($0,4) 713 + # } 714 + # END { 715 + # pid = pane_pid 716 + # while (child[pid]) { 717 + # if (match(command[pid], "^" ssh " |^ssh ")) { 718 + # break 719 + # } 720 + # pid = child[pid] 721 + # } 722 + # 723 + # print pid":"user[pid]":"command[pid] 724 + # } 725 + # ' 726 + # ;; 727 + # esac 728 + # } 729 + # 730 + # _ssh_or_mosh_args() { 731 + # case "$1" in 732 + # *ssh*) 733 + # args=$(printf '%s' "$1" | perl -n -e 'print if s/.*?\bssh[\w_-]*\s*(.*)/\1/') 734 + # ;; 735 + # *mosh-client*) 736 + # args=$(printf '%s' "$1" | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/' -e 's/-[^ ]*//g' -e 's/\d:\d//g') 737 + # ;; 738 + # esac 739 + # 740 + # printf '%s' "$args" 741 + # } 742 + # 743 + # _username() { 744 + # pane_pid=${1:-$(tmux display -p '#{pane_pid}')} 745 + # pane_tty=${2:-$(tmux display -p '#{b:pane_tty}')} 746 + # ssh_only=$3 747 + # 748 + # pane_info=$(_pane_info "$pane_pid" "$pane_tty") 749 + # command=${pane_info#*:} 750 + # command=${command#*:} 751 + # 752 + # ssh_or_mosh_args=$(_ssh_or_mosh_args "$command") 753 + # if [ -n "$ssh_or_mosh_args" ]; then 754 + # # shellcheck disable=SC2086 755 + # username=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk '/^user / { print $2; exit }') 756 + # # shellcheck disable=SC2086 757 + # [ -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 }') 758 + # # shellcheck disable=SC2086 759 + # [ -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 }') 760 + # else 761 + # if ! _is_true "$ssh_only"; then 762 + # username=${pane_info#*:} 763 + # username=${username%%:*} 764 + # fi 765 + # fi 766 + # 767 + # printf '%s\n' "$username" 768 + # } 769 + # 770 + # _hostname() { 771 + # pane_pid=${1:-$(tmux display -p '#{pane_pid}')} 772 + # pane_tty=${2:-$(tmux display -p '#{b:pane_tty}')} 773 + # ssh_only=$3 774 + # full=$4 775 + # h_or_H=$5 776 + # 777 + # pane_info=$(_pane_info "$pane_pid" "$pane_tty") 778 + # command=${pane_info#*:} 779 + # command=${command#*:} 780 + # 781 + # ssh_or_mosh_args=$(_ssh_or_mosh_args "$command") 782 + # if [ -n "$ssh_or_mosh_args" ]; then 783 + # # shellcheck disable=SC2086 784 + # hostname=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk '/^hostname / { print $2; exit }') 785 + # # shellcheck disable=SC2086 786 + # [ -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 }') 787 + # 788 + # if ! _is_true "$full"; then 789 + # case "$hostname" in 790 + # *[a-z-].*) 791 + # hostname=${hostname%%.*} 792 + # ;; 793 + # 127.0.0.1) 794 + # hostname="localhost" 795 + # ;; 796 + # esac 797 + # fi 798 + # else 799 + # if ! _is_true "$ssh_only"; then 800 + # hostname="$h_or_H" 801 + # fi 802 + # fi 803 + # 804 + # printf '%s\n' "$hostname" 805 + # } 806 + # 807 + # _uptime() { 808 + # case "$_uname_s" in 809 + # *Darwin*|*FreeBSD*) 810 + # boot=$(sysctl -n kern.boottime 2>/dev/null | awk -F'[ ,:]+' '{ print $4 }') 811 + # now=$(date +%s) 812 + # ;; 813 + # *Linux*|*CYGWIN*|*MSYS*|*MINGW*) 814 + # boot=0 815 + # now=$(cut -d' ' -f1 < /proc/uptime) 816 + # ;; 817 + # *OpenBSD*) 818 + # boot=$(sysctl -n kern.boottime) 819 + # now=$(date +%s) 820 + # esac 821 + # # shellcheck disable=SC1004 822 + # awk -v tmux="$TMUX_PROGRAM ${TMUX_SOCKET:+-S "$TMUX_SOCKET"}" -v boot="$boot" -v now="$now" ' 823 + # BEGIN { 824 + # uptime = now - boot 825 + # y = int(uptime / 31536000) 826 + # dy = int(uptime / 86400) % 365 827 + # d = int(uptime / 86400) 828 + # h = int(uptime / 3600) % 24 829 + # m = int(uptime / 60) % 60 830 + # s = int(uptime) % 60 831 + # 832 + # system(tmux " set -g @uptime_y " y + 0 " \\;" \ 833 + # " set -g @uptime_dy " dy + 0 " \\;" \ 834 + # " set -g @uptime_d " d + 0 " \\;" \ 835 + # " set -g @uptime_h " h + 0 " \\;" \ 836 + # " set -g @uptime_m " m + 0 " \\;" \ 837 + # " set -g @uptime_s " s + 0) 838 + # }' 839 + # } 840 + # 841 + # _loadavg() { 842 + # case "$_uname_s" in 843 + # *Darwin*|*FreeBSD*) 844 + # tmux set -g @loadavg "$(sysctl -n vm.loadavg 2>/dev/null | cut -d' ' -f2)" 845 + # ;; 846 + # *Linux*|*CYGWIN*) 847 + # tmux set -g @loadavg "$(cut -d' ' -f1 < /proc/loadavg)" 848 + # ;; 849 + # *OpenBSD*) 850 + # tmux set -g @loadavg "$(sysctl -n vm.loadavg 2>/dev/null | cut -d' ' -f1)" 851 + # ;; 852 + # esac 853 + # } 854 + # 855 + # _new_window_ssh() { 856 + # pane_pid=${1:-$(tmux display -p '#{pane_pid}')} 857 + # pane_tty=${2:-$(tmux display -p '#{b:pane_tty}')} 858 + # shift 2 859 + # 860 + # pane_info=$(_pane_info "$pane_pid" "$pane_tty") 861 + # command=${pane_info#*:} 862 + # command=${command#*:} 863 + # 864 + # case "$command" in 865 + # *mosh-client*) 866 + # # shellcheck disable=SC2046 867 + # tmux new-window "$@" mosh $(echo "$command" | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/') 868 + # ;; 869 + # *ssh*) 870 + # # shellcheck disable=SC2046 871 + # tmux new-window "$@" $(echo "$command" | sed -e 's/;/\\;/g') 872 + # ;; 873 + # *) 874 + # tmux new-window "$@" 875 + # esac 876 + # } 877 + # 878 + # _new_window() { 879 + # _new_window_ssh "$@" 880 + # } 881 + # 882 + # _split_window_ssh() { 883 + # pane_pid=${1:-$(tmux display -p '#{pane_pid}')} 884 + # pane_tty=${2:-$(tmux display -p '#{b:pane_tty}')} 885 + # shift 2 886 + # 887 + # pane_info=$(_pane_info "$pane_pid" "$pane_tty") 888 + # command=${pane_info#*:} 889 + # command=${command#*:} 890 + # 891 + # case "$command" in 892 + # *mosh-client*) 893 + # # shellcheck disable=SC2046 894 + # tmux split-window "$@" mosh $(echo "$command" | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/') 895 + # ;; 896 + # *ssh*) 897 + # # shellcheck disable=SC2046 898 + # tmux split-window "$@" $(echo "$command" | sed -e 's/;/\\;/g') 899 + # ;; 900 + # *) 901 + # tmux split-window "$@" 902 + # esac 903 + # } 904 + # 905 + # _split_window() { 906 + # _split_window_ssh "$@" 907 + # } 908 + # 909 + # _apply_tmux_256color() { 910 + # case "$(tmux show -gv default-terminal)" in 911 + # tmux-256color|tmux-direct) 912 + # return 913 + # ;; 914 + # esac 915 + # 916 + # # when tmux-256color is available, use it 917 + # # on macOS though, make sure to use /usr/bin/infocmp to probe if it's availalbe system wide 918 + # case "$_uname_s" in 919 + # *Darwin*) 920 + # if /usr/bin/infocmp -x tmux-256color > /dev/null 2>&1; then 921 + # tmux set -g default-terminal 'tmux-256color' 922 + # fi 923 + # ;; 924 + # *) 925 + # if command infocmp -x tmux-256color > /dev/null 2>&1; then 926 + # tmux set -g default-terminal 'tmux-256color' 927 + # fi 928 + # ;; 929 + # esac 930 + # } 931 + # 932 + # _apply_24b() { 933 + # tmux_conf_theme_24b_colour=${tmux_conf_theme_24b_colour:-auto} 934 + # tmux_conf_24b_colour=${tmux_conf_24b_colour:-$tmux_conf_theme_24b_colour} 935 + # if [ "$tmux_conf_24b_colour" = "auto" ]; then 936 + # case "$COLORTERM" in 937 + # truecolor|24bit) 938 + # apply_24b=true 939 + # ;; 940 + # esac 941 + # if [ "$apply_24b" = "" ] && [ "$(tput colors)" = "16777216" ]; then 942 + # apply_24b=true 943 + # fi 944 + # elif _is_true "$tmux_conf_24b_colour"; then 945 + # apply_24b=true 946 + # fi 947 + # if [ "$apply_24b" = "true" ]; then 948 + # case "$TERM" in 949 + # screen-*|tmux-*) 950 + # ;; 951 + # *) 952 + # tmux set-option -ga terminal-overrides ",*256col*:Tc" 953 + # ;; 954 + # esac 955 + # fi 956 + # } 957 + # 958 + # _apply_bindings() { 959 + # cfg=$(mktemp) && trap 'rm -f $cfg*' EXIT 960 + # 961 + # tmux_conf_preserve_stock_bindings=${tmux_conf_preserve_stock_bindings:-false} 962 + # tmux list-keys | grep -vF 'TMUX_CONF_LOCAL' | grep -E 'new-window|split(-|_)window|new-session|copy-selection|copy-pipe' > "$cfg" 963 + # if _is_true "$tmux_conf_preserve_stock_bindings"; then 964 + # probe_socket="$(dirname "$TMUX_SOCKET")/tmux-stock-bindings-$$" 965 + # TMUX_SOCKET="$probe_socket" tmux -f /dev/null list-keys >> "$cfg" 966 + # rm -f "$probe_socket" 967 + # fi 968 + # 969 + # # tmux 3.0 doesn't include 02254d1e5c881be95fd2fc37b4c4209640b6b266 and the 970 + # # output of list-keys can be truncated 971 + # perl -p -i -e "s/'#\{\?window_zoomed_flag,Unzoom,Zoom\}' 'z' \{resize-pane -$/'#{?window_zoomed_flag,Unzoom,Zoom}' 'z' {resize-pane -Z}\"/g" "$cfg" 972 + # 973 + # tmux_conf_new_window_retain_current_path=${tmux_conf_new_window_retain_current_path:-true} 974 + # if ! _is_disabled "$tmux_conf_new_window_retain_current_path"; then 975 + # perl -p -i -e " 976 + # 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 977 + # ; 978 + # 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 979 + # ; 980 + # s/\bnew-window\b([^;}\n]*?)(?:\s+-c\s+((?:\\\\\")?|\"?|'?)#\{pane_current_path\}\2)/new-window\1/g" \ 981 + # "$cfg" 982 + # fi 983 + # 984 + # perl -p -i -e " 985 + # 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]+))*)?/"\ 986 + # "$cfg" 987 + # 988 + # tmux_conf_new_window_reconnect_ssh=${tmux_conf_new_window_reconnect_ssh:-false} 989 + # if ! _is_disabled "$tmux_conf_new_window_reconnect_ssh" && _is_true "$tmux_conf_new_window_reconnect_ssh"; then 990 + # 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" 991 + # fi 992 + # 993 + # tmux_conf_new_window_retain_current_path=${tmux_conf_new_window_retain_current_path:-false} 994 + # if ! _is_disabled "$tmux_conf_new_window_retain_current_path" && _is_true "$tmux_conf_new_window_retain_current_path"; then 995 + # perl -p -i -e " 996 + # s/\bnew-window\b(?!\s+(?:-|}))/{$&}/g if /\bdisplay-menu\b/ 997 + # ; 998 + # s/\bnew-window\b/new-window -c '#{pane_current_path}'/g 999 + # ; 1000 + # 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/ 1001 + # ; 1002 + # 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" \ 1003 + # "$cfg" 1004 + # fi 1005 + # 1006 + # tmux_conf_new_pane_retain_current_path=${tmux_conf_new_pane_retain_current_path:-true} 1007 + # if ! _is_disabled "$tmux_conf_new_pane_retain_current_path"; then 1008 + # perl -p -i -e " 1009 + # 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 1010 + # ; 1011 + # 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 1012 + # ; 1013 + # s/\bsplit-window\b([^;}\n]*?)(?:\s+-c\s+((?:\\\\\")?|\"?|'?)#\{pane_current_path\}\2)/split-window\1/g" \ 1014 + # "$cfg" 1015 + # fi 1016 + # 1017 + # perl -p -i -e " 1018 + # 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]+))*)?/"\ 1019 + # "$cfg" 1020 + # 1021 + # tmux_conf_new_pane_reconnect_ssh=${tmux_conf_new_pane_reconnect_ssh:-false} 1022 + # if ! _is_disabled "$tmux_conf_new_pane_reconnect_ssh" && _is_true "$tmux_conf_new_pane_reconnect_ssh"; then 1023 + # 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" 1024 + # fi 1025 + # 1026 + # if ! _is_disabled "$tmux_conf_new_pane_retain_current_path" && _is_true "$tmux_conf_new_pane_retain_current_path"; then 1027 + # perl -p -i -e " 1028 + # s/\bsplit-window\b(?!\s+(?:-|}))/{$&}/g if /\bdisplay-menu\b/ 1029 + # ; 1030 + # s/\bsplit-window\b/split-window -c '#{pane_current_path}'\1/g 1031 + # ; 1032 + # 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/ 1033 + # ; 1034 + # 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" \ 1035 + # "$cfg" 1036 + # fi 1037 + # 1038 + # tmux_conf_new_session_prompt=${tmux_conf_new_session_prompt:-false} 1039 + # if ! _is_disabled "$tmux_conf_new_session_prompt" && _is_true "$tmux_conf_new_session_prompt"; then 1040 + # perl -p -i -e " 1041 + # s/(?<!command-prompt -p )\b(new-session)\b(?!\s+(?:-|}))/{$&}/g if /\bdisplay-menu\b/ 1042 + # ; 1043 + # s/(?<!\bcommand-prompt -p )\bnew-session\b(?! -s)/command-prompt -p new-session \"new-session -s '%%'\"/g" \ 1044 + # "$cfg" 1045 + # else 1046 + # perl -p -i -e "s/\bcommand-prompt\s+-p\s+new-session\s+\"new-session\s+-s\s+'%%'\"/new-session/g" "$cfg" 1047 + # fi 1048 + # 1049 + # tmux_conf_new_session_retain_current_path=${tmux_conf_new_session_retain_current_path:-false} 1050 + # if ! _is_disabled "$tmux_conf_new_session_retain_current_path" && _is_true "$tmux_conf_new_session_retain_current_path"; then 1051 + # perl -p -i -e " 1052 + # s/(?<!\bcommand-prompt -p )\bnew-session\b/new-session -c '#{pane_current_path}'/g" \ 1053 + # "$cfg" 1054 + # else 1055 + # perl -p -i -e " 1056 + # s/\bnew-session\b([^;}\n]*?)(?:\s+-c\s+((?:\\\\\")?|\"?|'?)#\{pane_current_path\}\2)/new-session\1/g" \ 1057 + # "$cfg" 1058 + # fi 1059 + # 1060 + # tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false} 1061 + # command -v xsel > /dev/null 2>&1 && command='xsel -i -b' 1062 + # ! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1 && command='xclip -i -selection clipboard > \/dev\/null 2>\&1' 1063 + # [ "$XDG_SESSION_TYPE" = "wayland" ] && command -v wl-copy > /dev/null 2>&1 && command='wl-copy' 1064 + # command -v pbcopy > /dev/null 2>&1 && command='pbcopy' 1065 + # command -v clip.exe > /dev/null 2>&1 && command='clip\.exe' 1066 + # [ -c /dev/clipboard ] && command='cat > \/dev\/clipboard' 1067 + # 1068 + # if [ -n "$command" ]; then 1069 + # if ! _is_disabled "$tmux_conf_copy_to_os_clipboard" && _is_true "$tmux_conf_copy_to_os_clipboard"; then 1070 + # 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" 1071 + # else 1072 + # if [ "$_tmux_version" -ge 3200 ]; then 1073 + # 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" 1074 + # else 1075 + # 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" 1076 + # fi 1077 + # fi 1078 + # fi 1079 + # 1080 + # # until tmux >= 3.0, output of tmux list-keys can't be consumed back by tmux source-file without applying some escapings 1081 + # awk < "$cfg" \ 1082 + # '{i = $2 == "-T" ? 4 : 5; gsub(/^[;]$/, "\\\\&", $i); gsub(/^[$"#~]$/, "'"'"'&'"'"'", $i); gsub(/^['"'"']$/, "\"&\"", $i); print}' > "$cfg.in" 1083 + # 1084 + # # ignore bindings with errors 1085 + # if ! tmux source-file "$cfg.in"; then 1086 + # if tmux source-file -v /dev/null 2> /dev/null; then 1087 + # verbose_flag='-v' 1088 + # fi 1089 + # while ! out=$(tmux source-file "${verbose_flag:+$verbose_flag}" "$cfg.in"); do 1090 + # line=$(printf "%s" "$out" | tail -1 | cut -d':' -f2) 1091 + # perl -n -i -e "if ($. != $line) { print }" "$cfg.in" 1092 + # done 1093 + # fi 1094 + # 1095 + # tmux_conf_urlscan_options=${tmux_conf_urlscan_options:---compact --dedupe} 1096 + # if command -v urlscan > /dev/null 2>&1; then 1097 + # tmux bind U run "cut -c3- '#{TMUX_CONF}' | sh -s _urlscan '#{pane_id}' $tmux_conf_urlscan_options" 1098 + # elif command -v urlview > /dev/null 2>&1; then 1099 + # tmux bind U run "cut -c3- '#{TMUX_CONF}' | sh -s _urlview '#{pane_id}'" 1100 + # fi 1101 + # } 1102 + # 1103 + # _apply_theme() { 1104 + # tmux_conf_theme=${tmux_conf_theme:-enabled} 1105 + # if ! _is_disabled "$tmux_conf_theme"; then 1106 + # 1107 + # # -- default theme ------------------------------------------------------- 1108 + # 1109 + # tmux_conf_theme_colour_1=${tmux_conf_theme_colour_1:-#080808} # dark gray 1110 + # tmux_conf_theme_colour_2=${tmux_conf_theme_colour_2:-#303030} # gray 1111 + # tmux_conf_theme_colour_3=${tmux_conf_theme_colour_3:-#8a8a8a} # light gray 1112 + # tmux_conf_theme_colour_4=${tmux_conf_theme_colour_4:-#00afff} # light blue 1113 + # tmux_conf_theme_colour_5=${tmux_conf_theme_colour_5:-#ffff00} # yellow 1114 + # tmux_conf_theme_colour_6=${tmux_conf_theme_colour_6:-#080808} # dark gray 1115 + # tmux_conf_theme_colour_7=${tmux_conf_theme_colour_7:-#e4e4e4} # white 1116 + # tmux_conf_theme_colour_8=${tmux_conf_theme_colour_8:-#080808} # dark gray 1117 + # tmux_conf_theme_colour_9=${tmux_conf_theme_colour_9:-#ffff00} # yellow 1118 + # tmux_conf_theme_colour_10=${tmux_conf_theme_colour_10:-#ff00af} # pink 1119 + # tmux_conf_theme_colour_11=${tmux_conf_theme_colour_11:-#5fff00} # green 1120 + # tmux_conf_theme_colour_12=${tmux_conf_theme_colour_12:-#8a8a8a} # light gray 1121 + # tmux_conf_theme_colour_13=${tmux_conf_theme_colour_13:-#e4e4e4} # white 1122 + # tmux_conf_theme_colour_14=${tmux_conf_theme_colour_14:-#080808} # dark gray 1123 + # tmux_conf_theme_colour_15=${tmux_conf_theme_colour_15:-#080808} # dark gray 1124 + # tmux_conf_theme_colour_16=${tmux_conf_theme_colour_16:-#d70000} # red 1125 + # tmux_conf_theme_colour_17=${tmux_conf_theme_colour_17:-#e4e4e4} # white 1126 + # 1127 + # # -- panes --------------------------------------------------------------- 1128 + # 1129 + # tmux_conf_theme_window_fg=${tmux_conf_theme_window_fg:-default} 1130 + # tmux_conf_theme_window_bg=${tmux_conf_theme_window_bg:-default} 1131 + # tmux_conf_theme_highlight_focused_pane=${tmux_conf_theme_highlight_focused_pane:-false} 1132 + # tmux_conf_theme_focused_pane_fg=${tmux_conf_theme_focused_pane_fg:-default} 1133 + # tmux_conf_theme_focused_pane_bg=${tmux_conf_theme_focused_pane_bg:-$tmux_conf_theme_colour_2} 1134 + # 1135 + # window_style="fg=$tmux_conf_theme_window_fg,bg=$tmux_conf_theme_window_bg" 1136 + # if _is_true "$tmux_conf_theme_highlight_focused_pane"; then 1137 + # window_active_style="fg=$tmux_conf_theme_focused_pane_fg,bg=$tmux_conf_theme_focused_pane_bg" 1138 + # else 1139 + # window_active_style="default" 1140 + # fi 1141 + # 1142 + # tmux_conf_theme_pane_border_style=${tmux_conf_theme_pane_border_style:-thin} 1143 + # tmux_conf_theme_pane_border=${tmux_conf_theme_pane_border:-$tmux_conf_theme_colour_2} 1144 + # tmux_conf_theme_pane_active_border=${tmux_conf_theme_pane_active_border:-$tmux_conf_theme_colour_4} 1145 + # tmux_conf_theme_pane_border_fg=${tmux_conf_theme_pane_border_fg:-$tmux_conf_theme_pane_border} 1146 + # tmux_conf_theme_pane_active_border_fg=${tmux_conf_theme_pane_active_border_fg:-$tmux_conf_theme_pane_active_border} 1147 + # case "$tmux_conf_theme_pane_border_style" in 1148 + # fat) 1149 + # tmux_conf_theme_pane_border_bg=${tmux_conf_theme_pane_border_bg:-$tmux_conf_theme_pane_border_fg} 1150 + # tmux_conf_theme_pane_active_border_bg=${tmux_conf_theme_pane_active_border_bg:-$tmux_conf_theme_pane_active_border_fg} 1151 + # ;; 1152 + # thin|*) 1153 + # tmux_conf_theme_pane_border_bg=${tmux_conf_theme_pane_border_bg:-default} 1154 + # tmux_conf_theme_pane_active_border_bg=${tmux_conf_theme_pane_active_border_bg:-default} 1155 + # ;; 1156 + # esac 1157 + # 1158 + # tmux_conf_theme_pane_indicator=${tmux_conf_theme_pane_indicator:-$tmux_conf_theme_colour_4} 1159 + # tmux_conf_theme_pane_active_indicator=${tmux_conf_theme_pane_active_indicator:-$tmux_conf_theme_colour_4} 1160 + # 1161 + # # -- status line --------------------------------------------------------- 1162 + # 1163 + # tmux_conf_theme_left_separator_main=$(_decode_unicode_escapes "${tmux_conf_theme_left_separator_main-}") 1164 + # tmux_conf_theme_left_separator_sub=$(_decode_unicode_escapes "${tmux_conf_theme_left_separator_sub-|}") 1165 + # tmux_conf_theme_right_separator_main=$(_decode_unicode_escapes "${tmux_conf_theme_right_separator_main-}") 1166 + # tmux_conf_theme_right_separator_sub=$(_decode_unicode_escapes "${tmux_conf_theme_right_separator_sub-|}") 1167 + # 1168 + # tmux_conf_theme_message_fg=${tmux_conf_theme_message_fg:-$tmux_conf_theme_colour_1} 1169 + # tmux_conf_theme_message_bg=${tmux_conf_theme_message_bg:-$tmux_conf_theme_colour_5} 1170 + # tmux_conf_theme_message_attr=${tmux_conf_theme_message_attr:-bold} 1171 + # 1172 + # tmux_conf_theme_message_command_fg=${tmux_conf_theme_message_command_fg:-$tmux_conf_theme_colour_5} 1173 + # tmux_conf_theme_message_command_bg=${tmux_conf_theme_message_command_bg:-$tmux_conf_theme_colour_1} 1174 + # tmux_conf_theme_message_command_attr=${tmux_conf_theme_message_command_attr:-bold} 1175 + # 1176 + # tmux_conf_theme_mode_fg=${tmux_conf_theme_mode_fg:-$tmux_conf_theme_colour_1} 1177 + # tmux_conf_theme_mode_bg=${tmux_conf_theme_mode_bg:-$tmux_conf_theme_colour_5} 1178 + # tmux_conf_theme_mode_attr=${tmux_conf_theme_mode_attr:-bold} 1179 + # 1180 + # tmux_conf_theme_status_fg=${tmux_conf_theme_status_fg:-$tmux_conf_theme_colour_3} 1181 + # tmux_conf_theme_status_bg=${tmux_conf_theme_status_bg:-$tmux_conf_theme_colour_1} 1182 + # tmux_conf_theme_status_attr=${tmux_conf_theme_status_attr:-none} 1183 + # 1184 + # tmux_conf_theme_terminal_title=${tmux_conf_theme_terminal_title:-#h ❐ #S ● #I #W} 1185 + # 1186 + # tmux_conf_theme_window_status_fg=${tmux_conf_theme_window_status_fg:-$tmux_conf_theme_colour_3} 1187 + # tmux_conf_theme_window_status_bg=${tmux_conf_theme_window_status_bg:-$tmux_conf_theme_colour_1} 1188 + # tmux_conf_theme_window_status_attr=${tmux_conf_theme_window_status_attr:-none} 1189 + # 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,}'} 1190 + # 1191 + # tmux_conf_theme_window_status_current_fg=${tmux_conf_theme_window_status_current_fg:-$tmux_conf_theme_colour_1} 1192 + # tmux_conf_theme_window_status_current_bg=${tmux_conf_theme_window_status_current_bg:-$tmux_conf_theme_colour_4} 1193 + # tmux_conf_theme_window_status_current_attr=${tmux_conf_theme_window_status_current_attr:-bold} 1194 + # 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,}'} 1195 + # 1196 + # tmux_conf_theme_window_status_activity_fg=${tmux_conf_theme_window_status_activity_fg:-default} 1197 + # tmux_conf_theme_window_status_activity_bg=${tmux_conf_theme_window_status_activity_bg:-default} 1198 + # tmux_conf_theme_window_status_activity_attr=${tmux_conf_theme_window_status_activity_attr:-underscore} 1199 + # 1200 + # tmux_conf_theme_window_status_bell_fg=${tmux_conf_theme_window_status_bell_fg:-$tmux_conf_theme_colour_5} 1201 + # tmux_conf_theme_window_status_bell_bg=${tmux_conf_theme_window_status_bell_bg:-default} 1202 + # tmux_conf_theme_window_status_bell_attr=${tmux_conf_theme_window_status_bell_attr:-blink,bold} 1203 + # 1204 + # tmux_conf_theme_window_status_last_fg=${tmux_conf_theme_window_status_last_fg:-$tmux_conf_theme_colour_4} 1205 + # tmux_conf_theme_window_status_last_bg=${tmux_conf_theme_window_status_last_bg:-default} 1206 + # tmux_conf_theme_window_status_last_attr=${tmux_conf_theme_window_status_last_attr:-none} 1207 + # 1208 + # if [ "$tmux_conf_theme_window_status_bg" = "$tmux_conf_theme_status_bg" ] || [ "$tmux_conf_theme_window_status_bg" = "default" ]; then 1209 + # spacer='' 1210 + # spacer_current=' ' 1211 + # else 1212 + # spacer=' ' 1213 + # spacer_current=' ' 1214 + # fi 1215 + # if [ "$tmux_conf_theme_window_status_last_bg" = "$tmux_conf_theme_status_bg" ] || [ "$tmux_conf_theme_window_status_last_bg" = "default" ] ; then 1216 + # spacer_last='' 1217 + # else 1218 + # spacer_last=' ' 1219 + # fi 1220 + # if [ "$tmux_conf_theme_window_status_activity_bg" = "$tmux_conf_theme_status_bg" ] || [ "$tmux_conf_theme_window_status_activity_bg" = "default" ] ; then 1221 + # spacer_activity='' 1222 + # spacer_last_activity="$spacer_last" 1223 + # else 1224 + # spacer_activity=' ' 1225 + # spacer_last_activity=' ' 1226 + # fi 1227 + # if [ "$tmux_conf_theme_window_status_bell_bg" = "$tmux_conf_theme_status_bg" ] || [ "$tmux_conf_theme_window_status_bell_bg" = "default" ] ; then 1228 + # spacer_bell='' 1229 + # spacer_last_bell="$spacer_last" 1230 + # spacer_activity_bell="$spacer_activity" 1231 + # spacer_last_activity_bell="$spacer_last_activity" 1232 + # else 1233 + # spacer_bell=' ' 1234 + # spacer_last_bell=' ' 1235 + # spacer_activity_bell=' ' 1236 + # spacer_last_activity_bell=' ' 1237 + # fi 1238 + # 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}}}" 1239 + # if [ "$(tmux show -g -v status-justify)" = "right" ]; then 1240 + # if [ -z "$tmux_conf_theme_right_separator_main" ]; then 1241 + # window_status_separator=' ' 1242 + # else 1243 + # window_status_separator='' 1244 + # fi 1245 + # 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" 1246 + # 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" 1247 + # else 1248 + # if [ -z "$tmux_conf_theme_left_separator_main" ]; then 1249 + # window_status_separator=' ' 1250 + # else 1251 + # window_status_separator='' 1252 + # fi 1253 + # 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" 1254 + # 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" 1255 + # fi 1256 + # 1257 + # # -- indicators 1258 + # 1259 + # tmux_conf_theme_pairing=${tmux_conf_theme_pairing:-⚇} # U+2687 1260 + # tmux_conf_theme_pairing_fg=${tmux_conf_theme_pairing_fg:-none} 1261 + # tmux_conf_theme_pairing_bg=${tmux_conf_theme_pairing_bg:-none} 1262 + # tmux_conf_theme_pairing_attr=${tmux_conf_theme_pairing_attr:-none} 1263 + # 1264 + # tmux_conf_theme_prefix=${tmux_conf_theme_prefix:-⌨} # U+2328 1265 + # tmux_conf_theme_prefix_fg=${tmux_conf_theme_prefix_fg:-none} 1266 + # tmux_conf_theme_prefix_bg=${tmux_conf_theme_prefix_bg:-none} 1267 + # tmux_conf_theme_prefix_attr=${tmux_conf_theme_prefix_attr:-none} 1268 + # 1269 + # tmux_conf_theme_mouse=${tmux_conf_theme_mouse:-↗} # U+2197 1270 + # tmux_conf_theme_mouse_fg=${tmux_conf_theme_mouse_fg:-none} 1271 + # tmux_conf_theme_mouse_bg=${tmux_conf_theme_mouse_bg:-none} 1272 + # tmux_conf_theme_mouse_attr=${tmux_conf_theme_mouse_attr:-none} 1273 + # 1274 + # tmux_conf_theme_root=${tmux_conf_theme_root:-!} 1275 + # tmux_conf_theme_root_fg=${tmux_conf_theme_root_fg:-none} 1276 + # tmux_conf_theme_root_bg=${tmux_conf_theme_root_bg:-none} 1277 + # tmux_conf_theme_root_attr=${tmux_conf_theme_root_attr:-bold,blink} 1278 + # 1279 + # tmux_conf_theme_synchronized=${tmux_conf_theme_synchronized:-⚏} # U+268F 1280 + # tmux_conf_theme_synchronized_fg=${tmux_conf_theme_synchronized_fg:-none} 1281 + # tmux_conf_theme_synchronized_bg=${tmux_conf_theme_synchronized_bg:-none} 1282 + # tmux_conf_theme_synchronized_attr=${tmux_conf_theme_synchronized_attr:-none} 1283 + # 1284 + # # -- status-left style 1285 + # 1286 + # 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,} '} 1287 + # 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} 1288 + # 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} 1289 + # tmux_conf_theme_status_left_attr=${tmux_conf_theme_status_left_attr:-bold,none,none} 1290 + # 1291 + # if [ -n "$tmux_conf_theme_status_left" ]; then 1292 + # status_left=$(echo "$tmux_conf_theme_status_left" | sed \ 1293 + # -e "s/#{pairing}/#[fg=$tmux_conf_theme_pairing_fg]#[bg=$tmux_conf_theme_pairing_bg]#[$tmux_conf_theme_pairing_attr]#{pairing}#[inherit]/g" \ 1294 + # -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{prefix}#[inherit]/g" \ 1295 + # -e "s/#{mouse}/#[fg=$tmux_conf_theme_mouse_fg]#[bg=$tmux_conf_theme_mouse_bg]#[$tmux_conf_theme_mouse_attr]#{mouse}#[inherit]/g" \ 1296 + # -e "s/#{synchronized}/#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{synchronized}#[inherit]/g" \ 1297 + # -e "s/#{root}/#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#{root}#[inherit]/g") 1298 + # 1299 + # status_left=$(printf '%s' "$status_left" | awk \ 1300 + # -v status_bg="$tmux_conf_theme_status_bg" \ 1301 + # -v fg_="$tmux_conf_theme_status_left_fg" \ 1302 + # -v bg_="$tmux_conf_theme_status_left_bg" \ 1303 + # -v attr_="$tmux_conf_theme_status_left_attr" \ 1304 + # -v mainsep="$tmux_conf_theme_left_separator_main" \ 1305 + # -v subsep="$tmux_conf_theme_left_separator_sub" ' 1306 + # function subsplit(s, l, i, a, r) 1307 + # { 1308 + # l = split(s, a, ",") 1309 + # for (i = 1; i <= l; ++i) 1310 + # { 1311 + # o = split(a[i], _, "(") - 1 1312 + # c = split(a[i], _, ")") - 1 1313 + # open += o - c 1314 + # o_ = split(a[i], _, "{") - 1 1315 + # c_ = split(a[i], _, "}") - 1 1316 + # open_ += o_ - c_ 1317 + # o__ = split(a[i], _, "[") - 1 1318 + # c__ = split(a[i], _, "]") - 1 1319 + # open__ += o__ - c__ 1320 + # 1321 + # if (i == l) 1322 + # r = sprintf("%s%s", r, a[i]) 1323 + # else if (open || open_ || open__) 1324 + # r = sprintf("%s%s,", r, a[i]) 1325 + # else 1326 + # r = sprintf("%s%s#[fg=%s,bg=%s,%s]%s", r, a[i], fg[j], bg[j], attr[j], subsep) 1327 + # } 1328 + # 1329 + # gsub(/#\[inherit\]/, sprintf("#[default]#[fg=%s,bg=%s,%s]", fg[j], bg[j], attr[j]), r) 1330 + # return r 1331 + # } 1332 + # BEGIN { 1333 + # FS = "|" 1334 + # l1 = split(fg_, fg, ",") 1335 + # l2 = split(bg_, bg, ",") 1336 + # l3 = split(attr_, attr, ",") 1337 + # l = l1 < l2 ? (l1 < l3 ? l1 : l3) : (l2 < l3 ? l2 : l3) 1338 + # } 1339 + # { 1340 + # for (i = j = 1; i <= NF; ++i) 1341 + # { 1342 + # if (open || open_ || open__) 1343 + # printf "|%s", subsplit($i) 1344 + # else 1345 + # { 1346 + # if (i > 1) 1347 + # 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) 1348 + # else 1349 + # printf "#[fg=%s,bg=%s,%s]%s", fg[j], bg[j], attr[j], subsplit($i) 1350 + # } 1351 + # 1352 + # if (!open && !open_ && !open__) 1353 + # { 1354 + # j_ = j 1355 + # j = j % l + 1 1356 + # } 1357 + # } 1358 + # printf "#[fg=%s,bg=%s,none]%s", bg[j_], status_bg, mainsep 1359 + # }') 1360 + # fi 1361 + # status_left="$status_left " 1362 + # 1363 + # # -- status-right style 1364 + # 1365 + # 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} '} 1366 + # 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} 1367 + # 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} 1368 + # tmux_conf_theme_status_right_attr=${tmux_conf_theme_status_right_attr:-none,none,bold} 1369 + # 1370 + # if [ -n "$tmux_conf_theme_status_right" ]; then 1371 + # status_right=$(echo "$tmux_conf_theme_status_right" | sed \ 1372 + # -e "s/#{pairing}/#[fg=$tmux_conf_theme_pairing_fg]#[bg=$tmux_conf_theme_pairing_bg]#[$tmux_conf_theme_pairing_attr]#{pairing}#[inherit]/g" \ 1373 + # -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{prefix}#[inherit]/g" \ 1374 + # -e "s/#{mouse}/#[fg=$tmux_conf_theme_mouse_fg]#[bg=$tmux_conf_theme_mouse_bg]#[$tmux_conf_theme_mouse_attr]#{mouse}#[inherit]/g" \ 1375 + # -e "s/#{synchronized}/#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{synchronized}#[inherit]/g" \ 1376 + # -e "s/#{root}/#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#{root}#[inherit]/g") 1377 + # 1378 + # status_right=$(printf '%s' "$status_right" | awk \ 1379 + # -v status_bg="$tmux_conf_theme_status_bg" \ 1380 + # -v fg_="$tmux_conf_theme_status_right_fg" \ 1381 + # -v bg_="$tmux_conf_theme_status_right_bg" \ 1382 + # -v attr_="$tmux_conf_theme_status_right_attr" \ 1383 + # -v mainsep="$tmux_conf_theme_right_separator_main" \ 1384 + # -v subsep="$tmux_conf_theme_right_separator_sub" ' 1385 + # function subsplit(s, l, i, a, r) 1386 + # { 1387 + # l = split(s, a, ",") 1388 + # for (i = 1; i <= l; ++i) 1389 + # { 1390 + # o = split(a[i], _, "(") - 1 1391 + # c = split(a[i], _, ")") - 1 1392 + # open += o - c 1393 + # o_ = split(a[i], _, "{") - 1 1394 + # c_ = split(a[i], _, "}") - 1 1395 + # open_ += o_ - c_ 1396 + # o__ = split(a[i], _, "[") - 1 1397 + # c__ = split(a[i], _, "]") - 1 1398 + # open__ += o__ - c__ 1399 + # 1400 + # if (i == l) 1401 + # r = sprintf("%s%s", r, a[i]) 1402 + # else if (open || open_ || open__) 1403 + # r = sprintf("%s%s,", r, a[i]) 1404 + # else 1405 + # r = sprintf("%s%s#[fg=%s,bg=%s,%s]%s", r, a[i], fg[j], bg[j], attr[j], subsep) 1406 + # } 1407 + # 1408 + # gsub(/#\[inherit\]/, sprintf("#[default]#[fg=%s,bg=%s,%s]", fg[j], bg[j], attr[j]), r) 1409 + # return r 1410 + # } 1411 + # BEGIN { 1412 + # FS = "|" 1413 + # l1 = split(fg_, fg, ",") 1414 + # l2 = split(bg_, bg, ",") 1415 + # l3 = split(attr_, attr, ",") 1416 + # l = l1 < l2 ? (l1 < l3 ? l1 : l3) : (l2 < l3 ? l2 : l3) 1417 + # } 1418 + # { 1419 + # for (i = j = 1; i <= NF; ++i) 1420 + # { 1421 + # if (open_ || open || open__) 1422 + # printf "|%s", subsplit($i) 1423 + # else 1424 + # 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) 1425 + # 1426 + # if (!open && !open_ && !open__) 1427 + # { 1428 + # j_ = j 1429 + # j = j % l + 1 1430 + # } 1431 + # } 1432 + # }') 1433 + # fi 1434 + # status_right=${status_right-} 1435 + # 1436 + # # -- clock --------------------------------------------------------------- 1437 + # 1438 + # tmux_conf_theme_clock_colour=${tmux_conf_theme_clock_colour:-$tmux_conf_theme_colour_4} 1439 + # tmux_conf_theme_clock_style=${tmux_conf_theme_clock_style:-24} 1440 + # 1441 + # tmux setw -g window-style "$window_style" \; setw -g window-active-style "$window_active_style" \;\ 1442 + # 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" \;\ 1443 + # set -g display-panes-colour "$tmux_conf_theme_pane_indicator" \; set -g display-panes-active-colour "$tmux_conf_theme_pane_active_indicator" \;\ 1444 + # set -g message-style "fg=$tmux_conf_theme_message_fg,bg=$tmux_conf_theme_message_bg,$tmux_conf_theme_message_attr" \;\ 1445 + # 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" \;\ 1446 + # setw -g mode-style "fg=$tmux_conf_theme_mode_fg,bg=$tmux_conf_theme_mode_bg,$tmux_conf_theme_mode_attr" \;\ 1447 + # set -g status-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\ 1448 + # set -g status-left-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\ 1449 + # set -g status-right-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\ 1450 + # 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" \;\ 1451 + # 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" \;\ 1452 + # 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" \;\ 1453 + # 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" \;\ 1454 + # 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" \;\ 1455 + # setw -g window-status-separator "$window_status_separator" \;\ 1456 + # setw -g clock-mode-colour "$tmux_conf_theme_clock_colour" \;\ 1457 + # setw -g clock-mode-style "$tmux_conf_theme_clock_style" 1458 + # fi 1459 + # 1460 + # # -- variables ------------------------------------------------------------- 1461 + # 1462 + # set_titles_string=$(printf '%s' "${tmux_conf_theme_terminal_title:-$(tmux show -gv set-titles-string)}" | sed \ 1463 + # -e "s%#{circled_window_index}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#I')%g" \ 1464 + # -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \ 1465 + # -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \ 1466 + # -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \ 1467 + # -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \ 1468 + # -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \ 1469 + # -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \ 1470 + # -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \ 1471 + # -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g") 1472 + # 1473 + # window_status_format=$(printf '%s' "${window_status_format:-$(tmux show -gv window-status-format)}" | sed \ 1474 + # -e "s%#{circled_window_index}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#I')%g" \ 1475 + # -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \ 1476 + # -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \ 1477 + # -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \ 1478 + # -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \ 1479 + # -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \ 1480 + # -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \ 1481 + # -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \ 1482 + # -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g") 1483 + # 1484 + # window_status_current_format=$(printf '%s' "${window_status_current_format:-$(tmux show -gv window-status-current-format)}" | sed \ 1485 + # -e "s%#{circled_window_index}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#I')%g" \ 1486 + # -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \ 1487 + # -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \ 1488 + # -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \ 1489 + # -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \ 1490 + # -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \ 1491 + # -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \ 1492 + # -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \ 1493 + # -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g") 1494 + # 1495 + # status_left=$(printf '%s' "${status_left-$(tmux show -gv status-left)}" | sed \ 1496 + # -e "s/#{pairing}/#{?session_many_attached,$tmux_conf_theme_pairing ,}/g" \ 1497 + # -e "s/#{prefix}/#{?client_prefix,$tmux_conf_theme_prefix ,$(printf '%s' "$tmux_conf_theme_prefix" | sed -e 's/./ /g') }/g" \ 1498 + # -e "s/#{mouse}/#{?mouse,$tmux_conf_theme_mouse ,$(printf '%s' "$tmux_conf_theme_mouse" | sed -e 's/./ /g') }/g" \ 1499 + # -e "s%#{synchronized}%#{?pane_synchronized,$tmux_conf_theme_synchronized ,}%g" \ 1500 + # -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \ 1501 + # -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \ 1502 + # -e "s%#{root}%#{?#{==:#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' '#D'),root},$tmux_conf_theme_root,}%g") 1503 + # 1504 + # status_right=$(printf '%s' "${status_right-$(tmux show -gv status-right)}" | sed \ 1505 + # -e "s/#{pairing}/#{?session_many_attached,$tmux_conf_theme_pairing ,}/g" \ 1506 + # -e "s/#{prefix}/#{?client_prefix,$tmux_conf_theme_prefix ,$(printf '%s' "$tmux_conf_theme_prefix" | sed -e 's/./ /g') }/g" \ 1507 + # -e "s/#{mouse}/#{?mouse,$tmux_conf_theme_mouse ,$(printf '%s' "$tmux_conf_theme_mouse" | sed -e 's/./ /g') }/g" \ 1508 + # -e "s%#{synchronized}%#{?pane_synchronized,$tmux_conf_theme_synchronized ,}%g" \ 1509 + # -e "s%#{circled_session_name}%#(cut -c3- '$TMUX_CONF' | sh -s _circled '#S')%g" \ 1510 + # -e "s%#{pretty_pane_current_path}%#(cut -c3- '$TMUX_CONF' | sh -s _pretty_path auto '#{pane_current_path}')%g" \ 1511 + # -e "s%#{root}%#{?#{==:#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' '#D'),root},$tmux_conf_theme_root,}%g") 1512 + # 1513 + # tmux_conf_battery_bar_symbol_full=$(_decode_unicode_escapes "${tmux_conf_battery_bar_symbol_full:-◼}") 1514 + # tmux_conf_battery_bar_symbol_empty=$(_decode_unicode_escapes "${tmux_conf_battery_bar_symbol_empty:-◻}") 1515 + # tmux_conf_battery_bar_length=${tmux_conf_battery_bar_length:-auto} 1516 + # tmux_conf_battery_bar_palette=${tmux_conf_battery_bar_palette:-gradient} 1517 + # tmux_conf_battery_hbar_palette=${tmux_conf_battery_hbar_palette:-gradient} 1518 + # tmux_conf_battery_vbar_palette=${tmux_conf_battery_vbar_palette:-gradient} 1519 + # tmux_conf_battery_status_charging=$(_decode_unicode_escapes "${tmux_conf_battery_status_charging:-↑}") # U+2191 1520 + # tmux_conf_battery_status_discharging=$(_decode_unicode_escapes "${tmux_conf_battery_status_discharging:-↓}") # U+2193 1521 + # 1522 + # _pkillf 'sh -s _battery_info' 1523 + # _battery_info 1524 + # if [ "$battery_charge" != 0 ]; then 1525 + # case "$status_left $status_right" in 1526 + # *'#{battery_'*|*'#{?battery_'*) 1527 + # status_left=$(echo "$status_left" | sed -E \ 1528 + # -e 's%#\{\?battery_bar%#\{?@battery_percentage%g' \ 1529 + # -e 's%#\{\?battery_hbar%#\{?@battery_percentage%g' \ 1530 + # -e 's%#\{\?battery_vbar%#\{?@battery_percentage%g' \ 1531 + # -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" \ 1532 + # -e "s%#\{battery_hbar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _hbar '$(printf '%s' "$tmux_conf_battery_hbar_palette" | tr ',' ';')' '#{@battery_charge}')%g" \ 1533 + # -e "s%#\{battery_vbar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _vbar '$(printf '%s' "$tmux_conf_battery_vbar_palette" | tr ',' ';')' '#{@battery_charge}')%g" \ 1534 + # -e 's%#\{(\?)?battery_status%#\{\1@battery_status%g' \ 1535 + # -e 's%#\{(\?)?battery_percentage%#\{\1@battery_percentage%g') 1536 + # status_right=$(echo "$status_right" | sed -E \ 1537 + # -e 's%#\{\?battery_bar%#\{?@battery_percentage%g' \ 1538 + # -e 's%#\{\?battery_hbar%#\{?@battery_percentage%g' \ 1539 + # -e 's%#\{\?battery_vbar%#\{?@battery_percentage%g' \ 1540 + # -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" \ 1541 + # -e "s%#\{battery_hbar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _hbar '$(printf '%s' "$tmux_conf_battery_hbar_palette" | tr ',' ';')' '#{@battery_charge}')%g" \ 1542 + # -e "s%#\{battery_vbar\}%#(nice cut -c3- '$TMUX_CONF' | sh -s _vbar '$(printf '%s' "$tmux_conf_battery_vbar_palette" | tr ',' ';')' '#{@battery_charge}')%g" \ 1543 + # -e 's%#\{(\?)?battery_status%#\{\1@battery_status%g' \ 1544 + # -e 's%#\{(\?)?battery_percentage%#\{\1@battery_percentage%g') 1545 + # status_right="#(echo; nice cut -c3- '$TMUX_CONF' | sh -s _battery_status '$tmux_conf_battery_status_charging' '$tmux_conf_battery_status_discharging')$status_right" 1546 + # interval=60 1547 + # if [ "$_tmux_version" -eq 3500 ]; then 1548 + # 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'" 1549 + # elif [ "$_tmux_version" -ge 3200 ]; then 1550 + # 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" 1551 + # elif [ "$_tmux_version" -ge 2800 ]; then 1552 + # 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" 1553 + # elif [ "$_tmux_version" -gt 2400 ]; then 1554 + # status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right" 1555 + # else 1556 + # status_right="#(nice cut -c3- '$TMUX_CONF' | sh -s _battery_info)$status_right" 1557 + # fi 1558 + # ;; 1559 + # esac 1560 + # fi 1561 + # 1562 + # case "$status_left $status_right" in 1563 + # *'#{username}'*|*'#{hostname}'*|*'#{hostname_full}'*|*'#{username_ssh}'*|*'#{hostname_ssh}'*|*'#{hostname_full_ssh}'*) 1564 + # status_left=$(echo "$status_left" | sed \ 1565 + # -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \ 1566 + # -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \ 1567 + # -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \ 1568 + # -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \ 1569 + # -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \ 1570 + # -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g") 1571 + # status_right=$(echo "$status_right" | sed \ 1572 + # -e "s%#{username}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' false '#D')%g" \ 1573 + # -e "s%#{hostname}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false false '#h' '#D')%g" \ 1574 + # -e "s%#{hostname_full}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' false true '#H' '#D')%g" \ 1575 + # -e "s%#{username_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _username '#{pane_pid}' '#{b:pane_tty}' true '#D')%g" \ 1576 + # -e "s%#{hostname_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true false '#h' '#D')%g" \ 1577 + # -e "s%#{hostname_full_ssh}%#(cut -c3- '$TMUX_CONF' | sh -s _hostname '#{pane_pid}' '#{b:pane_tty}' true true '#H' '#D')%g") 1578 + # ;; 1579 + # esac 1580 + # 1581 + # _pkillf 'sh -s _uptime' 1582 + # case "$status_left $status_right" in 1583 + # *'#{uptime_'*|*'#{?uptime_'*) 1584 + # status_left=$(echo "$status_left" | perl -p -e ' 1585 + # ; s/#\{(\?)?uptime_y\b/#\{\1\@uptime_y/g 1586 + # ; s/#\{(\?)?uptime_d\b/#\{\1\@uptime_d/g 1587 + # ; s/\@uptime_d\b/\@uptime_dy/g if /\@uptime_y\b/ 1588 + # ; s/#\{(\?)?uptime_h\b/#\{\1\@uptime_h/g 1589 + # ; s/#\{(\?)?uptime_m\b/#\{\1\@uptime_m/g 1590 + # ; s/#\{(\?)?uptime_s\b/#\{\1\@uptime_s/g') 1591 + # status_right=$(echo "$status_right" | perl -p -e ' 1592 + # ; s/#\{(\?)?uptime_y\b/#\{\1\@uptime_y/g 1593 + # ; s/#\{(\?)?uptime_d\b/#\{\1\@uptime_d/g 1594 + # ; s/\@uptime_d\b/\@uptime_dy/g if /\@uptime_y\b/ 1595 + # ; s/#\{(\?)?uptime_h\b/#\{\1\@uptime_h/g 1596 + # ; s/#\{(\?)?uptime_m\b/#\{\1\@uptime_m/g 1597 + # ; s/#\{(\?)?uptime_s\b/#\{\1\@uptime_s/g') 1598 + # interval=60 1599 + # case "$status_left $status_right" in 1600 + # *'#{@uptime_s}'*) 1601 + # interval=$(tmux show -gv status-interval) 1602 + # ;; 1603 + # esac 1604 + # if [ "$_tmux_version" -eq 3500 ]; then 1605 + # 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'" 1606 + # elif [ "$_tmux_version" -ge 3200 ]; then 1607 + # 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" 1608 + # elif [ "$_tmux_version" -ge 2800 ]; then 1609 + # 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" 1610 + # elif [ "$_tmux_version" -gt 2400 ]; then 1611 + # status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right" 1612 + # else 1613 + # status_right="#(nice cut -c3- '$TMUX_CONF' | sh -s _uptime)$status_right" 1614 + # fi 1615 + # ;; 1616 + # esac 1617 + # 1618 + # _pkillf 'sh -s _loadavg' 1619 + # case "$status_left $status_right" in 1620 + # *'#{loadavg'*|*'#{?loadavg'*) 1621 + # status_left=$(echo "$status_left" | sed -E \ 1622 + # -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g') 1623 + # status_right=$(echo "$status_right" | sed -E \ 1624 + # -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g') 1625 + # interval=$(tmux show -gv status-interval) 1626 + # if [ "$_tmux_version" -eq 3500 ]; then 1627 + # 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'" 1628 + # elif [ "$_tmux_version" -ge 3200 ]; then 1629 + # 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" 1630 + # elif [ "$_tmux_version" -ge 2800 ]; then 1631 + # 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" 1632 + # elif [ "$_tmux_version" -gt 2400 ]; then 1633 + # status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right" 1634 + # else 1635 + # status_right="#(nice cut -c3- '$TMUX_CONF' | sh -s _loadavg)$status_right" 1636 + # fi 1637 + # ;; 1638 + # esac 1639 + # 1640 + # # -- custom variables ------------------------------------------------------ 1641 + # 1642 + # if [ -f "$TMUX_CONF_LOCAL" ] && [ "$(cut -c3- "$TMUX_CONF_LOCAL" | sh 2>/dev/null -s printf probe)" = "probe" ]; then 1643 + # 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") 1644 + # status_left=$(echo "$status_left" | perl -p -e "$replacements" || echo "$status_left") 1645 + # status_right=$(echo "$status_right" | perl -p -e "$replacements" || echo "$status_right") 1646 + # fi 1647 + # 1648 + # # -------------------------------------------------------------------------- 1649 + # 1650 + # tmux set -g set-titles-string "$(_decode_unicode_escapes "$set_titles_string")" \;\ 1651 + # setw -g window-status-format "$(_decode_unicode_escapes "$window_status_format")" \;\ 1652 + # setw -g window-status-current-format "$(_decode_unicode_escapes "$window_status_current_format")" \;\ 1653 + # set -g status-left-length 1000 \; set -g status-left "$(_decode_unicode_escapes "$status_left")" \;\ 1654 + # set -g status-right-length 1000 \; set -g status-right "$(_decode_unicode_escapes "$status_right")" 1655 + # } 1656 + # 1657 + # __apply_plugins() { 1658 + # TMUX_PLUGIN_MANAGER_PATH="$1" 1659 + # window_active="$2" 1660 + # tmux_conf_update_plugins_on_launch="$3" 1661 + # tmux_conf_update_plugins_on_reload="$4" 1662 + # tmux_conf_uninstall_plugins_on_reload="$5" 1663 + # 1664 + # if [ -z "$TMUX_PLUGIN_MANAGER_PATH" ]; then 1665 + # return 255 1666 + # fi 1667 + # mkdir -p "$TMUX_PLUGIN_MANAGER_PATH" 1668 + # 1669 + # __discover_plugins() ( 1670 + # probe_socket="$(dirname "$TMUX_SOCKET")/tmux-discover-plugins-$$" 1671 + # TMUX_SOCKET="$probe_socket" tmux -f /dev/null start-server \; set-option exit-empty off 1672 + # ___discover_plugins() { 1673 + # depth=$((${depth:-0} + 1)) 1674 + # IFS=${_IFS:-$IFS} 1675 + # [ "$depth" -le 100 ] || return 1676 + # for current_file in "$@"; do 1677 + # current_file="$(cd "${current_file%/*}" 2>/dev/null && pwd)/${current_file##*/}" || continue 1678 + # while IFS= read -r line; do 1679 + # 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 1680 + # discovered_plugins="${discovered_plugins}${discovered_plugins:+ }${plugin}" 1681 + # 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 1682 + # next_files=$(TMUX_SOCKET="$probe_socket" tmux -f /dev/null \ 1683 + # set -g @current_file "$current_file" \; \ 1684 + # display -pF "$next_files") 1685 + # 1686 + # _IFS="$IFS" 1687 + # IFS=$(printf '\n\nx') 1688 + # IFS=${IFS%?} 1689 + # # we don't want quoting here as we want wildcard expansion 1690 + # # shellcheck disable=SC2046 1691 + # ___discover_plugins $(printf '%s\n' "$next_files" | xargs printf '%s\n\n') 1692 + # fi 1693 + # done << EOF 1694 + # $(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") 1695 + # EOF 1696 + # done 1697 + # } 1698 + # ___discover_plugins "$@" 1699 + # TMUX_SOCKET="$probe_socket" tmux -f /dev/null kill-server 1700 + # rm -rf "$probe_socket" 1701 + # printf '%s\n' "$discovered_plugins" 1702 + # ) 1703 + # 1704 + # tpm_plugins=$(tmux show -gvq '@tpm_plugins' 2>/dev/null) 1705 + # tpm_plugins=$(cat << EOF | tr ' ' '\n' | awk '/^\s*$/ {next;}; !seen[$0]++ { gsub(/^[ \t]+/,"",$0); gsub(/[ \t]+$/,"",$0); print $0 }' 1706 + # $tpm_plugins 1707 + # $(__discover_plugins "$TMUX_CONF_LOCAL") 1708 + # EOF 1709 + # ) 1710 + # if [ -z "$tpm_plugins" ]; then 1711 + # if _is_true "$tmux_conf_uninstall_plugins_on_reload" && [ -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then 1712 + # tmux display 'Uninstalling tpm and plugins...' 1713 + # tmux set-environment -gu TMUX_PLUGIN_MANAGER_PATH 1714 + # rm -rf "$TMUX_PLUGIN_MANAGER_PATH" 1715 + # tmux display 'Done uninstalling tpm and plugins...' 1716 + # fi 1717 + # else 1718 + # if [ "$(command tmux display -p '#{pid} #{version} #{socket_path}')" = "$("$TMUX_PROGRAM" display -p '#{pid} #{version} #{socket_path}')" ]; then 1719 + # tmux set-environment -g TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGIN_MANAGER_PATH" 1720 + # tmux set -g '@tpm_plugins' "$tpm_plugins" 1721 + # 1722 + # if [ -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then 1723 + # [ -z "$(tmux show -gqv '@tpm-install')" ] && tmux set -g '@tpm-install' 'I' 1724 + # [ -z "$(tmux show -gqv '@tpm-update')" ] && tmux set -g '@tpm-update' 'u' 1725 + # [ -z "$(tmux show -gqv '@tpm-clean')" ] && tmux set -g '@tpm-clean' 'M-u' 1726 + # "$TMUX_PLUGIN_MANAGER_PATH/tpm/tpm" || tmux display "One or more tpm plugin(s) failed" 1727 + # fi 1728 + # 1729 + # if git ls-remote -hq https://github.com/gpakosz/.tmux.git master > /dev/null; then 1730 + # if [ ! -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then 1731 + # install_tpm=true 1732 + # tmux display 'Installing tpm and plugins...' 1733 + # git clone --depth 1 https://github.com/tmux-plugins/tpm "$TMUX_PLUGIN_MANAGER_PATH/tpm" 1734 + # elif { [ -z "$window_active" ] && _is_true "$tmux_conf_update_plugins_on_launch"; } || { [ -n "$window_active" ] && _is_true "$tmux_conf_update_plugins_on_reload"; }; then 1735 + # update_tpm=true 1736 + # tmux display 'Updating tpm and plugins...' 1737 + # (cd "$TMUX_PLUGIN_MANAGER_PATH/tpm" && git fetch -q -p && git checkout -q master && git reset -q --hard origin/master) 1738 + # fi 1739 + # if [ "$install_tpm" = "true" ] || [ "$update_tpm" = "true" ]; then 1740 + # perl -0777 -p -i -e 's/git clone(?!\s+--depth\s+1)/git clone --depth 1/g 1741 + # ;s/(install_plugin(.(?!&))*)\n(\s+)done/\1&\n\3done\n\3wait/g' "$TMUX_PLUGIN_MANAGER_PATH/tpm/scripts/install_plugins.sh" 1742 + # 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" 1743 + # 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" 1744 + # fi 1745 + # if [ "$update_tpm" = "true" ]; then 1746 + # { 1747 + # { 1748 + # printf 'List of discovered tpm plugins: %s\n' "$(printf '%s\n' "$tpm_plugins" | paste -s -d ' ' -)" | _timestamp 1749 + # printf '%s\n' "Invoking $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins" | _timestamp 1750 + # "$TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins" 2>&1 | _timestamp 1751 + # printf '%s\n' "Invoking $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/update_plugins all" | _timestamp 1752 + # "$TMUX_PLUGIN_MANAGER_PATH/tpm/bin/update_plugins" all 2>&1 | _timestamp 1753 + # printf '%s\n' "Invoking $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/clean_plugins all" | _timestamp 1754 + # "$TMUX_PLUGIN_MANAGER_PATH/tpm/bin/clean_plugins" all 2>&1 | _timestamp 1755 + # cut -c3- "$TMUX_CONF" | sh -s _apply_important 1756 + # printf 'Done.\n' | _timestamp 1757 + # printf '\n' 1758 + # } >> "$TMUX_PLUGIN_MANAGER_PATH/tpm_log.txt" 1759 + # 1760 + # tmux display 'Done updating tpm and plugins...' 1761 + # } || tmux display 'Failed updating tpm and plugins...' 1762 + # elif [ "$install_tpm" = "true" ]; then 1763 + # { 1764 + # { 1765 + # printf 'List of discovered tpm plugins: %s\n' "$(printf '%s\n' "$tpm_plugins" | paste -s -d ' ' -)" | _timestamp 1766 + # printf '%s\n' "Invoking $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins" | _timestamp 1767 + # "$TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins" 2>&1 | _timestamp 1768 + # cut -c3- "$TMUX_CONF" | sh -s _apply_important 1769 + # printf 'Done.\n' | _timestamp 1770 + # printf '\n' >> "$TMUX_PLUGIN_MANAGER_PATH/tpm_log.txt" 1771 + # } >> "$TMUX_PLUGIN_MANAGER_PATH/tpm_log.txt" 1772 + # 1773 + # tmux display 'Done installing tpm and plugins...' 1774 + # 1775 + # [ -z "$(tmux show -gqv '@tpm-install')" ] && tmux set -g '@tpm-install' 'I' 1776 + # [ -z "$(tmux show -gqv '@tpm-update')" ] && tmux set -g '@tpm-update' 'u' 1777 + # [ -z "$(tmux show -gqv '@tpm-clean')" ] && tmux set -g '@tpm-clean' 'M-u' 1778 + # "$TMUX_PLUGIN_MANAGER_PATH/tpm/tpm" || tmux display "One or more tpm plugin(s) failed" 1779 + # } || tmux display 'Failed installing tpm and plugins...' 1780 + # fi 1781 + # else 1782 + # tmux display "GitHub doesn't seem to be reachable, skipping installing and/or updating tpm and plugins..." 1783 + # fi 1784 + # else 1785 + # if [ "$_tmux_version" -ge 3200 ]; then 1786 + # 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\"'" 1787 + # else 1788 + # 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'" 1789 + # fi 1790 + # fi 1791 + # 1792 + # if [ "$_tmux_version" -gt 2600 ]; then 1793 + # tmux set -gu '@tpm-install' \; set -gu '@tpm-update' \; set -gu '@tpm-clean' \; set -gu '@plugin' \; set -gu '@tpm_plugins' 1794 + # else 1795 + # tmux set -g '@tpm-install' '' \; set -g '@tpm-update' '' \; set -g '@tpm-clean' '' \; set -g '@plugin' '' \; set-gu '@tpm_plugins' '' 1796 + # fi 1797 + # fi 1798 + # } 1799 + # 1800 + # _apply_plugins() { 1801 + # tmux_conf_update_plugins_on_launch=${tmux_conf_update_plugins_on_launch:-true} 1802 + # tmux_conf_update_plugins_on_reload=${tmux_conf_update_plugins_on_reload:-true} 1803 + # tmux_conf_uninstall_plugins_on_reload=${tmux_conf_uninstall_plugins_on_reload:-true} 1804 + # 1805 + # if [ -z "$TMUX_PLUGIN_MANAGER_PATH" ]; then 1806 + # if [ "$(dirname "$TMUX_CONF")" = "$HOME" ]; then 1807 + # TMUX_PLUGIN_MANAGER_PATH="$HOME/.tmux/plugins" 1808 + # else 1809 + # TMUX_PLUGIN_MANAGER_PATH="$(dirname "$TMUX_CONF")/plugins" 1810 + # fi 1811 + # fi 1812 + # 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'" 1813 + # } 1814 + # 1815 + # _apply_important() { 1816 + # cfg=$(mktemp) && trap 'rm -f $cfg*' EXIT 1817 + # 1818 + # if perl -n -e 'print if /^\s*(?:set|bind|unbind).+?#!important\s*$/' "$TMUX_CONF_LOCAL" 2>/dev/null > "$cfg.local"; then 1819 + # if ! tmux source-file "$cfg.local"; then 1820 + # if tmux source-file -v /dev/null 2> /dev/null; then 1821 + # verbose_flag='-v' 1822 + # fi 1823 + # while ! out=$(tmux source-file "${verbose_flag:+$verbose_flag}" "$cfg.local"); do 1824 + # line=$(printf "%s" "$out" | tail -1 | cut -d':' -f2) 1825 + # perl -n -i -e "if ($. != $line) { print }" "$cfg.local" 1826 + # done 1827 + # fi 1828 + # fi 1829 + # } 1830 + # 1831 + # _apply_configuration() { 1832 + # window_active="$(tmux display -p '#{window_active}' 2>/dev/null || true)" 1833 + # if [ -z "$window_active" ]; then 1834 + # if [ "$_tmux_version" -lt 2600 ]; then 1835 + # tmux run -b 'tmux set display-time 3000 \; display "This configuration requires tmux 2.6+" \; set -u display-time \; run "sleep 3" \; kill-server' 1836 + # return 1837 + # fi 1838 + # if [ "$_tmux_version" -ge 3200 ]; then 1839 + # for cmd in perl sed awk; do 1840 + # if ! command -v "$cmd" > /dev/null 2>&1; then 1841 + # tmux run -b "tmux display -N -d 3000 'This configuration requires $cmd' \; run 'sleep 3' \; kill-server" 1842 + # return 1843 + # fi 1844 + # done 1845 + # else 1846 + # for cmd in perl sed awk; do 1847 + # if ! command -v "$cmd" > /dev/null 2>&1; then 1848 + # tmux run -b "tmux set display-time 3000 \; display 'This configuration requires $cmd' \; set -u display-time \; run 'sleep 3' \; kill-server" 1849 + # return 1850 + # fi 1851 + # done 1852 + # fi 1853 + # fi 1854 + # 1855 + # case "$_uname_s" in 1856 + # *CYGWIN*|*MSYS*) 1857 + # # prevent Cygwin and MSYS2 from cd-ing into home directory when evaluating /etc/profile 1858 + # tmux setenv -g CHERE_INVOKING 1 1859 + # ;; 1860 + # esac 1861 + # 1862 + # _apply_tmux_256color 1863 + # _apply_24b& 1864 + # _apply_theme& 1865 + # _apply_bindings& 1866 + # wait 1867 + # 1868 + # _apply_plugins 1869 + # _apply_important 1870 + # 1871 + # # shellcheck disable=SC2046 1872 + # tmux setenv -gu tmux_conf_dummy $(printenv | grep -E -o '^tmux_conf_[^=]+' | awk '{printf "; setenv -gu %s", $0}') 1873 + # } 1874 + # 1875 + # _urlview() { 1876 + # pane_id="$1"; shift 1877 + # tmux capture-pane -J -S - -E - -b "urlview-$pane_id" -t "$pane_id" 1878 + # 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'" 1879 + # } 1880 + # 1881 + # _urlscan() { 1882 + # pane_id="$1"; shift 1883 + # tmux capture-pane -J -S - -E - -b "urlscan-$pane_id" -t "$pane_id" 1884 + # 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'" 1885 + # } 1886 + # 1887 + # _fpp() { 1888 + # tmux capture-pane -J -S - -E - -b "fpp-$1" -t "$1" 1889 + # 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'" 1890 + # } 1891 + # 1892 + # "$@"
+508
.tmux.conf.local
··· 1 + # : << 'EOF' 2 + # Oh my tmux! 3 + # 💛🩷💙🖤❤️🤍 4 + # https://github.com/gpakosz/.tmux 5 + # (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, 6 + # without any warranty. 7 + # Copyright 2012— Gregory Pakosz (@gpakosz). 8 + 9 + 10 + # -- bindings ------------------------------------------------------------------ 11 + 12 + # preserve tmux stock bindings, 13 + # while adding bindings that don't conflict with these stock bindings 14 + # /!\ this disables some of Oh my tmux! bindings described in README.md 15 + # - true 16 + # - false (default) 17 + tmux_conf_preserve_stock_bindings=false 18 + 19 + 20 + # -- session creation ---------------------------------------------------------- 21 + 22 + # prompt for session name when creating a new session, possible values are: 23 + # - true 24 + # - false (default) 25 + # - disabled (do not modify new-session bindings) 26 + tmux_conf_new_session_prompt=false 27 + 28 + # new session retains current path, possible values are: 29 + # - true 30 + # - false (default) 31 + # - disabled (do not modify new-session bindings) 32 + tmux_conf_new_session_retain_current_path=false 33 + 34 + 35 + # -- windows & pane creation --------------------------------------------------- 36 + 37 + # new window retains current path, possible values are: 38 + # - true 39 + # - false (default) 40 + # - disabled (do not modify new-window bindings) 41 + tmux_conf_new_window_retain_current_path=false 42 + 43 + # new window tries to reconnect ssh sessions, possible values are: 44 + # - true 45 + # - false (default) 46 + # - disabled (do not modify new-window bindings) 47 + tmux_conf_new_window_reconnect_ssh=false 48 + 49 + # new pane retains current path, possible values are: 50 + # - true (default) 51 + # - false 52 + # - disabled (do not modify split-window bindings) 53 + tmux_conf_new_pane_retain_current_path=true 54 + 55 + # new pane tries to reconnect ssh sessions, possible values are: 56 + # - true 57 + # - false (default) 58 + # - disabled (do not modify split-window bindings) 59 + tmux_conf_new_pane_reconnect_ssh=false 60 + 61 + 62 + # -- display ------------------------------------------------------------------- 63 + 64 + # RGB 24-bit colour support, possible values are: 65 + # - true 66 + # - false 67 + # - auto (default) 68 + # 69 + # automatic detection relies on the COLORTERM environment variable being defined 70 + # to 'truecolor' or '24bit' or '$ tput colors' answering '16777216' 71 + # see https://github.com/termstandard/colors 72 + tmux_conf_24b_colour=auto 73 + 74 + 75 + # -- theming ------------------------------------------------------------------- 76 + 77 + # enable or disable theming: 78 + # - enabled (default) 79 + # - disabled 80 + # when disabled, all tmux_conf_theme_xxx variables are ignored except: 81 + # - tmux_conf_theme_pairing 82 + # - tmux_conf_theme_prefix 83 + # - tmux_conf_theme_mouse 84 + # - tmux_conf_theme_root 85 + # - tmux_conf_theme_synchronized 86 + tmux_conf_theme=enabled 87 + 88 + # default theme 89 + tmux_conf_theme_colour_1="#080808" # dark gray 90 + tmux_conf_theme_colour_2="#303030" # gray 91 + tmux_conf_theme_colour_3="#8a8a8a" # light gray 92 + tmux_conf_theme_colour_4="#00afff" # light blue 93 + tmux_conf_theme_colour_5="#ffff00" # yellow 94 + tmux_conf_theme_colour_6="#080808" # dark gray 95 + tmux_conf_theme_colour_7="#e4e4e4" # white 96 + tmux_conf_theme_colour_8="#080808" # dark gray 97 + tmux_conf_theme_colour_9="#ffff00" # yellow 98 + tmux_conf_theme_colour_10="#ff00af" # pink 99 + tmux_conf_theme_colour_11="#5fff00" # green 100 + tmux_conf_theme_colour_12="#8a8a8a" # light gray 101 + tmux_conf_theme_colour_13="#e4e4e4" # white 102 + tmux_conf_theme_colour_14="#080808" # dark gray 103 + tmux_conf_theme_colour_15="#080808" # dark gray 104 + tmux_conf_theme_colour_16="#d70000" # red 105 + tmux_conf_theme_colour_17="#e4e4e4" # white 106 + 107 + # default theme (ansi) 108 + #tmux_conf_theme_colour_1="colour0" 109 + #tmux_conf_theme_colour_2="colour8" 110 + #tmux_conf_theme_colour_3="colour8" 111 + #tmux_conf_theme_colour_4="colour14" 112 + #tmux_conf_theme_colour_5="colour11" 113 + #tmux_conf_theme_colour_6="colour0" 114 + #tmux_conf_theme_colour_7="colour15" 115 + #tmux_conf_theme_colour_8="colour0" 116 + #tmux_conf_theme_colour_9="colour11" 117 + #tmux_conf_theme_colour_10="colour13" 118 + #tmux_conf_theme_colour_11="colour10" 119 + #tmux_conf_theme_colour_12="colour8" 120 + #tmux_conf_theme_colour_13="colour15" 121 + #tmux_conf_theme_colour_14="colour0" 122 + #tmux_conf_theme_colour_15="colour0" 123 + #tmux_conf_theme_colour_16="colour1" 124 + #tmux_conf_theme_colour_17="colour15" 125 + 126 + # window style 127 + tmux_conf_theme_window_fg="default" 128 + tmux_conf_theme_window_bg="default" 129 + 130 + # highlight focused pane, possible values are: 131 + # - true 132 + # - false (default) 133 + tmux_conf_theme_highlight_focused_pane=false 134 + 135 + # focused pane colours: 136 + tmux_conf_theme_focused_pane_bg="$tmux_conf_theme_colour_2" 137 + 138 + # pane border style, possible values are: 139 + # - thin (default) 140 + # - fat 141 + tmux_conf_theme_pane_border_style=thin 142 + 143 + # pane borders colours: 144 + tmux_conf_theme_pane_border="$tmux_conf_theme_colour_2" 145 + tmux_conf_theme_pane_active_border="$tmux_conf_theme_colour_4" 146 + %if #{>=:#{version},3.2} 147 + 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}}" 148 + %endif 149 + 150 + # pane indicator colours (when you hit <prefix> + q) 151 + tmux_conf_theme_pane_indicator="$tmux_conf_theme_colour_4" 152 + tmux_conf_theme_pane_active_indicator="$tmux_conf_theme_colour_4" 153 + 154 + # status line style 155 + tmux_conf_theme_message_fg="$tmux_conf_theme_colour_1" 156 + tmux_conf_theme_message_bg="$tmux_conf_theme_colour_5" 157 + tmux_conf_theme_message_attr="bold" 158 + 159 + # status line command style (<prefix> : Escape) 160 + tmux_conf_theme_message_command_fg="$tmux_conf_theme_colour_5" 161 + tmux_conf_theme_message_command_bg="$tmux_conf_theme_colour_1" 162 + tmux_conf_theme_message_command_attr="bold" 163 + 164 + # window modes style 165 + tmux_conf_theme_mode_fg="$tmux_conf_theme_colour_1" 166 + tmux_conf_theme_mode_bg="$tmux_conf_theme_colour_5" 167 + tmux_conf_theme_mode_attr="bold" 168 + 169 + # status line style 170 + tmux_conf_theme_status_fg="$tmux_conf_theme_colour_3" 171 + tmux_conf_theme_status_bg="$tmux_conf_theme_colour_1" 172 + tmux_conf_theme_status_attr="none" 173 + 174 + # terminal title 175 + # - built-in variables are: 176 + # - #{circled_window_index} 177 + # - #{circled_session_name} 178 + # - #{hostname} 179 + # - #{hostname_ssh} 180 + # - #{hostname_full} 181 + # - #{hostname_full_ssh} 182 + # - #{username} 183 + # - #{username_ssh} 184 + tmux_conf_theme_terminal_title="#h ❐ #S ● #I #W" 185 + 186 + # window status style 187 + # - built-in variables are: 188 + # - #{circled_window_index} 189 + # - #{circled_session_name} 190 + # - #{hostname} 191 + # - #{hostname_ssh} 192 + # - #{hostname_full} 193 + # - #{hostname_full_ssh} 194 + # - #{username} 195 + # - #{username_ssh} 196 + tmux_conf_theme_window_status_fg="$tmux_conf_theme_colour_3" 197 + tmux_conf_theme_window_status_bg="$tmux_conf_theme_colour_1" 198 + tmux_conf_theme_window_status_attr="none" 199 + tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}" 200 + #tmux_conf_theme_window_status_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}" 201 + #tmux_conf_theme_window_status_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}" 202 + 203 + # window current status style 204 + # - built-in variables are: 205 + # - #{circled_window_index} 206 + # - #{circled_session_name} 207 + # - #{hostname} 208 + # - #{hostname_ssh} 209 + # - #{hostname_full} 210 + # - #{hostname_full_ssh} 211 + # - #{username} 212 + # - #{username_ssh} 213 + tmux_conf_theme_window_status_current_fg="$tmux_conf_theme_colour_1" 214 + tmux_conf_theme_window_status_current_bg="$tmux_conf_theme_colour_4" 215 + tmux_conf_theme_window_status_current_attr="bold" 216 + tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}" 217 + #tmux_conf_theme_window_status_current_format="#{circled_window_index} #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,!,}#{?window_zoomed_flag,Z,}" 218 + #tmux_conf_theme_window_status_current_format="#I #W#{?#{||:#{window_bell_flag},#{window_zoomed_flag}}, ,}#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}" 219 + 220 + # window activity status style 221 + tmux_conf_theme_window_status_activity_fg="default" 222 + tmux_conf_theme_window_status_activity_bg="default" 223 + tmux_conf_theme_window_status_activity_attr="underscore" 224 + 225 + # window bell status style 226 + tmux_conf_theme_window_status_bell_fg="$tmux_conf_theme_colour_5" 227 + tmux_conf_theme_window_status_bell_bg="default" 228 + tmux_conf_theme_window_status_bell_attr="blink,bold" 229 + 230 + # window last status style 231 + tmux_conf_theme_window_status_last_fg="$tmux_conf_theme_colour_4" 232 + tmux_conf_theme_window_status_last_bg="$tmux_conf_theme_colour_2" 233 + tmux_conf_theme_window_status_last_attr="none" 234 + 235 + # status left/right sections separators 236 + tmux_conf_theme_left_separator_main="" 237 + tmux_conf_theme_left_separator_sub="|" 238 + tmux_conf_theme_right_separator_main="" 239 + tmux_conf_theme_right_separator_sub="|" 240 + #tmux_conf_theme_left_separator_main='\uE0B0' # /!\ you don't need to install Powerline 241 + #tmux_conf_theme_left_separator_sub='\uE0B1' # you only need fonts patched with 242 + #tmux_conf_theme_right_separator_main='\uE0B2' # Powerline symbols or the standalone 243 + #tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see README.md 244 + 245 + # status left/right content: 246 + # - separate main sections with "|" 247 + # - separate subsections with "," 248 + # - built-in variables are: 249 + # - #{battery_bar} 250 + # - #{battery_hbar} 251 + # - #{battery_percentage} 252 + # - #{battery_status} 253 + # - #{battery_vbar} 254 + # - #{circled_session_name} 255 + # - #{hostname_ssh} 256 + # - #{hostname} 257 + # - #{hostname_full} 258 + # - #{hostname_full_ssh} 259 + # - #{loadavg} 260 + # - #{mouse} 261 + # - #{pairing} 262 + # - #{prefix} 263 + # - #{root} 264 + # - #{synchronized} 265 + # - #{uptime_y} 266 + # - #{uptime_d} (modulo 365 when #{uptime_y} is used) 267 + # - #{uptime_h} 268 + # - #{uptime_m} 269 + # - #{uptime_s} 270 + # - #{username} 271 + # - #{username_ssh} 272 + 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,} " 273 + #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} " 274 + 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} " 275 + 276 + # status left style 277 + tmux_conf_theme_status_left_fg="$tmux_conf_theme_colour_6,$tmux_conf_theme_colour_7,$tmux_conf_theme_colour_8" 278 + tmux_conf_theme_status_left_bg="$tmux_conf_theme_colour_9,$tmux_conf_theme_colour_10,$tmux_conf_theme_colour_11" 279 + tmux_conf_theme_status_left_attr="bold,none,none" 280 + 281 + # status right style 282 + tmux_conf_theme_status_right_fg="$tmux_conf_theme_colour_12,$tmux_conf_theme_colour_13,$tmux_conf_theme_colour_14" 283 + tmux_conf_theme_status_right_bg="$tmux_conf_theme_colour_15,$tmux_conf_theme_colour_16,$tmux_conf_theme_colour_17" 284 + tmux_conf_theme_status_right_attr="none,none,bold" 285 + 286 + # pairing indicator 287 + tmux_conf_theme_pairing="⚇" # U+2687 288 + tmux_conf_theme_pairing_fg="none" 289 + tmux_conf_theme_pairing_bg="none" 290 + tmux_conf_theme_pairing_attr="none" 291 + 292 + # prefix indicator 293 + tmux_conf_theme_prefix="⌨" # U+2328 294 + tmux_conf_theme_prefix_fg="none" 295 + tmux_conf_theme_prefix_bg="none" 296 + tmux_conf_theme_prefix_attr="none" 297 + 298 + # mouse indicator 299 + tmux_conf_theme_mouse="↗" # U+2197 300 + tmux_conf_theme_mouse_fg="none" 301 + tmux_conf_theme_mouse_bg="none" 302 + tmux_conf_theme_mouse_attr="none" 303 + 304 + # root indicator 305 + tmux_conf_theme_root="!" 306 + tmux_conf_theme_root_fg="none" 307 + tmux_conf_theme_root_bg="none" 308 + tmux_conf_theme_root_attr="bold,blink" 309 + 310 + # synchronized indicator 311 + tmux_conf_theme_synchronized="⚏" # U+268F 312 + tmux_conf_theme_synchronized_fg="none" 313 + tmux_conf_theme_synchronized_bg="none" 314 + tmux_conf_theme_synchronized_attr="none" 315 + 316 + # battery bar symbols 317 + tmux_conf_battery_bar_symbol_full="◼" 318 + tmux_conf_battery_bar_symbol_empty="◻" 319 + #tmux_conf_battery_bar_symbol_full="♥" 320 + #tmux_conf_battery_bar_symbol_empty="·" 321 + 322 + # battery bar length (in number of symbols), possible values are: 323 + # - auto 324 + # - a number, e.g. 5 325 + tmux_conf_battery_bar_length="auto" 326 + 327 + # battery bar palette, possible values are: 328 + # - gradient (default) 329 + # - heat 330 + # - "colour_full_fg,colour_empty_fg,colour_bg" 331 + # - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n) 332 + tmux_conf_battery_bar_palette="gradient" 333 + #tmux_conf_battery_bar_palette="#d70000,#e4e4e4,#000000" # red, white, black 334 + #tmux_conf_battery_bar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)" 335 + 336 + # battery hbar palette, possible values are: 337 + # - gradient (default) 338 + # - heat 339 + # - "colour_low,colour_half,colour_full" 340 + # - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n) 341 + tmux_conf_battery_hbar_palette="gradient" 342 + #tmux_conf_battery_hbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green 343 + #tmux_conf_battery_hbar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)" 344 + 345 + # battery vbar palette, possible values are: 346 + # - gradient (default) 347 + # - heat 348 + # - "colour_low,colour_half,colour_full" 349 + # - gradient(colour_fg_1,colour_fg_2,...,colour_fg_n) 350 + tmux_conf_battery_vbar_palette="gradient" 351 + #tmux_conf_battery_vbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green 352 + #tmux_conf_battery_vbar_palette="gradient(#00afff,#47a2ff,#7c91ff,#ac7afb,#d65be2,#e163df,#eb6cdd,#f475db,#ec9ff1,#eac3fe,#efe2ff,#ffffff)" 353 + 354 + # symbols used to indicate whether battery is charging or discharging 355 + tmux_conf_battery_status_charging="↑" # U+2191 356 + tmux_conf_battery_status_discharging="↓" # U+2193 357 + #tmux_conf_battery_status_charging="🔌" # U+1F50C 358 + #tmux_conf_battery_status_discharging="🔋" # U+1F50B 359 + 360 + # clock style (when you hit <prefix> + t) 361 + # you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right 362 + tmux_conf_theme_clock_colour="$tmux_conf_theme_colour_4" 363 + tmux_conf_theme_clock_style="24" 364 + 365 + 366 + # -- clipboard ----------------------------------------------------------------- 367 + 368 + # in copy mode, copying selection also copies to the OS clipboard 369 + # - true 370 + # - false (default) 371 + # - disabled 372 + # on Linux, this requires xsel, xclip or wl-copy 373 + tmux_conf_copy_to_os_clipboard=false 374 + 375 + 376 + # -- urlscan ------------------------------------------------------------------- 377 + 378 + # options passed to urlscan 379 + tmux_conf_urlscan_options="--compact --dedupe" 380 + 381 + 382 + # -- user customizations ------------------------------------------------------- 383 + 384 + # this is the place to override or undo settings 385 + 386 + # increase history size 387 + #set -g history-limit 10000 388 + 389 + # start with mouse mode enabled 390 + #set -g mouse on 391 + 392 + # force Vi mode 393 + # really you should export VISUAL or EDITOR environment variable, see manual 394 + #set -g status-keys vi 395 + #set -g mode-keys vi 396 + 397 + # replace C-b by C-a instead of using both prefixes 398 + # set -gu prefix2 399 + # unbind C-a 400 + # unbind C-b 401 + # set -g prefix C-a 402 + # bind C-a send-prefix 403 + 404 + # if you don't want Oh my tmux! to alter a binding or a setting, use #!important 405 + # bind c new-window -c '#{pane_current_path}' #!important 406 + 407 + # display a message after toggling mouse support 408 + bind m run "cut -c3- '#{TMUX_CONF}' | sh -s _toggle_mouse" \; display 'mouse #{?#{mouse},on,off}' 409 + 410 + # move status line to top 411 + #set -g status-position top 412 + 413 + 414 + # -- tpm ----------------------------------------------------------------------- 415 + 416 + # while I don't use tpm myself, many people requested official support so here 417 + # is a seamless integration that automatically installs plugins in parallel 418 + 419 + # whenever a plugin introduces a variable to be used in 'status-left' or 420 + # 'status-right', you can use it in 'tmux_conf_theme_status_left' and 421 + # 'tmux_conf_theme_status_right' variables. 422 + 423 + # by default, launching tmux will update tpm and all plugins 424 + # - true (default) 425 + # - false 426 + tmux_conf_update_plugins_on_launch=true 427 + 428 + # by default, reloading the configuration will update tpm and all plugins 429 + # - true (default) 430 + # - false 431 + tmux_conf_update_plugins_on_reload=true 432 + 433 + # by default, reloading the configuration will uninstall tpm and plugins when no 434 + # plugins are enabled 435 + # - true (default) 436 + # - false 437 + tmux_conf_uninstall_plugins_on_reload=true 438 + 439 + # /!\ the tpm bindings differ slightly from upstream: 440 + # - installing plugins: <prefix> + I 441 + # - uninstalling plugins: <prefix> + Alt + u 442 + # - updating plugins: <prefix> + u 443 + 444 + # /!\ do not add set -g @plugin 'tmux-plugins/tpm' 445 + # /!\ do not add run '~/.tmux/plugins/tpm/tpm' 446 + 447 + # to enable a plugin, use the 'set -g @plugin' syntax: 448 + # visit https://github.com/tmux-plugins for available plugins 449 + #set -g @plugin 'tmux-plugins/tmux-copycat' 450 + #set -g @plugin 'tmux-plugins/tmux-cpu' 451 + #set -g @plugin 'tmux-plugins/tmux-resurrect' 452 + #set -g @plugin 'tmux-plugins/tmux-continuum' 453 + #set -g @continuum-restore 'on' 454 + 455 + 456 + # -- custom variables ---------------------------------------------------------- 457 + 458 + # to define a custom #{foo} variable, define a POSIX shell function between the 459 + # '# EOF' and the '# "$@"' lines. Please note that the opening brace { character 460 + # must be on the same line as the function name otherwise the parse won't detect 461 + # it. 462 + # 463 + # then, use #{foo} in e.g. the 'tmux_conf_theme_status_left' or the 464 + # 'tmux_conf_theme_status_right' variables. 465 + 466 + # ------------------------------------------------------------------------------ 467 + 468 + # # /!\ do not remove the following line 469 + # EOF 470 + # 471 + # # /!\ do not "uncomment" the functions: the leading "# " characters are needed 472 + # 473 + # # usage: #{weather} 474 + # weather() { # see https://github.com/chubin/wttr.in#one-line-output 475 + # curl -f -s -m 2 'wttr.in?format=3' || printf '\n' # /!\ make sure curl is installed 476 + # sleep 900 # sleep for 15 minutes, throttle network requests whatever the value of status-interval 477 + # } 478 + # 479 + # # usage: #{online} 480 + # online() { 481 + # ping -c 1 1.1.1.1 >/dev/null 2>&1 && printf '✔' || printf '✘' 482 + # } 483 + # 484 + # # usage: #{wan_ip_v4} 485 + # wan_ip_v4() { 486 + # curl -f -s -m 2 -4 ifconfig.me 487 + # sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval 488 + # } 489 + # 490 + # # usage: #{wan_ip_v6} 491 + # wan_ip_v6() { 492 + # curl -f -s -m 2 -6 ifconfig.me 493 + # sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval 494 + # } 495 + # 496 + # # usage: #{github_stars}, #{github_stars tmux/tmux}, ... 497 + # github_stars() { 498 + # repository=${1##*https://github.com/} 499 + # repository=${repository%% *} 500 + # repository=${repository%%.git} 501 + # url="https://api.github.com/repos/${repository:-gpakosz/.tmux}" 502 + # curl -s "$url" | perl -MJSON::PP=decode_json -CO -0777 -E '$response = decode_json(readline *STDIN); say ($response->{stargazers_count})' 503 + # sleep 300 # sleep for 5 minutes, throttle network requests whatever the value of status-interval 504 + # } 505 + # 506 + # "$@" 507 + # # /!\ do not remove the previous line 508 + # # do not write below this line
+19
LICENSE
··· 1 + Copyright (c) 2025 Tsiry Sandratraina <tsiry.sndr@rocksky.app> 2 + 3 + Permission is hereby granted, free of charge, to any person obtaining a copy 4 + of this software and associated documentation files (the "Software"), to deal 5 + in the Software without restriction, including without limitation the rights 6 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 + copies of the Software, and to permit persons to whom the Software is 8 + furnished to do so, subject to the following conditions: 9 + 10 + The above copyright notice and this permission notice shall be included in all 11 + copies or substantial portions of the Software. 12 + 13 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 + SOFTWARE.