Install Python packages into virtualenv

This commit is contained in:
dabruh 2023-09-15 12:53:23 +02:00
parent b474ba1e91
commit ba88be96c7
3 changed files with 15 additions and 1 deletions

View File

@ -2,7 +2,7 @@
exec_always --no-startup-id pidof -s picom || picom exec_always --no-startup-id pidof -s picom || picom
# Run flashfocus # Run flashfocus
exec_always --no-startup-id flashfocus --config ~/.config/flashfocus/flashfocus.yml exec_always --no-startup-id $flashfocus_bin --config ~/.config/flashfocus/flashfocus.yml
bindsym Alt+section exec --no-startup-id flash_window bindsym Alt+section exec --no-startup-id flash_window
# Set wallpaper # Set wallpaper

View File

@ -13,3 +13,5 @@ set $calc_cmd kitty --title calculator bc -l
set $browser firefox set $browser firefox
set $terminal kitty set $terminal kitty
set $flashfocus_bin /opt/dotfiles/pyenv/bin/flashfocus

View File

@ -11,6 +11,8 @@ script_dir="$(
cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit 1 cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit 1
pwd -P pwd -P
)" )"
opt_dir=/opt/dotfiles
python_venv=$opt_dir/pyenv
# #
# Argument parsing and help # Argument parsing and help
@ -79,8 +81,18 @@ function construct_target_list() {
} }
function setup_pip_packages() { function setup_pip_packages() {
echo "Installing Python packages into virtualenv $python_venv"
! [ -d "$opt_dir" ] && sudo mkdir "$opt_dir"
sudo python -m venv "$python_venv"
# shellcheck disable=SC1091
source "$python_venv/bin/activate"
# shellcheck disable=SC2046 # shellcheck disable=SC2046
sudo pip3 install $(get_packages $(construct_target_list pip)) --no-input || return 1 sudo pip3 install $(get_packages $(construct_target_list pip)) --no-input || return 1
deactivate
} }
function install_sddm_aerial_theme() { function install_sddm_aerial_theme() {