From ba88be96c7a77e902637bfc8e77d6dc7b32c08e3 Mon Sep 17 00:00:00 2001 From: dabruh <11458706-dabruh@users.noreply.gitlab.com> Date: Fri, 15 Sep 2023 12:53:23 +0200 Subject: [PATCH] Install Python packages into virtualenv --- .config/i3/layers/config.post-main-01-visuals | 2 +- .config/i3/layers/config.pre-main-00-vars | 2 ++ setup_system.sh | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.config/i3/layers/config.post-main-01-visuals b/.config/i3/layers/config.post-main-01-visuals index 502e39f..933df06 100644 --- a/.config/i3/layers/config.post-main-01-visuals +++ b/.config/i3/layers/config.post-main-01-visuals @@ -2,7 +2,7 @@ exec_always --no-startup-id pidof -s picom || picom # 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 # Set wallpaper diff --git a/.config/i3/layers/config.pre-main-00-vars b/.config/i3/layers/config.pre-main-00-vars index f6762f3..ea1b3ba 100644 --- a/.config/i3/layers/config.pre-main-00-vars +++ b/.config/i3/layers/config.pre-main-00-vars @@ -13,3 +13,5 @@ set $calc_cmd kitty --title calculator bc -l set $browser firefox set $terminal kitty + +set $flashfocus_bin /opt/dotfiles/pyenv/bin/flashfocus diff --git a/setup_system.sh b/setup_system.sh index cad93a5..43e6637 100755 --- a/setup_system.sh +++ b/setup_system.sh @@ -11,6 +11,8 @@ script_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit 1 pwd -P )" +opt_dir=/opt/dotfiles +python_venv=$opt_dir/pyenv # # Argument parsing and help @@ -79,8 +81,18 @@ function construct_target_list() { } 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 sudo pip3 install $(get_packages $(construct_target_list pip)) --no-input || return 1 + + deactivate } function install_sddm_aerial_theme() {