Compare commits

..

No commits in common. "4682d25093bf713b0c40c80080bd6a41811d38d5" and "4e77ebc097b29aa9bf72336669cb0c86a1f6ca5b" have entirely different histories.

View file

@ -7,40 +7,8 @@
# ╰──────┴───────╯ # ╰──────┴───────╯
rwx_tmux_setup() { rwx_tmux_setup() {
local file script local file
file="${HOME}/.tmux.conf" file="${HOME}/.tmux.conf"
script="${HOME}/.tmux.sh"
rwx_file_write "${script}" "\
rwx_tmux_server() {
basename \"\${TMUX}\" |
cut \\
--delimiter \",\" \\
--fields \"1\"
}
rwx_tmux_servers() {
local active=\"\$(rwx_tmux_server)\"
local ifs=\"\${IFS}\"
local name path text
local paths=\"\$(lsof -U |
awk \"/^tmux:.*\\(LISTEN\\)\$/ {print \\\$9}\")\"
IFS=\"
\"
for path in \${paths}; do
name=\"\$(basename \"\${path}\")\"
if [ \"\${active}\" = \"\${name}\" ]; then
text=\"\${text}#[fg=green]\"
else
text=\"\${text}#[fg=yellow]\"
fi
text=\"\${text}\\
#[bg=##181818] #[bg=##282828]\\
\${name}\\
#[bg=##181818] #[bg=default]#[fg=default] \"
done
IFS=\"\${ifs}\"
echo \"\${text}\"
}
"
rwx_file_write "${file}" "\ rwx_file_write "${file}" "\
# ╭────────╮ # ╭────────╮
# │ option │ # │ option │
@ -83,13 +51,13 @@ set-option -g set-titles on
# set title to working directory # set title to working directory
set-option -g set-titles-string '\ set-option -g set-titles-string '\
#(sh -c \". ${script}; rwx_tmux_server\")\ #(basename \"\${TMUX}\" | cut --delimiter \",\" --fields \"1\")\
\ \
#{session_name}\ #{session_name}\
\ \
#{window_name} (#{window_index}∕#{session_windows})\ #{window_index}∕#{session_windows} #{window_name}\
\ \
#{pane_current_command} (#{pane_index}∕#{window_panes})\ #{pane_index}∕#{window_panes} #{pane_current_command}\
' '
# ╭────────┬──────╮ # ╭────────┬──────╮
@ -167,7 +135,25 @@ set-option -g status-format[1] '\
# line 3 # line 3
set-option -g status-format[2] '\ set-option -g status-format[2] '\
#[fg=yellow]\ #[fg=yellow]\
#(sh -c \". ${script}; rwx_tmux_servers\")\ #(lsof -U \
| awk \"/^tmux:.*\\(LISTEN\\)$/ {print \\\$9}\" \
| xargs -n \"1\" basename \
| sed \"s/^/#[fg=yellow]#[bg=##181818] #[bg=##282828]/\
;s/\$/#[bg=##181818] #[fg=default]#[bg=default] /\" \
| xargs echo \
)\
#[fg=default] \
#[fg=white]→\
#[fg=default] \
#[fg=green]\
#[bg=##181818] \
#[bg=##282828]#(basename \"\${TMUX}\" \
| cut --delimiter \",\" --fields \"1\")\
#[bg=##181818] \
#[bg=default]\
#[fg=default] \
#[fg=white]@\
#[fg=default] \
#[fg=cyan]#{pane_current_path}\ #[fg=cyan]#{pane_current_path}\
' '