Create activate function for python venvs

This commit is contained in:
exu 2025-03-04 15:50:55 +01:00
parent 1170977ec3
commit 74a3d8190d
2 changed files with 13 additions and 3 deletions

View File

@ -140,9 +140,6 @@ alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
# Clean cached packages
alias cleancache='paru -Sc'
# activate venv called "venv"
alias activate='source venv/bin/activate.fish'
# lsblk to list more info
alias lsblkf="lsblk -o NAME,LABEL,RM,SIZE,RO,TYPE,FSTYPE,MOUNTPOINTS,MODEL,UUID"

View File

@ -0,0 +1,13 @@
# Activate local Python venv
function activate
# Set path to venv activation script
set target -f "./.venv/bin/activate.fish"
# create venv if it doesn't exist
if not test -e $target
python -m venv ./.venv
end
# activate venv
source $target
end