Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.24 KB | None | 0 0
  1. # cat << EOF > /dev/null
  2. # https://github.com/gpakosz/.tmux
  3. # (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
  4. # without any warranty.
  5. # Copyright 2012— Gregory Pakosz (@gpakosz).
  6. # /!\ do not edit this file
  7. # instead, override settings in ~/.tmux.conf.local, see README.md
  8.  
  9. set -g @plugin 'tmux-plugins/tmux-pain-control'
  10.  
  11. bind j resize-pane -D 10
  12. bind k resize-pane -U 10
  13. bind l resize-pane -L 10
  14. bind h resize-pane -R 10
  15. # -- general -------------------------------------------------------------------
  16. # split panes using | and -
  17. bind | split-window -h
  18. bind - split-window -v
  19. unbind '"'
  20. unbind %
  21.  
  22. set -g default-terminal "screen-256color" # colors!
  23. setw -g xterm-keys on
  24. set -s escape-time 10 # faster command sequences
  25. set -sg repeat-time 600 # increase repeat timeout
  26. set -s focus-events on
  27.  
  28. set -g prefix2 C-a # GNU-Screen compatible prefix
  29. bind C-a send-prefix -2
  30.  
  31. set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
  32. setw -q -g utf8 on
  33.  
  34. set -g history-limit 5000 # boost history
  35.  
  36. # edit configuration
  37. bind e new-window -n '~/.tmux.conf.local' "sh -c '\${EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'"
  38.  
  39. # reload configuration
  40. bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
  41.  
  42.  
  43. # -- display -------------------------------------------------------------------
  44.  
  45. set -g base-index 1 # start windows numbering at 1
  46. setw -g pane-base-index 1 # make pane numbering consistent with windows
  47.  
  48. setw -g automatic-rename on # rename window to reflect current program
  49. set -g renumber-windows on # renumber windows when a window is closed
  50.  
  51. set -g set-titles on # set terminal title
  52.  
  53. set -g display-panes-time 800 # slightly longer pane indicators display time
  54. set -g display-time 1000 # slightly longer status messages display time
  55.  
  56. set -g status-interval 10 # redraw status line every 10 seconds
  57.  
  58. # clear both screen and history
  59. bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history
  60.  
  61. # activity
  62. set -g monitor-activity on
  63. set -g visual-activity off
  64.  
  65.  
  66. # -- navigation ----------------------------------------------------------------
  67.  
  68. # create session
  69. bind C-c new-session
  70.  
  71. # find session
  72. bind C-f command-prompt -p find-session 'switch-client -t %%'
  73.  
  74. # split current window horizontally
  75. bind - split-window -v
  76. # split current window vertically
  77. bind _ split-window -h
  78.  
  79. # pane navigation
  80. bind -r h select-pane -L # move left
  81. bind -r j select-pane -D # move down
  82. bind -r k select-pane -U # move up
  83. bind -r l select-pane -R # move right
  84. bind > swap-pane -D # swap current pane with the next one
  85. bind < swap-pane -U # swap current pane with the previous one
  86.  
  87. # maximize current pane
  88. bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane "#{session_name}" #D'
  89.  
  90. # pane resizing
  91. bind -r H resize-pane -L 2
  92. bind -r J resize-pane -D 2
  93. bind -r K resize-pane -U 2
  94. bind -r L resize-pane -R 2
  95.  
  96. # window navigation
  97. unbind n
  98. unbind p
  99. bind -r C-h previous-window # select previous window
  100. bind -r C-l next-window # select next window
  101. bind Tab last-window # move to last active window
  102.  
  103. # toggle mouse
  104. bind m run "cut -c3- ~/.tmux.conf | sh -s _toggle_mouse"
  105.  
  106.  
  107. # -- urlview -------------------------------------------------------------------
  108.  
  109. bind U run "cut -c3- ~/.tmux.conf | sh -s _urlview #{pane_id}"
  110.  
  111.  
  112. # -- facebook pathpicker -------------------------------------------------------
  113.  
  114. bind F run "cut -c3- ~/.tmux.conf | sh -s _fpp #{pane_id}"
  115.  
  116.  
  117. # -- list choice (tmux < 2.4) --------------------------------------------------
  118.  
  119. # vi-choice is gone in tmux >= 2.4
  120. run -b 'tmux bind -t vi-choice h tree-collapse 2> /dev/null || true'
  121. run -b 'tmux bind -t vi-choice l tree-expand 2> /dev/null || true'
  122. run -b 'tmux bind -t vi-choice K start-of-list 2> /dev/null || true'
  123. run -b 'tmux bind -t vi-choice J end-of-list 2> /dev/null || true'
  124. run -b 'tmux bind -t vi-choice H tree-collapse-all 2> /dev/null || true'
  125. run -b 'tmux bind -t vi-choice L tree-expand-all 2> /dev/null || true'
  126. run -b 'tmux bind -t vi-choice Escape cancel 2> /dev/null || true'
  127.  
  128.  
  129. # -- edit mode (tmux < 2.4) ----------------------------------------------------
  130.  
  131. # vi-edit is gone in tmux >= 2.4
  132. run -b 'tmux bind -ct vi-edit H start-of-line 2> /dev/null || true'
  133. run -b 'tmux bind -ct vi-edit L end-of-line 2> /dev/null || true'
  134. run -b 'tmux bind -ct vi-edit q cancel 2> /dev/null || true'
  135. run -b 'tmux bind -ct vi-edit Escape cancel 2> /dev/null || true'
  136.  
  137.  
  138. # -- copy mode -----------------------------------------------------------------
  139.  
  140. bind Enter copy-mode # enter copy mode
  141.  
  142. run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true'
  143. run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
  144. run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
  145. run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true'
  146. run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true'
  147. run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
  148. run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true'
  149. run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true'
  150. run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true'
  151. run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true'
  152. run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true'
  153. run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'
  154.  
  155. # copy to Mac OSX clipboard
  156. if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
  157. # copy to X11 clipboard
  158. if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"'
  159. if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
  160. # copy to Windows clipboard
  161. if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | clip.exe"'
  162. if -b '[ -c /dev/clipboard ]' 'bind y run -b "tmux save-buffer - > /dev/clipboard"'
  163.  
  164.  
  165. # -- buffers -------------------------------------------------------------------
  166.  
  167. bind b list-buffers # list paste buffers
  168. bind p paste-buffer # paste from the top paste buffer
  169. bind P choose-buffer # choose which buffer to paste from
  170.  
  171.  
  172. # -- user defined overrides ----------------------------------------------------
  173.  
  174. if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
  175.  
  176.  
  177. # -- 8< ------------------------------------------------------------------------
  178.  
  179. run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
  180.  
  181.  
  182. # EOF
  183. #
  184. # # exit the script if any statement returns a non-true return value
  185. # set -e
  186. #
  187. # export LC_NUMERIC=C
  188. #
  189. # __newline='
  190. # '
  191. #
  192. # _is_enabled() {
  193. # ( ([ x"$1" = x"enabled" ] || [ x"$1" = x"true" ] || [ x"$1" = x"yes" ] || [ x"$1" = x"1" ]) && return 0 ) || return 1
  194. # }
  195. #
  196. # _circled_digit() {
  197. # circled_digits='⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳'
  198. # if [ "$1" -le 20 ] 2>/dev/null; then
  199. # i=$(( $1 + 1 ))
  200. # eval set -- "$circled_digits"
  201. # eval echo "\${$i}"
  202. # else
  203. # echo "$1"
  204. # fi
  205. # }
  206. #
  207. # _maximize_pane() {
  208. # current_session=${1:-$(tmux display -p '#{session_name}')}
  209. # current_pane=${2:-$(tmux display -p '#{pane_id}')}
  210. #
  211. # dead_panes=$(tmux list-panes -s -t "$current_session" -F '#{pane_dead} #{pane_id} #{pane_start_command}' | grep -o '^1 %.\+maximized.\+$' || true)
  212. # restore=$(echo "$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" -e "s/^1 (%[0-9]+) .+maximized.+'$current_pane'$/tmux swap-pane -s \1 -t $current_pane \; kill-pane -t \1/p" )
  213. #
  214. # if [ -z "$restore" ]; then
  215. # [ "$(tmux list-panes -t "$current_session:" | wc -l | sed 's/^ *//g')" -eq 1 ] && tmux display "Can't maximize with only one pane" && return
  216. # window=$(tmux new-window -t "$current_session:" -P "exec maximized... 2> /dev/null & tmux setw -t \"$current_session:\" remain-on-exit on; printf \"Pane has been maximized, press <prefix>+ to restore. %s\" '$current_pane'")
  217. # window=${window%.*}
  218. #
  219. # retry=10
  220. # while [ x"$(tmux list-panes -t "$window" -F '#{session_name}:#{window_index} #{pane_dead}' 2>/dev/null)" != x"$window 1" ] && [ "$retry" -ne 0 ]; do
  221. # sleep 0.05
  222. # retry=$((retry - 1))
  223. # done
  224. # if [ "$retry" -eq 0 ]; then
  225. # tmux display 'Unable to maximize pane'
  226. # fi
  227. #
  228. # new_pane=$(tmux display -t "$window" -p '#{pane_id}')
  229. # tmux setw -t "$window" remain-on-exit off \; swap-pane -s "$current_pane" -t "$new_pane"
  230. # else
  231. # $restore || tmux kill-pane
  232. # fi
  233. # }
  234. #
  235. # _toggle_mouse() {
  236. # old=$(tmux show -gv mouse)
  237. # new=""
  238. #
  239. # if [ "$old" = "on" ]; then
  240. # new="off"
  241. # else
  242. # new="on"
  243. # fi
  244. #
  245. # tmux set -g mouse $new \;\
  246. # display "mouse: $new"
  247. # }
  248. #
  249. # _battery() {
  250. # charge=0
  251. # uname_s=$(uname -s)
  252. # case "$uname_s" in
  253. # *Darwin*)
  254. # while IFS= read -r line; do
  255. # if [ x"$discharging" != x"true" ]; then
  256. # discharging=$(printf '%s' "$line" | grep -qi "discharging" && echo "true" || echo "false")
  257. # fi
  258. # percentage=$(printf '%s' "$line" | grep -E -o '[0-9]+%')
  259. # charge=$(awk -v charge="$charge" -v percentage="${percentage%%%}" 'BEGIN { print charge + percentage / 100 }')
  260. # count=$((count + 1))
  261. # done << EOF
  262. # $(pmset -g batt | grep 'InternalBattery')
  263. # EOF
  264. # ;;
  265. # *Linux*)
  266. # while IFS= read -r batpath; do
  267. # grep -i -q device "$batpath/scope" 2> /dev/null && continue
  268. #
  269. # if [ x"$discharging" != x"true" ]; then
  270. # discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false")
  271. # fi
  272. # bat_capacity="$batpath/capacity"
  273. # if [ -r "$bat_capacity" ]; then
  274. # charge=$(awk -v charge="$charge" -v capacity="$(cat "$bat_capacity")" 'BEGIN { print charge + capacity / 100 }')
  275. # else
  276. # bat_energy_full="$batpath/energy_full"
  277. # bat_energy_now="$batpath/energy_now"
  278. # if [ -r "$bat_energy_full" ] && [ -r "$bat_energy_now" ]; then
  279. # charge=$(awk -v charge="$charge" -v energy_now="$(cat "$bat_energy_now")" -v energy_full="$(cat "$bat_energy_full")" 'BEGIN { print charge + energy_now / energy_full }')
  280. # fi
  281. # fi
  282. # count=$((count + 1))
  283. # done << EOF
  284. # $(find /sys/class/power_supply -maxdepth 1 -iname '*bat*')
  285. # EOF
  286. # ;;
  287. # *CYGWIN*|*MSYS*|*MINGW*)
  288. # while IFS= read -r line; do
  289. # [ -z "$line" ] && continue
  290. # if [ x"$discharging" != x"true" ]; then
  291. # discharging=$(printf '%s' "$line" | awk '{ s = ($1 == 1) ? "true" : "false"; print s }')
  292. # fi
  293. # charge=$(printf '%s' "$line" | awk -v charge="$charge" '{ print charge + $2 / 100 }')
  294. # count=$((count + 1))
  295. # done << EOF
  296. # $(wmic path Win32_Battery get BatteryStatus, EstimatedChargeRemaining | tr -d '\r' | tail -n +2)
  297. # EOF
  298. # ;;
  299. # *OpenBSD*)
  300. # for batid in 0 1 2; do
  301. # sysctl -n "hw.sensors.acpibat$batid.raw0" 2>&1 | grep -q 'not found' && continue
  302. # if [ x"$discharging" != x"true" ]; then
  303. # discharging=$(sysctl -n "hw.sensors.acpibat$batid.raw0" | grep -q 1 && echo "true" || echo "false")
  304. # fi
  305. # if sysctl -n "hw.sensors.acpibat$batid" | grep -q amphour; then
  306. # charge=$(awk -v charge="$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 }')
  307. # else
  308. # charge=$(awk -v charge="$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 }')
  309. # fi
  310. # count=$((count + 1))
  311. # done
  312. # ;;
  313. # esac
  314. # charge=$(awk -v charge="$charge" -v count="$count" 'BEGIN { print charge / count }')
  315. # if [ "$charge" -eq 0 ]; then
  316. # tmux set -ug '@battery_status' \;\
  317. # set -ug '@battery_bar' \;\
  318. # set -ug '@battery_hbar' \;\
  319. # set -ug '@battery_vbar' \;\
  320. # set -ug '@battery_percentage'
  321. # return
  322. # fi
  323. #
  324. # variables=$(tmux show -gqv '@battery_bar_symbol_full' \;\
  325. # show -gqv '@battery_bar_symbol_empty' \;\
  326. # show -gqv '@battery_bar_length' \;\
  327. # show -gqv '@battery_bar_palette' \;\
  328. # show -gqv '@battery_hbar_palette' \;\
  329. # show -gqv '@battery_vbar_palette' \;\
  330. # show -gqv '@battery_status_charging' \;\
  331. # show -gqv '@battery_status_discharging')
  332. # # shellcheck disable=SC2086
  333. # { set -f; IFS="$__newline"; set -- $variables; unset IFS; set +f; }
  334. #
  335. # battery_bar_symbol_full=$1
  336. # battery_bar_symbol_empty=$2
  337. # battery_bar_length=$3
  338. # battery_bar_palette=$4
  339. # battery_hbar_palette=$5
  340. # battery_vbar_palette=$6
  341. # battery_status_charging=$7
  342. # battery_status_discharging=$8
  343. #
  344. # if [ x"$battery_bar_length" = x"auto" ]; then
  345. # columns=$(tmux -q display -p '#{client_width}' 2> /dev/null || echo 80)
  346. # if [ "$columns" -ge 80 ]; then
  347. # battery_bar_length=10
  348. # else
  349. # battery_bar_length=5
  350. # fi
  351. # fi
  352. #
  353. # if [ x"$discharging" = x"true" ]; then
  354. # battery_status="$battery_status_discharging"
  355. # else
  356. # battery_status="$battery_status_charging"
  357. # fi
  358. #
  359. # if echo "$battery_bar_palette" | grep -q -E '^heat|gradient(,[#a-z0-9]{7,9})?$'; then
  360. # # shellcheck disable=SC2086
  361. # { set -f; IFS=,; set -- $battery_bar_palette; unset IFS; set +f; }
  362. # palette_style=$1
  363. # battery_bg=${2:-none}
  364. # [ x"$palette_style" = x"gradient" ] && \
  365. # palette="196 202 208 214 220 226 190 154 118 82 46"
  366. # [ x"$palette_style" = x"heat" ] && \
  367. # palette="243 245 247 144 143 142 184 214 208 202 196"
  368. #
  369. # palette=$(echo "$palette" | awk -v n="$battery_bar_length" '{ for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }')
  370. # eval set -- "$palette"
  371. #
  372. # full=$(awk "BEGIN { printf \"%.0f\", ($charge) * $battery_bar_length }")
  373. # battery_bar="#[bg=$battery_bg]"
  374. # # shellcheck disable=SC2046
  375. # [ "$full" -gt 0 ] && \
  376. # battery_bar="$battery_bar$(printf "#[fg=colour%s]$battery_bar_symbol_full" $(echo "$palette" | cut -d' ' -f1-"$full"))"
  377. # # shellcheck disable=SC2046
  378. # empty=$((battery_bar_length - full))
  379. # # shellcheck disable=SC2046
  380. # [ "$empty" -gt 0 ] && \
  381. # battery_bar="$battery_bar$(printf "#[fg=colour%s]$battery_bar_symbol_empty" $(echo "$palette" | cut -d' ' -f$((full + 1))-$((full + empty))))"
  382. # eval battery_bar="$battery_bar#[fg=colour\${$((full == 0 ? 1 : full))}]"
  383. # elif echo "$battery_bar_palette" | grep -q -E '^(([#a-z0-9]{7,9}|none),?){3}$'; then
  384. # # shellcheck disable=SC2086
  385. # { set -f; IFS=,; set -- $battery_bar_palette; unset IFS; set +f; }
  386. # battery_full_fg=$1
  387. # battery_empty_fg=$2
  388. # battery_bg=$3
  389. #
  390. # full=$(awk "BEGIN { printf \"%.0f\", ($charge) * $battery_bar_length }")
  391. # [ x"$battery_bg" != x"none" ] && \
  392. # battery_bar="#[bg=$battery_bg]"
  393. # #shellcheck disable=SC2046
  394. # [ "$full" -gt 0 ] && \
  395. # battery_bar="$battery_bar#[fg=$battery_full_fg]$(printf "%0.s$battery_bar_symbol_full" $(seq 1 "$full"))"
  396. # empty=$((battery_bar_length - full))
  397. # #shellcheck disable=SC2046
  398. # [ "$empty" -gt 0 ] && \
  399. # battery_bar="$battery_bar#[fg=$battery_empty_fg]$(printf "%0.s$battery_bar_symbol_empty" $(seq 1 "$empty"))" && \
  400. # battery_bar="$battery_bar#[fg=$battery_empty_fg]"
  401. # fi
  402. #
  403. # if echo "$battery_hbar_palette" | grep -q -E '^heat|gradient(,[#a-z0-9]{7,9})?$'; then
  404. # # shellcheck disable=SC2086
  405. # { set -f; IFS=,; set -- $battery_hbar_palette; unset IFS; set +f; }
  406. # palette_style=$1
  407. # [ x"$palette_style" = x"gradient" ] && \
  408. # palette="196 202 208 214 220 226 190 154 118 82 46"
  409. # [ x"$palette_style" = x"heat" ] && \
  410. # palette="233 234 235 237 239 241 243 245 247 144 143 142 184 214 208 202 196"
  411. #
  412. # palette=$(echo "$palette" | awk -v n="$battery_bar_length" '{ for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }')
  413. # eval set -- "$palette"
  414. #
  415. # full=$(awk "BEGIN { printf \"%.0f\", ($charge) * $battery_bar_length }")
  416. # eval battery_hbar_fg="colour\${$((full == 0 ? 1 : full))}"
  417. # elif echo "$battery_hbar_palette" | grep -q -E '^([#a-z0-9]{7,9},?){3}$'; then
  418. # # shellcheck disable=SC2086
  419. # { set -f; IFS=,; set -- $battery_hbar_palette; unset IFS; set +f; }
  420. #
  421. # # shellcheck disable=SC2046
  422. # eval $(awk "BEGIN { printf \"battery_hbar_fg=$%d\", (($charge) - 0.001) * $# + 1 }")
  423. # fi
  424. #
  425. # eval set -- "▏ ▎ ▍ ▌ ▋ ▊ ▉ █"
  426. # # shellcheck disable=SC2046
  427. # eval $(awk "BEGIN { printf \"battery_hbar_symbol=$%d\", ($charge) * ($# - 1) + 1 }")
  428. # battery_hbar="#[fg=${battery_hbar_fg?}]${battery_hbar_symbol?}"
  429. #
  430. # if echo "$battery_vbar_palette" | grep -q -E '^heat|gradient(,[#a-z0-9]{7,9})?$'; then
  431. # # shellcheck disable=SC2086
  432. # { set -f; IFS=,; set -- $battery_vbar_palette; unset IFS; set +f; }
  433. # palette_style=$1
  434. # [ x"$palette_style" = x"gradient" ] && \
  435. # palette="196 202 208 214 220 226 190 154 118 82 46"
  436. # [ x"$palette_style" = x"heat" ] && \
  437. # palette="233 234 235 237 239 241 243 245 247 144 143 142 184 214 208 202 196"
  438. #
  439. # palette=$(echo "$palette" | awk -v n="$battery_bar_length" '{ for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }')
  440. # eval set -- "$palette"
  441. #
  442. # full=$(awk "BEGIN { printf \"%.0f\", ($charge) * $battery_bar_length }")
  443. # eval battery_vbar_fg="colour\${$((full == 0 ? 1 : full))}"
  444. # elif echo "$battery_vbar_palette" | grep -q -E '^([#a-z0-9]{7,9},?){3}$'; then
  445. # # shellcheck disable=SC2086
  446. # { set -f; IFS=,; set -- $battery_vbar_palette; unset IFS; set +f; }
  447. #
  448. # # shellcheck disable=SC2046
  449. # eval $(awk "BEGIN { printf \"battery_vbar_fg=$%d\", (($charge) - 0.001) * $# + 1 }")
  450. # fi
  451. #
  452. # eval set -- "▁ ▂ ▃ ▄ ▅ ▆ ▇ █"
  453. # # shellcheck disable=SC2046
  454. # eval $(awk "BEGIN { printf \"battery_vbar_symbol=$%d\", ($charge) * ($# - 1) + 1 }")
  455. # battery_vbar="#[fg=${battery_vbar_fg?}]${battery_vbar_symbol?}"
  456. #
  457. # battery_percentage="$(awk "BEGIN { printf \"%.0f%%\", ($charge) * 100 }")"
  458. #
  459. # tmux set -g '@battery_status' "$battery_status" \;\
  460. # set -g '@battery_bar' "$battery_bar" \;\
  461. # set -g '@battery_hbar' "$battery_hbar" \;\
  462. # set -g '@battery_vbar' "$battery_vbar" \;\
  463. # set -g '@battery_percentage' "$battery_percentage"
  464. # }
  465. #
  466. # _username() {
  467. # tty=${1:-$(tmux display -p '#{pane_tty}')}
  468. # ssh_only=$2
  469. # # shellcheck disable=SC2039
  470. # if [ x"$OSTYPE" = x"cygwin" ]; then
  471. # pid=$(ps -a | awk -v tty="${tty##/dev/}" '$5 == tty && /ssh/ && !/vagrant ssh/ && !/autossh/ && !/-W/ { print $1 }')
  472. # [ -n "$pid" ] && ssh_parameters=$(tr '\0' ' ' < "/proc/$pid/cmdline" | sed 's/^ssh //')
  473. # else
  474. # ssh_parameters=$(ps -t "$tty" -o command= | awk '/ssh/ && !/vagrant ssh/ && !/autossh/ && !/-W/ { $1=""; print $0; exit }')
  475. # fi
  476. # if [ -n "$ssh_parameters" ]; then
  477. # # shellcheck disable=SC2086
  478. # username=$(ssh -G $ssh_parameters 2>/dev/null | awk 'NR > 2 { exit } ; /^user / { print $2 }')
  479. # # shellcheck disable=SC2086
  480. # [ -z "$username" ] && username=$(ssh -T -o ControlPath=none -o ProxyCommand="sh -c 'echo %%username%% %r >&2'" $ssh_parameters 2>&1 | awk '/^%username% / { print $2; exit }')
  481. # else
  482. # if ! _is_enabled "$ssh_only"; then
  483. # # shellcheck disable=SC2039
  484. # if [ x"$OSTYPE" = x"cygwin" ]; then
  485. # username=$(whoami)
  486. # else
  487. # username=$(ps -t "$tty" -o user= -o pid= -o ppid= -o command= | awk '
  488. # !/ssh/ { user[$2] = $1; ppid[$3] = 1 }
  489. # END {
  490. # for (i in user)
  491. # if (!(i in ppid))
  492. # {
  493. # print user[i]
  494. # exit
  495. # }
  496. # }
  497. # ')
  498. # fi
  499. # fi
  500. # fi
  501. #
  502. # echo "$username"
  503. # }
  504. #
  505. # _hostname() {
  506. # tty=${1:-$(tmux display -p '#{pane_tty}')}
  507. # ssh_only=$2
  508. # # shellcheck disable=SC2039
  509. # if [ x"$OSTYPE" = x"cygwin" ]; then
  510. # pid=$(ps -a | awk -v tty="${tty##/dev/}" '$5 == tty && /ssh/ && !/vagrant ssh/ && !/autossh/ && !/-W/ { print $1 }')
  511. # [ -n "$pid" ] && ssh_parameters=$(tr '\0' ' ' < "/proc/$pid/cmdline" | sed 's/^ssh //')
  512. # else
  513. # ssh_parameters=$(ps -t "$tty" -o command= | awk '/ssh/ && !/vagrant ssh/ && !/autossh/ && !/-W/ { $1=""; print $0; exit }')
  514. # fi
  515. # if [ -n "$ssh_parameters" ]; then
  516. # # shellcheck disable=SC2086
  517. # hostname=$(ssh -G $ssh_parameters 2>/dev/null | awk 'NR > 2 { exit } ; /^hostname / { print $2 }')
  518. # # shellcheck disable=SC2086
  519. # [ -z "$hostname" ] && hostname=$(ssh -T -o ControlPath=none -o ProxyCommand="sh -c 'echo %%hostname%% %h >&2'" $ssh_parameters 2>&1 | awk '/^%hostname% / { print $2; exit }')
  520. # #shellcheck disable=SC1004
  521. # hostname=$(echo "$hostname" | awk '\
  522. # { \
  523. # if ($1~/^[0-9.:]+$/) \
  524. # print $1; \
  525. # else \
  526. # split($1, a, ".") ; print a[1] \
  527. # }')
  528. # else
  529. # if ! _is_enabled "$ssh_only"; then
  530. # hostname=$(command hostname -s)
  531. # fi
  532. # fi
  533. #
  534. # echo "$hostname"
  535. # }
  536. #
  537. # _root() {
  538. # tty=${1:-$(tmux display -p '#{pane_tty}')}
  539. # username=$(_username "$tty" false)
  540. #
  541. # if [ x"$username" = x"root" ]; then
  542. # tmux show -gqv '@root'
  543. # else
  544. # echo ""
  545. # fi
  546. # }
  547. #
  548. # _uptime() {
  549. # case $(uname -s) in
  550. # *Darwin*)
  551. # boot=$(sysctl -q -n kern.boottime | awk -F'[ ,:]+' '{ print $4 }')
  552. # now=$(date +%s)
  553. # ;;
  554. # *Linux*|*CYGWIN*|*MSYS*|*MINGW*)
  555. # now=$(cut -d' ' -f1 < /proc/uptime)
  556. # ;;
  557. # *OpenBSD*)
  558. # boot=$(sysctl -n kern.boottime)
  559. # now=$(date +%s)
  560. # esac
  561. # # shellcheck disable=SC1004
  562. # awk -v boot="$boot" -v now="$now" '
  563. # BEGIN {
  564. # uptime = now - boot
  565. # d = int(uptime / 86400)
  566. # h = int(uptime / 3600) % 24
  567. # m = int(uptime / 60) % 60
  568. # s = int(uptime) % 60
  569. #
  570. # system("tmux set -g @uptime_d " d + 0 " \\; " \
  571. # "set -g @uptime_h " h + 0 " \\; " \
  572. # "set -g @uptime_m " m + 0 " \\; " \
  573. # "set -g @uptime_s " s + 0)
  574. # }'
  575. # }
  576. #
  577. # _loadavg() {
  578. # case $(uname -s) in
  579. # *Darwin*)
  580. # tmux set -g @loadavg "$(sysctl -q -n vm.loadavg | cut -d' ' -f2)"
  581. # ;;
  582. # *Linux*)
  583. # tmux set -g @loadavg "$(cut -d' ' -f1 < /proc/loadavg)"
  584. # ;;
  585. # *OpenBSD*)
  586. # tmux set -g @loadavg "$(sysctl -q -n vm.loadavg | cut -d' ' -f1)"
  587. # ;;
  588. # esac
  589. # }
  590. #
  591. # _split_window() {
  592. # tty=${1:-$(tmux display -p '#{pane_tty}')}
  593. # shift
  594. # # shellcheck disable=SC2039
  595. # if [ x"$OSTYPE" = x"cygwin" ]; then
  596. # pid=$(ps -a | sort -d | awk -v tty="${tty##/dev/}" '$5 == tty && /ssh/ && !/-W/ { print $1; exit 0 }')
  597. # [ -n "$pid" ] && ssh=$(tr '\0' ' ' < "/proc/$pid/cmdline")
  598. # else
  599. # ssh=$(ps -t "$tty" -o command= | sort -d | awk '/ssh/ && !/-W/ { print $0; exit 0 }')
  600. # fi
  601. # if [ -n "$ssh" ]; then
  602. # # shellcheck disable=SC2046
  603. # tmux split-window "$@" $(echo "$ssh" | sed -e "s/;/\\\\;/g")
  604. # else
  605. # tmux split-window "$@"
  606. # fi
  607. # }
  608. #
  609. # _apply_overrides() {
  610. # tmux_conf_theme_24b_colour=${tmux_conf_theme_24b_colour:-false}
  611. # if _is_enabled "$tmux_conf_theme_24b_colour"; then
  612. # case "$TERM" in
  613. # screen-*|tmux-*)
  614. # ;;
  615. # *)
  616. # tmux set-option -ga terminal-overrides ",*256col*:Tc"
  617. # ;;
  618. # esac
  619. # fi
  620. # }
  621. #
  622. # _apply_bindings() {
  623. # line=$(tmux list-keys | grep new-window | head -1)
  624. # prefix=${line%new-window*}
  625. # column=${#prefix}
  626. #
  627. # tmux_conf_new_window_retain_current_path=${tmux_conf_new_window_retain_current_path:-false}
  628. # while IFS= read -r line; do
  629. # [ -z "$line" ] && continue
  630. # left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
  631. # if _is_enabled "$tmux_conf_new_window_retain_current_path"; then
  632. # right=$(printf '%s' "$line" | cut -c"$column-" | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/new-window$/new-window -c "#{pane_current_path}"/g')
  633. # else
  634. # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/-c[ \t]+"#\{pane_current_path\}"$//g')
  635. # fi
  636. # eval "tmux $left $right" 2>/dev/null || true
  637. # done << EOF
  638. # $(tmux list-keys 2>/dev/null | grep -e 'new-window\(\s\+-c\s\+"#{pane_current_path}\|$\)')
  639. # EOF
  640. #
  641. # tmux_conf_new_pane_retain_current_path=${tmux_conf_new_pane_retain_current_path:-true}
  642. # while IFS= read -r line; do
  643. # [ -z "$line" ] && continue
  644. # left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
  645. # if _is_enabled "$tmux_conf_new_pane_retain_current_path"; then
  646. # right=$(printf '%s' "$line" | cut -c"$column-" | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/split-window([ \t]+-(h|v))?$/& -c "#{pane_current_path}"/g')
  647. # else
  648. # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/-c[ \t]+"#\{pane_current_path\}"$//g')
  649. # fi
  650. # eval "tmux $left $right" 2>/dev/null || true
  651. # done << EOF
  652. # $(tmux list-keys 2>/dev/null | grep -e 'split\(-\|_\)window')
  653. # EOF
  654. #
  655. # tmux_conf_new_pane_reconnect_ssh=${tmux_conf_new_pane_reconnect_ssh:-false}
  656. # while IFS= read -r line; do
  657. # [ -z "$line" ] && continue
  658. # left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
  659. # if _is_enabled "$tmux_conf_new_pane_reconnect_ssh"; then
  660. # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/"/\\"/g' -e 's/split-window([^;]+)/run-shell "cut -c3- ~\/\.tmux\.conf | sh -s _split_window #{pane_tty}\1"/g')
  661. # else
  662. # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/\\"/"/g' -e 's/run-shell "cut -c3- ~\/\.tmux\.conf \| sh -s _split_window #\{pane_tty\}([^;]+)"/split-window\1/g' -e 's/#\{.+\}/\"&\"/g')
  663. # fi
  664. # eval "tmux $left $right" 2>/dev/null || true
  665. # done << EOF
  666. # $(tmux list-keys 2>/dev/null | grep -e 'split\(-\|_\)window')
  667. # EOF
  668. #
  669. # tmux_conf_new_session_prompt=${tmux_conf_new_session_prompt:-false}
  670. # while IFS= read -r line; do
  671. # [ -z "$line" ] && continue
  672. # left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
  673. # if _is_enabled "$tmux_conf_new_session_prompt"; then
  674. # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e 's/new-session$/command-prompt -p new-session \"new-session -s '"'"'%%'"'"'\"/g')
  675. # else
  676. # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'| sed -E -e 's/command-prompt -p new-session[^;]+/new-session/g')
  677. # fi
  678. # eval "tmux $left $right" 2>/dev/null || true
  679. # done << EOF
  680. # $(tmux list-keys 2>/dev/null | grep -e 'new-session')
  681. # EOF
  682. #
  683. # tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false}
  684. # command -v pbcopy > /dev/null 2>&1 && command='pbcopy'
  685. # command -v reattach-to-user-namespace > /dev/null 2>&1 && command='reattach-to-user-namespace pbcopy'
  686. # command -v xsel > /dev/null 2>&1 && command='xsel -i -b'
  687. # ! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1 && command='xclip -i -selection clipboard > \/dev\/null 2>\&1'
  688. # command -v clip.exe > /dev/null 2>&1 && command='clip\.exe'
  689. # [ -c /dev/clipboard ] && command='cat > \/dev\/clipboard'
  690. #
  691. # if [ -n "$command" ]; then
  692. # # shellcheck disable=SC2086
  693. # for table in "" "-t emacs-copy" "-t vi-copy"; do
  694. # line=$(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe' | head -1)
  695. # prefix=${line%copy-*}
  696. # column=${#prefix}
  697. # [ -z "$line" ] && continue
  698. #
  699. # while IFS= read -r line; do
  700. # [ -z "$line" ] && continue
  701. # left=$(printf '%s' "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
  702. # if _is_enabled "$tmux_conf_copy_to_os_clipboard"; then
  703. # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-selection(-and-cancel)?$/copy-pipe\1 \"$command\"/g")
  704. # else
  705. # right=$(printf '%s' "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-pipe(-and-cancel)? \"$command\"$/copy-selection\1/g")
  706. # fi
  707. # eval "tmux $left $right" 2>/dev/null || true
  708. # done << EOF
  709. # $(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe')
  710. # EOF
  711. # done
  712. # fi
  713. # }
  714. #
  715. # _apply_theme() {
  716. #
  717. # # -- panes -------------------------------------------------------------
  718. #
  719. # tmux_conf_theme_window_fg=${tmux_conf_theme_window_fg:-default}
  720. # tmux_conf_theme_window_bg=${tmux_conf_theme_window_bg:-default}
  721. # tmux_conf_theme_highlight_focused_pane=${tmux_conf_theme_highlight_focused_pane:-false}
  722. # tmux_conf_theme_focused_pane_fg=${tmux_conf_theme_focused_pane_fg:-'default'} # default
  723. # tmux_conf_theme_focused_pane_bg=${tmux_conf_theme_focused_pane_bg:-'#0087d7'} # light blue
  724. #
  725. # # tmux 1.9 doesn't really like set -q
  726. # if tmux show -g -w | grep -q window-style; then
  727. # tmux setw -g window-style "fg=$tmux_conf_theme_window_fg,bg=$tmux_conf_theme_window_bg"
  728. #
  729. # if _is_enabled "$tmux_conf_theme_highlight_focused_pane"; then
  730. # tmux setw -g window-active-style "fg=$tmux_conf_theme_focused_pane_fg,bg=$tmux_conf_theme_focused_pane_bg"
  731. # else
  732. # tmux setw -g window-active-style default
  733. # fi
  734. # fi
  735. #
  736. # tmux_conf_theme_pane_border_style=${tmux_conf_theme_pane_border_style:-thin}
  737. # tmux_conf_theme_pane_border=${tmux_conf_theme_pane_border:-'#444444'} # light gray
  738. # tmux_conf_theme_pane_active_border=${tmux_conf_theme_pane_active_border:-'#00afff'} # light blue
  739. # tmux_conf_theme_pane_border_fg=${tmux_conf_theme_pane_border_fg:-$tmux_conf_theme_pane_border}
  740. # tmux_conf_theme_pane_active_border_fg=${tmux_conf_theme_pane_active_border_fg:-$tmux_conf_theme_pane_active_border}
  741. # case "$tmux_conf_theme_pane_border_style" in
  742. # fat)
  743. # tmux_conf_theme_pane_border_bg=${tmux_conf_theme_pane_border_bg:-$tmux_conf_theme_pane_border_fg}
  744. # tmux_conf_theme_pane_active_border_bg=${tmux_conf_theme_pane_active_border_bg:-$tmux_conf_theme_pane_active_border_fg}
  745. # ;;
  746. # thin|*)
  747. # tmux_conf_theme_pane_border_bg=${tmux_conf_theme_pane_border_bg:-'default'}
  748. # tmux_conf_theme_pane_active_border_bg=${tmux_conf_theme_pane_active_border_bg:-'default'}
  749. # ;;
  750. # esac
  751. # tmux 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"
  752. #
  753. # tmux_conf_theme_pane_indicator=${tmux_conf_theme_pane_indicator:-'#00afff'} # light blue
  754. # tmux_conf_theme_pane_active_indicator=${tmux_conf_theme_pane_active_indicator:-'#00afff'} # light blue
  755. #
  756. # tmux set -g display-panes-colour "$tmux_conf_theme_pane_indicator" \; set -g display-panes-active-colour "$tmux_conf_theme_pane_active_indicator"
  757. #
  758. # # -- status line -------------------------------------------------------
  759. #
  760. # tmux_conf_theme_left_separator_main=${tmux_conf_theme_left_separator_main-''}
  761. # tmux_conf_theme_left_separator_sub=${tmux_conf_theme_left_separator_sub-'|'}
  762. # tmux_conf_theme_right_separator_main=${tmux_conf_theme_right_separator_main-''}
  763. # tmux_conf_theme_right_separator_sub=${tmux_conf_theme_right_separator_sub-'|'}
  764. #
  765. # tmux_conf_theme_message_fg=${tmux_conf_theme_message_fg:-'#000000'} # black
  766. # tmux_conf_theme_message_bg=${tmux_conf_theme_message_bg:-'#ffff00'} # yellow
  767. # tmux_conf_theme_message_attr=${tmux_conf_theme_message_attr:-'bold'}
  768. # tmux set -g message-style "fg=$tmux_conf_theme_message_fg,bg=$tmux_conf_theme_message_bg,$tmux_conf_theme_message_attr"
  769. #
  770. # tmux_conf_theme_message_command_fg=${tmux_conf_theme_message_command_fg:-'#ffff00'} # yellow
  771. # tmux_conf_theme_message_command_bg=${tmux_conf_theme_message_command_bg:-'#000000'} # black
  772. # tmux_conf_theme_message_command_attr=${tmux_conf_theme_message_command_attr:-'bold'}
  773. # tmux 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"
  774. #
  775. # tmux_conf_theme_mode_fg=${tmux_conf_theme_mode_fg:-'#000000'} # black
  776. # tmux_conf_theme_mode_bg=${tmux_conf_theme_mode_bg:-'#ffff00'} # yellow
  777. # tmux_conf_theme_mode_attr=${tmux_conf_theme_mode_attr:-'bold'}
  778. # tmux setw -g mode-style "fg=$tmux_conf_theme_mode_fg,bg=$tmux_conf_theme_mode_bg,$tmux_conf_theme_mode_attr"
  779. #
  780. # tmux_conf_theme_status_fg=${tmux_conf_theme_status_fg:-'#8a8a8a'} # white
  781. # tmux_conf_theme_status_bg=${tmux_conf_theme_status_bg:-'#080808'} # dark gray
  782. # tmux_conf_theme_status_attr=${tmux_conf_theme_status_attr:-'none'}
  783. # tmux set -g status-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\
  784. # set -g status-left-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr" \;\
  785. # set -g status-right-style "fg=$tmux_conf_theme_status_fg,bg=$tmux_conf_theme_status_bg,$tmux_conf_theme_status_attr"
  786. #
  787. # tmux_conf_theme_terminal_title=${tmux_conf_theme_terminal_title:-'#h ❐ #S ● #I #W'}
  788. #
  789. # tmux_conf_theme_terminal_title=$(echo "$tmux_conf_theme_terminal_title" | sed \
  790. # -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #I)%g' \
  791. # -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g' \
  792. # -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \
  793. # -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \
  794. # -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \
  795. # -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g')
  796. # tmux set -g set-titles-string "$tmux_conf_theme_terminal_title"
  797. #
  798. # tmux_conf_theme_window_status_fg=${tmux_conf_theme_window_status_fg:-'#8a8a8a'} # white
  799. # tmux_conf_theme_window_status_bg=${tmux_conf_theme_window_status_bg:-'#080808'} # dark gray
  800. # tmux_conf_theme_window_status_attr=${tmux_conf_theme_window_status_attr:-'none'}
  801. # tmux_conf_theme_window_status_format=${tmux_conf_theme_window_status_format:-'#I #W'}
  802. #
  803. # tmux_conf_theme_window_status_current_fg=${tmux_conf_theme_window_status_current_fg:-'#000000'} # black
  804. # tmux_conf_theme_window_status_current_bg=${tmux_conf_theme_window_status_current_bg:-'#00afff'} # light blue
  805. # tmux_conf_theme_window_status_current_attr=${tmux_conf_theme_window_status_current_attr:-'bold'}
  806. # tmux_conf_theme_window_status_current_format=${tmux_conf_theme_window_status_current_format:-'#I #W'}
  807. # if [ x"$(tmux show -g -v status-justify)" = x"right" ]; then
  808. # tmux_conf_theme_window_status_current_format="#[fg=$tmux_conf_theme_window_status_current_bg,bg=$tmux_conf_theme_window_status_bg]$tmux_conf_theme_right_separator_main#[fg=default,bg=default,default] $tmux_conf_theme_window_status_current_format #[fg=$tmux_conf_theme_window_status_bg,bg=$tmux_conf_theme_window_status_current_bg,none]$tmux_conf_theme_right_separator_main"
  809. # else
  810. # tmux_conf_theme_window_status_current_format="#[fg=$tmux_conf_theme_window_status_bg,bg=$tmux_conf_theme_window_status_current_bg]$tmux_conf_theme_left_separator_main#[fg=default,bg=default,default] $tmux_conf_theme_window_status_current_format #[fg=$tmux_conf_theme_window_status_current_bg,bg=$tmux_conf_theme_status_bg,none]$tmux_conf_theme_left_separator_main"
  811. # fi
  812. #
  813. # tmux_conf_theme_window_status_format=$(echo "$tmux_conf_theme_window_status_format" | sed \
  814. # -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #I)%g' \
  815. # -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g' \
  816. # -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \
  817. # -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \
  818. # -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \
  819. # -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g')
  820. # tmux_conf_theme_window_status_current_format=$(echo "$tmux_conf_theme_window_status_current_format" | sed \
  821. # -e 's%#{circled_window_index}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #I)%g' \
  822. # -e 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g' \
  823. # -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \
  824. # -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \
  825. # -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \
  826. # -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g')
  827. #
  828. # tmux 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" \;\
  829. # setw -g window-status-format "$tmux_conf_theme_window_status_format" \;\
  830. # 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" \;\
  831. # setw -g window-status-current-format "$tmux_conf_theme_window_status_current_format"
  832. #
  833. # tmux_conf_theme_window_status_activity_fg=${tmux_conf_theme_window_status_activity_fg:-'default'}
  834. # tmux_conf_theme_window_status_activity_bg=${tmux_conf_theme_window_status_activity_bg:-'default'}
  835. # tmux_conf_theme_window_status_activity_attr=${tmux_conf_theme_window_status_activity_attr:-'underscore'}
  836. # tmux 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"
  837. #
  838. # tmux_conf_theme_window_status_bell_fg=${tmux_conf_theme_window_status_bell_fg:-'#ffff00'} # yellow
  839. # tmux_conf_theme_window_status_bell_bg=${tmux_conf_theme_window_status_bell_bg:-'default'}
  840. # tmux_conf_theme_window_status_bell_attr=${tmux_conf_theme_window_status_bell_attr:-'blink,bold'}
  841. # tmux 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"
  842. #
  843. # tmux_conf_theme_window_status_last_fg=${tmux_conf_theme_window_status_last_fg:-'#00afff'} # light blue
  844. # tmux_conf_theme_window_status_last_bg=${tmux_conf_theme_window_status_last_bg:-'default'}
  845. # tmux_conf_theme_window_status_last_attr=${tmux_conf_theme_window_status_last_attr:-'none'}
  846. # tmux 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"
  847. #
  848. # # -- indicators
  849. #
  850. # tmux_conf_theme_pairing=${tmux_conf_theme_pairing:-'👓'} # U+1F453
  851. # tmux_conf_theme_pairing_fg=${tmux_conf_theme_pairing_fg:-'#e4e4e4'} # white
  852. # tmux_conf_theme_pairing_bg=${tmux_conf_theme_pairing_bg:-'none'}
  853. # tmux_conf_theme_pairing_attr=${tmux_conf_theme_pairing_attr:-'none'}
  854. #
  855. # tmux_conf_theme_prefix=${tmux_conf_theme_prefix:-'⌨'} # U+2328
  856. # tmux_conf_theme_prefix_fg=${tmux_conf_theme_prefix_fg:-'#e4e4e4'} # white
  857. # tmux_conf_theme_prefix_bg=${tmux_conf_theme_prefix_bg:-'none'}
  858. # tmux_conf_theme_prefix_attr=${tmux_conf_theme_prefix_attr:-'none'}
  859. #
  860. # tmux_conf_theme_root=${tmux_conf_theme_root:-'!'}
  861. # tmux_conf_theme_root_fg=${tmux_conf_theme_root_fg:-'none'}
  862. # tmux_conf_theme_root_bg=${tmux_conf_theme_root_bg:-'none'}
  863. # tmux_conf_theme_root_attr=${tmux_conf_theme_root_attr:-'bold,blink'}
  864. #
  865. # tmux_conf_theme_synchronized=${tmux_conf_theme_synchronized:-'🔒'} # U+1F512
  866. # tmux_conf_theme_synchronized_fg=${tmux_conf_theme_synchronized_fg:-'none'}
  867. # tmux_conf_theme_synchronized_bg=${tmux_conf_theme_synchronized_bg:-'none'}
  868. # tmux_conf_theme_synchronized_attr=${tmux_conf_theme_synchronized_attr:-'none'}
  869. #
  870. # # -- status left style
  871. #
  872. # tmux_conf_theme_status_left=${tmux_conf_theme_status_left-' ❐ #S '}
  873. # tmux_conf_theme_status_left_fg=${tmux_conf_theme_status_left_fg:-'#000000,#e4e4e4,#e4e4e4'} # black, white , white
  874. # tmux_conf_theme_status_left_bg=${tmux_conf_theme_status_left_bg:-'#ffff00,#ff00af,#00afff'} # yellow, pink, white blue
  875. # tmux_conf_theme_status_left_attr=${tmux_conf_theme_status_left_attr:-'bold,none,none'}
  876. #
  877. # tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \
  878. # -e "s/#{pairing}/#[fg=$tmux_conf_theme_pairing_fg]#[bg=$tmux_conf_theme_pairing_bg]#[$tmux_conf_theme_pairing_attr]#{?session_many_attached,$tmux_conf_theme_pairing,}/g")
  879. #
  880. # tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \
  881. # -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{?client_prefix,$tmux_conf_theme_prefix,}/g")
  882. #
  883. # tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \
  884. # -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} #D)#[inherit]%g")
  885. #
  886. # tmux_conf_theme_status_left=$(echo "$tmux_conf_theme_status_left" | sed \
  887. # -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized,}%g")
  888. #
  889. # if [ -n "$tmux_conf_theme_status_left" ]; then
  890. # status_left=$(awk \
  891. # -v fg_="$tmux_conf_theme_status_left_fg" \
  892. # -v bg_="$tmux_conf_theme_status_left_bg" \
  893. # -v attr_="$tmux_conf_theme_status_left_attr" \
  894. # -v mainsep="$tmux_conf_theme_left_separator_main" \
  895. # -v subsep="$tmux_conf_theme_left_separator_sub" '
  896. # function subsplit(s, l, i, a, r)
  897. # {
  898. # l = split(s, a, ",")
  899. # for (i = 1; i <= l; ++i)
  900. # {
  901. # o = split(a[i], _, "(") - 1
  902. # c = split(a[i], _, ")") - 1
  903. # open += o - c
  904. # o_ = split(a[i], _, "{") - 1
  905. # c_ = split(a[i], _, "}") - 1
  906. # open_ += o_ - c_
  907. # o__ = split(a[i], _, "[") - 1
  908. # c__ = split(a[i], _, "]") - 1
  909. # open__ += o__ - c__
  910. #
  911. # if (i == l)
  912. # r = sprintf("%s%s", r, a[i])
  913. # else if (open || open_ || open__)
  914. # r = sprintf("%s%s,", r, a[i])
  915. # else
  916. # r = sprintf("%s%s#[fg=%s,bg=%s,%s]%s", r, a[i], fg[j], bg[j], attr[j], subsep)
  917. # }
  918. #
  919. # gsub(/#\[inherit\]/, sprintf("#[default]#[fg=%s,bg=%s,%s]", fg[j], bg[j], attr[j]), r)
  920. # return r
  921. # }
  922. # BEGIN {
  923. # FS = "|"
  924. # l1 = split(fg_, fg, ",")
  925. # l2 = split(bg_, bg, ",")
  926. # l3 = split(attr_, attr, ",")
  927. # l = l1 < l2 ? (l1 < l3 ? l1 : l3) : (l2 < l3 ? l2 : l3)
  928. # }
  929. # {
  930. # for (i = j = 1; i <= NF; ++i)
  931. # {
  932. # if (open || open_ || open__)
  933. # printf "|%s", subsplit($i)
  934. # else
  935. # {
  936. # if (i > 1)
  937. # 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)
  938. # else
  939. # printf "#[fg=%s,bg=%s,%s]%s", fg[j], bg[j], attr[j], subsplit($i)
  940. # }
  941. #
  942. # if (!open && !open_ && !open__)
  943. # {
  944. # j_ = j
  945. # j = j % l + 1
  946. # }
  947. # }
  948. # printf "#[fg=%s,bg=%s,none]%s", bg[j_], "default", mainsep
  949. # }' << EOF
  950. # $tmux_conf_theme_status_left
  951. # EOF
  952. # )
  953. # fi
  954. #
  955. # status_left="$status_left "
  956. #
  957. # # -- status right style
  958. #
  959. # tmux_conf_theme_status_right=${tmux_conf_theme_status_right-'#{pairing}#{prefix} #{battery_status} #{battery_bar} #{battery_percentage} , %R , %d %b | #{username} | #{hostname} '}
  960. # tmux_conf_theme_status_right_fg=${tmux_conf_theme_status_right_fg:-'#8a8a8a,#e4e4e4,#000000'} # light gray, white, black
  961. # tmux_conf_theme_status_right_bg=${tmux_conf_theme_status_right_bg:-'#080808,#d70000,#e4e4e4'} # dark gray, red, white
  962. # tmux_conf_theme_status_right_attr=${tmux_conf_theme_status_right_attr:-'none,none,bold'}
  963. #
  964. # tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \
  965. # -e "s/#{pairing}/#[fg=$tmux_conf_theme_pairing_fg]#[bg=$tmux_conf_theme_pairing_bg]#[$tmux_conf_theme_pairing_attr]#{?session_many_attached,$tmux_conf_theme_pairing,}/g")
  966. #
  967. # tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \
  968. # -e "s/#{prefix}/#[fg=$tmux_conf_theme_prefix_fg]#[bg=$tmux_conf_theme_prefix_bg]#[$tmux_conf_theme_prefix_attr]#{?client_prefix,$tmux_conf_theme_prefix,}/g")
  969. #
  970. # tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \
  971. # -e "s%#{root}%#[fg=$tmux_conf_theme_root_fg]#[bg=$tmux_conf_theme_root_bg]#[$tmux_conf_theme_root_attr]#(cut -c3- ~/.tmux.conf | sh -s _root #{pane_tty} #D)#[inherit]%g")
  972. #
  973. # tmux_conf_theme_status_right=$(echo "$tmux_conf_theme_status_right" | sed \
  974. # -e "s%#{synchronized}%#[fg=$tmux_conf_theme_synchronized_fg]#[bg=$tmux_conf_theme_synchronized_bg]#[$tmux_conf_theme_synchronized_attr]#{?pane_synchronized,$tmux_conf_theme_synchronized,}%g")
  975. #
  976. # if [ -n "$tmux_conf_theme_status_right" ]; then
  977. # status_right=$(awk \
  978. # -v fg_="$tmux_conf_theme_status_right_fg" \
  979. # -v bg_="$tmux_conf_theme_status_right_bg" \
  980. # -v attr_="$tmux_conf_theme_status_right_attr" \
  981. # -v mainsep="$tmux_conf_theme_right_separator_main" \
  982. # -v subsep="$tmux_conf_theme_right_separator_sub" '
  983. # function subsplit(s, l, i, a, r)
  984. # {
  985. # l = split(s, a, ",")
  986. # for (i = 1; i <= l; ++i)
  987. # {
  988. # o = split(a[i], _, "(") - 1
  989. # c = split(a[i], _, ")") - 1
  990. # open += o - c
  991. # o_ = split(a[i], _, "{") - 1
  992. # c_ = split(a[i], _, "}") - 1
  993. # open_ += o_ - c_
  994. # o__ = split(a[i], _, "[") - 1
  995. # c__ = split(a[i], _, "]") - 1
  996. # open__ += o__ - c__
  997. #
  998. # if (i == l)
  999. # r = sprintf("%s%s", r, a[i])
  1000. # else if (open || open_ || open__)
  1001. # r = sprintf("%s%s,", r, a[i])
  1002. # else
  1003. # r = sprintf("%s%s#[fg=%s,bg=%s,%s]%s", r, a[i], fg[j], bg[j], attr[j], subsep)
  1004. # }
  1005. #
  1006. # gsub(/#\[inherit\]/, sprintf("#[default]#[fg=%s,bg=%s,%s]", fg[j], bg[j], attr[j]), r)
  1007. # return r
  1008. # }
  1009. # BEGIN {
  1010. # FS = "|"
  1011. # l1 = split(fg_, fg, ",")
  1012. # l2 = split(bg_, bg, ",")
  1013. # l3 = split(attr_, attr, ",")
  1014. # l = l1 < l2 ? (l1 < l3 ? l1 : l3) : (l2 < l3 ? l2 : l3)
  1015. # }
  1016. # {
  1017. # for (i = j = 1; i <= NF; ++i)
  1018. # {
  1019. # if (open_ || open || open__)
  1020. # printf "|%s", subsplit($i)
  1021. # else
  1022. # printf "#[fg=%s,bg=%s,none]%s#[fg=%s,bg=%s,%s]%s", bg[j], (i == 1) ? "default" : bg[j_], mainsep, fg[j], bg[j], attr[j], subsplit($i)
  1023. #
  1024. # if (!open && !open_ && !open__)
  1025. # {
  1026. # j_ = j
  1027. # j = j % l + 1
  1028. # }
  1029. # }
  1030. # }' << EOF
  1031. # $tmux_conf_theme_status_right
  1032. # EOF
  1033. # )
  1034. # fi
  1035. #
  1036. # # -- variables
  1037. #
  1038. # tmux set -g '@root' "$tmux_conf_theme_root"
  1039. #
  1040. # tmux_conf_battery_bar_symbol_full=${tmux_conf_battery_bar_symbol_full:-'◼'}
  1041. # tmux_conf_battery_bar_symbol_empty=${tmux_conf_battery_bar_symbol_empty:-'◻'}
  1042. # tmux_conf_battery_bar_length=${tmux_conf_battery_bar_length:-'auto'}
  1043. # tmux_conf_battery_bar_palette=${tmux_conf_battery_bar_palette:-'gradient'}
  1044. # tmux_conf_battery_hbar_palette=${tmux_conf_battery_hbar_palette:-'gradient'} # red, orange, green
  1045. # tmux_conf_battery_vbar_palette=${tmux_conf_battery_vbar_palette:-'gradient'} # red, orange, green
  1046. # tmux_conf_battery_status_charging=${tmux_conf_battery_status_charging:-'↑'} # U+2191
  1047. # tmux_conf_battery_status_discharging=${tmux_conf_battery_status_discharging:-'↓'} # U+2193
  1048. #
  1049. # case "$status_left $status_right" in
  1050. # *'#{battery_status}'*|*'#{battery_bar}'*|*'#{battery_hbar}'*|*'#{battery_vbar}'*|*'#{battery_percentage}'*)
  1051. # status_left=$(echo "$status_left" | sed -E \
  1052. # -e 's/#\{(\?)?battery_bar/#\{\1@battery_bar/g' \
  1053. # -e 's/#\{(\?)?battery_hbar/#\{\1@battery_hbar/g' \
  1054. # -e 's/#\{(\?)?battery_vbar/#\{\1@battery_vbar/g' \
  1055. # -e 's/#\{(\?)?battery_status/#\{\1@battery_status/g' \
  1056. # -e 's/#\{(\?)?battery_percentage/#\{\1@battery_percentage/g')
  1057. # status_right=$(echo "$status_right" | sed -E \
  1058. # -e 's/#\{(\?)?battery_bar/#\{\1@battery_bar/g' \
  1059. # -e 's/#\{(\?)?battery_hbar/#\{\1@battery_hbar/g' \
  1060. # -e 's/#\{(\?)?battery_vbar/#\{\1@battery_vbar/g' \
  1061. # -e 's/#\{(\?)?battery_status/#\{\1@battery_status/g' \
  1062. # -e 's/#\{(\?)?battery_percentage/#\{\1@battery_percentage/g')
  1063. #
  1064. # tmux set -g '@battery_bar_symbol_full' "$tmux_conf_battery_bar_symbol_full" \;\
  1065. # set -g '@battery_bar_symbol_empty' "$tmux_conf_battery_bar_symbol_empty" \;\
  1066. # set -g '@battery_bar_length' "$tmux_conf_battery_bar_length" \;\
  1067. # set -g '@battery_bar_palette' "$tmux_conf_battery_bar_palette" \;\
  1068. # set -g '@battery_hbar_palette' "$tmux_conf_battery_hbar_palette" \;\
  1069. # set -g '@battery_vbar_palette' "$tmux_conf_battery_vbar_palette" \;\
  1070. # set -g '@battery_status_charging' "$tmux_conf_battery_status_charging" \;\
  1071. # set -g '@battery_status_discharging' "$tmux_conf_battery_status_discharging"
  1072. # status_right="#(cut -c3- ~/.tmux.conf | sh -s _battery)$status_right"
  1073. # ;;
  1074. # esac
  1075. #
  1076. # case "$status_left $status_right" in
  1077. # *'#{username}'*|*'#{hostname}'*|*'#{username_ssh}'*|*'#{hostname_ssh}'*)
  1078. # status_left=$(echo "$status_left" | sed \
  1079. # -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \
  1080. # -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \
  1081. # -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \
  1082. # -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g')
  1083. # status_right=$(echo "$status_right" | sed \
  1084. # -e 's%#{username}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} false #D)%g' \
  1085. # -e 's%#{hostname}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} false #D)%g' \
  1086. # -e 's%#{username_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _username #{pane_tty} true #D)%g' \
  1087. # -e 's%#{hostname_ssh}%#(cut -c3- ~/.tmux.conf | sh -s _hostname #{pane_tty} true #D)%g')
  1088. # ;;
  1089. # esac
  1090. #
  1091. # case "$status_left $status_right" in
  1092. # *'#{uptime_d}'*|*'#{uptime_h}'*|*'#{uptime_m}'*)
  1093. # status_left=$(echo "$status_left" | sed -E \
  1094. # -e 's/#\{(\?)?uptime_d/#\{\1@uptime_d/g' \
  1095. # -e 's/#\{(\?)?uptime_h/#\{\1@uptime_h/g' \
  1096. # -e 's/#\{(\?)?uptime_m/#\{\1@uptime_m/g' \
  1097. # -e 's/#\{(\?)?uptime_s/#\{\1@uptime_s/g')
  1098. # status_right=$(echo "$status_right" | sed -E \
  1099. # -e 's/#\{(\?)?uptime_d/#\{\1@uptime_d/g' \
  1100. # -e 's/#\{(\?)?uptime_h/#\{\1@uptime_h/g' \
  1101. # -e 's/#\{(\?)?uptime_m/#\{\1@uptime_m/g' \
  1102. # -e 's/#\{(\?)?uptime_s/#\{\1@uptime_s/g')
  1103. # status_right="#(cut -c3- ~/.tmux.conf | sh -s _uptime)$status_right"
  1104. # ;;
  1105. # esac
  1106. #
  1107. # case "$status_left $status_right" in
  1108. # *'#{loadavg}'*)
  1109. # status_left=$(echo "$status_left" | sed -E \
  1110. # -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g')
  1111. # status_right=$(echo "$status_right" | sed -E \
  1112. # -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g')
  1113. # status_right="#(cut -c3- ~/.tmux.conf | sh -s _loadavg)$status_right"
  1114. # ;;
  1115. # esac
  1116. #
  1117. # status_left=$(echo "$status_left" | sed 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g')
  1118. # status_right=$(echo "$status_right" | sed 's%#{circled_session_name}%#(cut -c3- ~/.tmux.conf | sh -s _circled_digit #S)%g')
  1119. #
  1120. # tmux set -g status-left-length 1000 \; set -g status-left "$status_left" \;\
  1121. # set -g status-right-length 1000 \; set -g status-right "$status_right"
  1122. #
  1123. # # -- clock -------------------------------------------------------------
  1124. #
  1125. # tmux_conf_theme_clock_colour=${tmux_conf_theme_clock_colour:-'#00afff'} # light blue
  1126. # tmux_conf_theme_clock_style=${tmux_conf_theme_clock_style:-'24'}
  1127. # tmux setw -g clock-mode-colour "$tmux_conf_theme_clock_colour" \;\
  1128. # setw -g clock-mode-style "$tmux_conf_theme_clock_style"
  1129. # }
  1130. #
  1131. # _apply_configuration() {
  1132. #
  1133. # # see https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
  1134. # if command -v reattach-to-user-namespace > /dev/null 2>&1; then
  1135. # default_shell="$(tmux show -gv default-shell)"
  1136. # case "$default_shell" in
  1137. # *fish)
  1138. # tmux set -g default-command "reattach-to-user-namespace -l $default_shell"
  1139. # ;;
  1140. # *sh)
  1141. # tmux set -g default-command "exec $default_shell... 2> /dev/null & reattach-to-user-namespace -l $default_shell"
  1142. # ;;
  1143. # esac
  1144. # fi
  1145. #
  1146. # _apply_overrides
  1147. # _apply_bindings
  1148. # _apply_theme
  1149. # for name in $(printenv | grep -Eo '^tmux_conf_[^=]+'); do tmux setenv -gu "$name"; done;
  1150. # }
  1151. #
  1152. # _urlview() {
  1153. # tmux capture-pane -J -S - -E - -b "urlview-$1" -t "$1"
  1154. # tmux split-window "tmux show-buffer -b urlview-$1 | urlview || true; tmux delete-buffer -b urlview-$1"
  1155. # }
  1156. #
  1157. # _fpp() {
  1158. # tmux capture-pane -J -S - -E - -b "fpp-$1" -t "$1"
  1159. # tmux split-window "tmux show-buffer -b fpp-$1 | fpp || true; tmux delete-buffer -b fpp-$1"
  1160. # }
  1161. #
  1162. # "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement