dotinstall now installs Python programs

This commit is contained in:
dogeystamp 2023-09-04 12:31:42 -04:00
parent fc78597525
commit d9fd7d45bb
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
4 changed files with 19 additions and 6 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Symlink dotfiles into the home directory # Installs dotfiles and Python packages
set -e set -e
@ -8,24 +8,27 @@ SCRIPT_NAME="$(basename $0)"
# Default source for dotfiles # Default source for dotfiles
SRCFOLDER="$(dirname "$0")/src/" SRCFOLDER="$(dirname "$0")/src/"
PYREQS="$(realpath "$(dirname "$0")/programs-python")"
DESTFOLDER="$HOME" DESTFOLDER="$HOME"
# Allow overwriting of outdated files # Allow overwriting of outdated files
FORCE="N" FORCE="N"
VERBOSE="N" VERBOSE="N"
INSTALL_PYTHON="N"
display_help () { display_help () {
cat >&2 <<EOF cat >&2 <<EOF
usage: $SCRIPT_NAME [-h] [-v] [-f] [-s PATH] [-d PATH] usage: $SCRIPT_NAME [-h] [-v] [-f] [-s PATH] [-d PATH]
-h: display help -h: display help
-f: allow overwriting existing dotfiles -f: allow overwriting existing dotfiles
-p: installs python packages via pipx
-v: print modified files -v: print modified files
-s: path to source of dotfiles -s: path to source of dotfiles
-d: path to destination where dotfiles are linked from -d: path to destination where dotfiles are linked from
EOF EOF
} }
while getopts "fvhs:d:" o; do while getopts "fvphs:d:" o; do
case "$o" in case "$o" in
h) h)
display_help display_help
@ -33,6 +36,7 @@ while getopts "fvhs:d:" o; do
;; ;;
f) FORCE="Y" ;; f) FORCE="Y" ;;
v) VERBOSE="Y" ;; v) VERBOSE="Y" ;;
p) INSTALL_PYTHON="Y" ;;
s) s)
DESTFOLDER="$OPTARG" DESTFOLDER="$OPTARG"
;; ;;
@ -92,3 +96,14 @@ for f in $(find -type f); do
link "$SRC" "$DEST" link "$SRC" "$DEST"
fi fi
done done
printf "Symlinked dotfiles.\n" >&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

View File

@ -1,3 +1,4 @@
animdl animdl
td-watson td-watson
cppman cppman
git+https://github.com/idanpa/calcpy

View File

@ -3,8 +3,6 @@ function thur; zathura $argv; end
# stricter sandbox zathura # stricter sandbox zathura
function zathsec; /usr/bin/zathura -c ~/.config/zathura-sec $argv; end function zathsec; /usr/bin/zathura -c ~/.config/zathura-sec $argv; end
function calc; calcpy $argv; end
# tmux with 256-color # tmux with 256-color
function tmx; tmux -2 $argv; end 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 function ldg; $EDITOR ~/dox/not/journal.ldg; end
# pocket calculator # pocket calculator
function calcpy; python3 ~/.local/bin/calcpy/calcpy_cli.py; end function calc; calcpy $argv; end
# disable history on units # disable history on units
alias units='units -H ""' alias units='units -H ""'

@ -1 +0,0 @@
Subproject commit 5ba26197b7410f16581aa8966498553d7ca83b89