Closed thiswillbeyourgithub closed 1 week ago
This is pretty cool! We should probably add stuff like this to a wiki so it is easy for people to find
I created a wiki page for this and linked to it from the wiki homepage. I'll also update the README to link to the wiki homepage so people can find it.
Just a correction: i don't think of this as a way to launch shpool but rather as a way to easily attach to sessions
Once https://github.com/shell-pool/shpool/pull/54 merges this will be fully incorporated in shpool's documentation.
Thanks!
Addendum: In effect, the way I launch shpool currently is directly in my .zshrc, only when not using kitty. This is usually when I ssh, usually via termux to my computer.
I think this can serve as inspiration to others too:
## directly checks if it should start a tmux session to avoir running the entire zshrc twice
if [[ ! "$TERM" == "xterm-kitty" ]] # kitty does not seem to work well and it's mainly to be used when I ssh into here
then
# create a new shpool session
$(printenv | grep -q '^SHPOOL_SESSION_NAME=') || { # if we're not already in a shpool session
{
sessions=$(shpool list | tail -n +2 | cut -f1)
for letter in {a..z} # sessions are named a through z to be easy to type on termux, as shpool has no autocomplete
do
$(echo "$sessions" | grep -q "$letter") || {
# notify-send "Creating shpool session $letter"
shpool attach "$letter" || notify-send "Error creating shpool session"
break # we could logout here too
}
done
} || { notify-send -u critical "Error creating shpool session" ; echo "Error creating shpool session" }
}
$(printenv | grep -q '^SHPOOL_SESSION_NAME=') && {
echo "Using shpool session $SHPOOL_SESSION_NAME"
}
fi
@thiswillbeyourgithub are you able to directly contribute this to the wiki? (If not let me know and I can try to dig up the right settings).
I don't think that I can. I can only clone the wiki, and probably make a PR
Try now
Like a charm. Thanks!
I added my zsh start script btw.
Hi,
I just wanted to share my session selector made with fzf. I'll probably enhance it in the future but it's still a good starting point.
Note that I'm using zsh and my fzf version is 0.52.1 (it's very outdated on most distro!):