diff --git a/dotinstall.sh b/dotinstall.sh index a689f34..73e29bf 100755 --- a/dotinstall.sh +++ b/dotinstall.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Symlink dotfiles into the home directory +# Installs dotfiles and Python packages set -e @@ -8,24 +8,27 @@ SCRIPT_NAME="$(basename $0)" # Default source for dotfiles SRCFOLDER="$(dirname "$0")/src/" +PYREQS="$(realpath "$(dirname "$0")/programs-python")" DESTFOLDER="$HOME" # Allow overwriting of outdated files FORCE="N" VERBOSE="N" +INSTALL_PYTHON="N" display_help () { cat >&2 <&2 + +if [ "$INSTALL_PYTHON" = "Y" ]; then + if command -v pipx > /dev/null; then + printf "Installing Python packages via pipx...\n" >&2 + cat "$PYREQS" | sed "/#.*/d" | xargs -I{} pipx install {} + else + printf "'pipx' is missing. Not installing Python packages...\n" >&2 + fi +fi diff --git a/programs-python b/programs-python index 1343952..bacbd19 100644 --- a/programs-python +++ b/programs-python @@ -1,3 +1,4 @@ animdl td-watson cppman +git+https://github.com/idanpa/calcpy diff --git a/src/.config/fish/aliases.fish b/src/.config/fish/aliases.fish index 8c46739..5fce061 100644 --- a/src/.config/fish/aliases.fish +++ b/src/.config/fish/aliases.fish @@ -3,8 +3,6 @@ function thur; zathura $argv; end # stricter sandbox zathura function zathsec; /usr/bin/zathura -c ~/.config/zathura-sec $argv; end -function calc; calcpy $argv; end - # tmux with 256-color function tmx; tmux -2 $argv; end @@ -42,7 +40,7 @@ function rem; $EDITOR ~/dox/not/rem; end function ldg; $EDITOR ~/dox/not/journal.ldg; end # pocket calculator -function calcpy; python3 ~/.local/bin/calcpy/calcpy_cli.py; end +function calc; calcpy $argv; end # disable history on units alias units='units -H ""' diff --git a/src/.local/bin/calcpy b/src/.local/bin/calcpy deleted file mode 160000 index 5ba2619..0000000 --- a/src/.local/bin/calcpy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5ba26197b7410f16581aa8966498553d7ca83b89