amssh now themed
parent
507ca5db6b
commit
78312e9b4d
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 2c09cefa74e930c722e6dabcc231cfbdc8647804
|
||||||
|
|
@ -269,23 +269,25 @@ BX=$(( (cols - BW) / 2 )); [[ $BX -lt 0 ]] && BX=0
|
||||||
BY=$(( (rows - BH) / 2 )); [[ $BY -lt 0 ]] && BY=0
|
BY=$(( (rows - BH) / 2 )); [[ $BY -lt 0 ]] && BY=0
|
||||||
|
|
||||||
# colour / style shortcuts
|
# colour / style shortcuts
|
||||||
_b=$(tput bold); _r=$(tput sgr0)
|
_b=$(tput bold); _r=$(tput sgr0); _di=$(tput dim)
|
||||||
_cy=$(tput setaf 6); _gr=$(tput setaf 2)
|
_HL=$'\033[38;2;228;0;70m' # Highlights #E40046
|
||||||
_re=$(tput setaf 1); _di=$(tput dim); _ye=$(tput setaf 3)
|
_DK=$'\033[38;2;80;24;221m' # Dark #5018DD
|
||||||
|
_QW=$'\033[38;2;214;171;171m' # Quasi-White #D6ABAB
|
||||||
|
_RH=$'\033[38;2;245;5;5m' # Red-Hivis #F50505
|
||||||
|
|
||||||
# ── draw box ──────────────────────────────────────────────────────────────────
|
# ── draw box ──────────────────────────────────────────────────────────────────
|
||||||
tput cup $BY $BX
|
tput cup $BY $BX
|
||||||
printf "${_b}${_cy}╔$(printf '═%.0s' $(seq 1 $((BW-2))))╗${_r}"
|
printf "${_b}${_HL}╔$(printf '═%.0s' $(seq 1 $((BW-2))))╗${_r}"
|
||||||
for (( i=1; i<BH-1; i++ )); do
|
for (( i=1; i<BH-1; i++ )); do
|
||||||
tput cup $((BY+i)) $BX; printf "${_cy}║${_r}"
|
tput cup $((BY+i)) $BX; printf "${_HL}║${_r}"
|
||||||
tput cup $((BY+i)) $((BX+BW-1)); printf "${_cy}║${_r}"
|
tput cup $((BY+i)) $((BX+BW-1)); printf "${_HL}║${_r}"
|
||||||
done
|
done
|
||||||
tput cup $((BY+BH-1)) $BX
|
tput cup $((BY+BH-1)) $BX
|
||||||
printf "${_b}${_cy}╚$(printf '═%.0s' $(seq 1 $((BW-2))))╝${_r}"
|
printf "${_b}${_HL}╚$(printf '═%.0s' $(seq 1 $((BW-2))))╝${_r}"
|
||||||
|
|
||||||
_title=" Add SSH Server "
|
_title=" Add SSH Server "
|
||||||
tput cup $BY $(( BX + (BW - ${#_title}) / 2 ))
|
tput cup $BY $(( BX + (BW - ${#_title}) / 2 ))
|
||||||
printf "${_b}${_cy}${_title}${_r}"
|
printf "${_b}${_HL}${_title}${_r}"
|
||||||
|
|
||||||
# ── layout constants ──────────────────────────────────────────────────────────
|
# ── layout constants ──────────────────────────────────────────────────────────
|
||||||
# Columns
|
# Columns
|
||||||
|
|
@ -303,15 +305,15 @@ _AFW=48 # alias field width
|
||||||
_slot() {
|
_slot() {
|
||||||
local row=$1 col=$2 w=$3
|
local row=$1 col=$2 w=$3
|
||||||
tput cup "$row" "$col"
|
tput cup "$row" "$col"
|
||||||
printf "${_cy}▸ ${_di}$(printf '·%.0s' $(seq 1 "$w"))${_r}"
|
printf "${_DK}▸ ${_di}$(printf '·%.0s' $(seq 1 "$w"))${_r}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# draw labels
|
# draw labels
|
||||||
tput cup $_R1 $_LC; printf "${_b}Username${_r}"
|
tput cup $_R1 $_LC; printf "${_QW}${_b}Username${_r}"
|
||||||
tput cup $_R2 $_LC; printf "${_b}Password${_r}"
|
tput cup $_R2 $_LC; printf "${_QW}${_b}Password${_r}"
|
||||||
tput cup $_R3 $_LC; printf "${_b}Alias${_r}"
|
tput cup $_R3 $_LC; printf "${_QW}${_b}Alias${_r}"
|
||||||
tput cup $_R1 $_RC; printf "${_b}Host${_r}"
|
tput cup $_R1 $_RC; printf "${_QW}${_b}Host${_r}"
|
||||||
tput cup $_R2 $_RC; printf "${_b}Port${_r}"
|
tput cup $_R2 $_RC; printf "${_QW}${_b}Port${_r}"
|
||||||
|
|
||||||
# draw field slots
|
# draw field slots
|
||||||
_slot $_R1 $_LF $_LFW
|
_slot $_R1 $_LF $_LFW
|
||||||
|
|
@ -322,7 +324,7 @@ _slot $_R3 $_LF $_AFW
|
||||||
|
|
||||||
# hint line
|
# hint line
|
||||||
tput cup $((BY+BH-3)) $((BX+3))
|
tput cup $((BY+BH-3)) $((BX+3))
|
||||||
printf "${_di}Tab/Enter to advance · Ctrl-C to cancel${_r}"
|
printf "${_QW}${_di}Tab/Enter to advance · Ctrl-C to cancel${_r}"
|
||||||
|
|
||||||
# ── field reader helpers ──────────────────────────────────────────────────────
|
# ── field reader helpers ──────────────────────────────────────────────────────
|
||||||
# Reads chars until Tab or Enter; Backspace edits in place; sets named var.
|
# Reads chars until Tab or Enter; Backspace edits in place; sets named var.
|
||||||
|
|
@ -365,7 +367,7 @@ tput civis
|
||||||
# ── validate ──────────────────────────────────────────────────────────────────
|
# ── validate ──────────────────────────────────────────────────────────────────
|
||||||
_err() {
|
_err() {
|
||||||
tput cup $((BY+BH-2)) $((BX+3))
|
tput cup $((BY+BH-2)) $((BX+3))
|
||||||
printf "${_re}${_b}✗ %s${_r}" "$1"
|
printf "${_RH}${_b}✗ %s${_r}" "$1"
|
||||||
sleep 1.5; exit 1
|
sleep 1.5; exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -390,7 +392,7 @@ fi
|
||||||
-out "$_S" -pass env:AMSSH_PASS
|
-out "$_S" -pass env:AMSSH_PASS
|
||||||
|
|
||||||
tput cup $((BY+BH-2)) $((BX+3))
|
tput cup $((BY+BH-2)) $((BX+3))
|
||||||
printf "${_gr}${_b}✓ Added:${_r} %s → %s@%s:%s" "$_alias" "$_user" "$_host" "$_port"
|
printf "${_QW}${_b}✓ Added:${_r} %s → %s@%s:%s" "$_alias" "$_user" "$_host" "$_port"
|
||||||
sleep 0.8
|
sleep 0.8
|
||||||
ADD
|
ADD
|
||||||
} > "$add_sh"; chmod +x "$add_sh"
|
} > "$add_sh"; chmod +x "$add_sh"
|
||||||
|
|
@ -435,7 +437,8 @@ PREV
|
||||||
sel=$(bash "$list_sh" \
|
sel=$(bash "$list_sh" \
|
||||||
| fzf \
|
| fzf \
|
||||||
--prompt="SSH › " \
|
--prompt="SSH › " \
|
||||||
--header=$' \e[1mEnter\e[0m connect \e[1ma\e[0m add \e[1md\e[0m delete \e[1mq\e[0m quit\n \e[2mj/k\e[0m down/up \e[2mg/G\e[0m top/bottom \e[2m/\e[0m filter' \
|
--color='fg:#D6ABAB,hl:#E40046,fg+:#D6ABAB,bg+:#1A1A1A,hl+:#F50505,info:#5018DD,prompt:#E40046,pointer:#E40046,marker:#5018DD,spinner:#E40046,header:#D6ABAB' \
|
||||||
|
--header=$' \e[1m\e[38;2;228;0;70mEnter\e[0m connect \e[1m\e[38;2;228;0;70ma\e[0m add \e[1m\e[38;2;228;0;70md\e[0m delete \e[1m\e[38;2;228;0;70mq\e[0m quit\n \e[2m\e[38;2;80;24;221mj/k\e[0m down/up \e[2m\e[38;2;80;24;221mg/G\e[0m top/bottom \e[2m\e[38;2;80;24;221m/\e[0m filter' \
|
||||||
--bind="a:execute(bash '$add_sh')+reload(bash '$list_sh')" \
|
--bind="a:execute(bash '$add_sh')+reload(bash '$list_sh')" \
|
||||||
--bind="d:execute(bash '$del_sh' {1})+reload(bash '$list_sh')" \
|
--bind="d:execute(bash '$del_sh' {1})+reload(bash '$list_sh')" \
|
||||||
--preview="bash '$prev_sh' {}" \
|
--preview="bash '$prev_sh' {}" \
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,7 @@
|
||||||
name = The_miro
|
name = The_miro
|
||||||
[credential]
|
[credential]
|
||||||
helper = store
|
helper = store
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
|
[push]
|
||||||
|
autoSetupRemote = true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue