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