dotinstall now installs Python programs
This commit is contained in:
parent
fc78597525
commit
d9fd7d45bb
@ -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 <<EOF
|
||||
usage: $SCRIPT_NAME [-h] [-v] [-f] [-s PATH] [-d PATH]
|
||||
-h: display help
|
||||
-f: allow overwriting existing dotfiles
|
||||
-p: installs python packages via pipx
|
||||
-v: print modified files
|
||||
-s: path to source of dotfiles
|
||||
-d: path to destination where dotfiles are linked from
|
||||
EOF
|
||||
}
|
||||
|
||||
while getopts "fvhs:d:" o; do
|
||||
while getopts "fvphs:d:" o; do
|
||||
case "$o" in
|
||||
h)
|
||||
display_help
|
||||
@ -33,6 +36,7 @@ while getopts "fvhs:d:" o; do
|
||||
;;
|
||||
f) FORCE="Y" ;;
|
||||
v) VERBOSE="Y" ;;
|
||||
p) INSTALL_PYTHON="Y" ;;
|
||||
s)
|
||||
DESTFOLDER="$OPTARG"
|
||||
;;
|
||||
@ -92,3 +96,14 @@ for f in $(find -type f); do
|
||||
link "$SRC" "$DEST"
|
||||
fi
|
||||
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
|
||||
|
@ -1,3 +1,4 @@
|
||||
animdl
|
||||
td-watson
|
||||
cppman
|
||||
git+https://github.com/idanpa/calcpy
|
||||
|
@ -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 ""'
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit 5ba26197b7410f16581aa8966498553d7ca83b89
|
Loading…
Reference in New Issue
Block a user