14 lines
556 B
Bash
14 lines
556 B
Bash
#!/bin/sh
|
|||
|
|
# abmux: a simple terminal session switcher on top of abduco and fzf
|
||
|
|
# Created by Luxferre in 2026, released into the public domain
|
||
|
|
|
||
|
|
FTR='Select a session or create a new one'
|
||
|
|
while true; do
|
||
|
|
slist="$(abduco | tail -n +2 | cut -f 3 | nl -nln -w1 -s' - ')"
|
||
|
|
sname="$(printf '%s\nNew\nQuit\n' "${slist}" | grep . | fzf --tac --footer="$FTR")"
|
||
|
|
[ "$sname" = 'Quit' ] && break
|
||
|
|
[ "$sname" = 'New' ] && read -r -p 'New session name: ' sname
|
||
|
|
sname="$(echo "$sname" | sed -E 's/^\d+\ -\ //')"
|
||
|
|
[ -n "$sname" ] && abduco -A "$sname" "$SHELL"
|
||
|
|
done
|