script/shelldoc

This commit is contained in:
Marc Beninca 2025-07-25 23:51:13 +02:00
parent be8245a5f5
commit 69edbd40d7
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -135,13 +135,21 @@ rwx_tmux_setup() {
file="${HOME}/.tmux.conf"
script="${HOME}/.tmux.sh"
fi
# FIXME skip parsing these functions
rwx_file_write "${script}" "\
# ╭─────┬──────┬────────╮
# │ rwx │ tmux │ script │
# ╰─────┴──────┴────────╯
# return current server socket name
rwx_tmux_server() {
basename \"\${TMUX}\" |
cut \\
--delimiter \",\" \\
--fields \"1\"
}
# return active & current servers socket names
rwx_tmux_servers() {
local active name root sockets text user_id
active=\"\$(rwx_tmux_server)\"
@ -169,6 +177,9 @@ ${RWX_TMUX_BORDER_BACKGROUND} \\
EOF
echo \"\${text}\"
}
# set status lines option
# off, on, 2, 3, 4, 5
rwx_tmux_status() {
local current=\"\${1}\"
local operand=\"\${2}\"
@ -197,6 +208,8 @@ rwx_tmux_status() {
esac
tmux set-option -g status \"\${current}\"
}
# render uptime date & time
rwx_tmux_uptime() {
local since=\"\$(uptime --since)\"
local date=\"\$(echo \"\${since}\" | awk '{print \$1}')\"