Compare commits
No commits in common. "30882f3fd9b6ece7e7fbcdc43d3104f39922564e" and "76cd24869771db0af84d080c4895a48f86c05ee1" have entirely different histories.
30882f3fd9
...
76cd248697
4 changed files with 12 additions and 13 deletions
|
@ -3,12 +3,10 @@ rwx_shellcheck() {
|
||||||
local file module modules path
|
local file module modules path
|
||||||
file="$(mktemp)"
|
file="$(mktemp)"
|
||||||
modules="$(rwx_find_shell "${root}")"
|
modules="$(rwx_find_shell "${root}")"
|
||||||
while IFS= read -r module; do
|
printf "%s\n" "${modules}" | while IFS= read -r module; do
|
||||||
path="${root}/${module}"
|
path="${root}/${module}"
|
||||||
echo ". \"${path}\"" >>"${file}"
|
echo ". \"${path}\"" >>"${file}"
|
||||||
done <<EOF
|
done
|
||||||
${modules}
|
|
||||||
EOF
|
|
||||||
rwx_shellcheck_file "${file}"
|
rwx_shellcheck_file "${file}"
|
||||||
rwx_remove "${file}"
|
rwx_remove "${file}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,8 @@ rwx_main() {
|
||||||
# │ main │ cache │
|
# │ main │ cache │
|
||||||
# ╰──────┴───────╯
|
# ╰──────┴───────╯
|
||||||
|
|
||||||
|
RWX_CODE=""
|
||||||
|
|
||||||
# cache source code of a module
|
# cache source code of a module
|
||||||
rwx_cache() {
|
rwx_cache() {
|
||||||
local root="${1}"
|
local root="${1}"
|
||||||
|
@ -71,7 +73,6 @@ rwx_cache() {
|
||||||
local path="${root}/${module}"
|
local path="${root}/${module}"
|
||||||
local text
|
local text
|
||||||
text="$(cat "${path}")"
|
text="$(cat "${path}")"
|
||||||
# all source code
|
|
||||||
RWX_CODE="${RWX_CODE}\
|
RWX_CODE="${RWX_CODE}\
|
||||||
#↓ ${name}
|
#↓ ${name}
|
||||||
${text}
|
${text}
|
||||||
|
|
|
@ -5,7 +5,7 @@ rwx_doc() {
|
||||||
local name="${1}"
|
local name="${1}"
|
||||||
[ -n "${name}" ] || return
|
[ -n "${name}" ] || return
|
||||||
local constant doc func line module
|
local constant doc func line module
|
||||||
while IFS= read -r line; do
|
printf "%s\n" "${RWX_CODE}" | while IFS= read -r line; do
|
||||||
case "${line}" in
|
case "${line}" in
|
||||||
"#!"*) doc="" ;;
|
"#!"*) doc="" ;;
|
||||||
"#↓"*)
|
"#↓"*)
|
||||||
|
@ -44,9 +44,7 @@ rwx_doc() {
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done <<EOF
|
done
|
||||||
${RWX_CODE}
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────┬───────╮
|
# ╭──────┬───────╮
|
||||||
|
|
10
sh/tmux.sh
10
sh/tmux.sh
|
@ -25,10 +25,13 @@ rwx_tmux_server() {
|
||||||
}
|
}
|
||||||
rwx_tmux_servers() {
|
rwx_tmux_servers() {
|
||||||
local active=\"\$(rwx_tmux_server)\"
|
local active=\"\$(rwx_tmux_server)\"
|
||||||
|
local ifs=\"\${IFS}\"
|
||||||
local name path text
|
local name path text
|
||||||
local paths=\"\$(lsof -U |
|
local paths=\"\$(lsof -U |
|
||||||
awk \"/^tmux:.*\\(LISTEN\\)\$/ {print \\\$9}\")\"
|
awk \"/^tmux:.*\\(LISTEN\\)\$/ {print \\\$9}\")\"
|
||||||
while IFS= read -r path; do
|
IFS=\"
|
||||||
|
\"
|
||||||
|
for path in \${paths}; do
|
||||||
name=\"\$(basename \"\${path}\")\"
|
name=\"\$(basename \"\${path}\")\"
|
||||||
text=\"\${text}\\
|
text=\"\${text}\\
|
||||||
#[fg=default]\\
|
#[fg=default]\\
|
||||||
|
@ -44,9 +47,8 @@ rwx_tmux_servers() {
|
||||||
#[bg=##282828]\${name}\\
|
#[bg=##282828]\${name}\\
|
||||||
#[bg=##181818] \\
|
#[bg=##181818] \\
|
||||||
\"
|
\"
|
||||||
done <<EOF
|
done
|
||||||
\${paths}
|
IFS=\"\${ifs}\"
|
||||||
EOF
|
|
||||||
echo \"\${text}\"
|
echo \"\${text}\"
|
||||||
}
|
}
|
||||||
rwx_tmux_status() {
|
rwx_tmux_status() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue