Recovered lost code from other libraries

This commit is contained in:
Queue A
2026-06-03 06:36:09 +02:00
parent d66d2fd4ca
commit efdf7d6f0f
4 changed files with 80 additions and 24 deletions

31
bash/init_pyenv.sh Normal file
View File

@@ -0,0 +1,31 @@
init_pyenv(){
vtuple="(${1//./, })";
python3 -c "import sys; exit(sys.version_info <= ($vtuple))";
pyvok=$?;
if [ $pyvok -eq 1 ]; then
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update
apt-get -y install "python$1" "python$1-venv"
"python$1" -m venv .env
else
python3 -m venv .env
fi;
source .env/bin/activate;
if [ -z "$2" ]; then
reqfile="requirements.txt";
else
reqfile="$2";
fi
if [ -z "$3" ]; then
piplog="/dev/null";
else
piplog="$3";
fi
pip install -r "$reqfile" >> "$piplog";
echo "PIP status: $?" >> "$piplog";
}

13
bash/thismux.sh Normal file
View File

@@ -0,0 +1,13 @@
thismux() {
dir="$(pwd)"
# Search upwards for `.run/thismux.sock`
while [ "$dir" != "/" ]; do
if [ -d "$dir/.run" ]; then
tmux -S "$dir/.run/thismux.sock" "$@"
return
fi
dir="$(dirname "$dir")"
done
echo "No .run found in any parent directory."
return 1
}