From ad8fb53cddbc1e24bca61359e976abecf2d373b3 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Wed, 28 Sep 2022 11:04:40 -0700 Subject: [PATCH] Add "newunix" utils --- main-cookbook | 29 ++++++++++++------- recipes/default/newunix | 62 ++++++++++++++++++++++++++++++++++++++++ recipes/default/packages | 2 -- 3 files changed, 81 insertions(+), 12 deletions(-) create mode 100755 recipes/default/newunix diff --git a/main-cookbook b/main-cookbook index 2617d5f..e15cdac 100755 --- a/main-cookbook +++ b/main-cookbook @@ -18,26 +18,26 @@ init_paths_and_vars # Do prompting early to make longer install easier install_packages=false -if ! is_installed "packages" || prompt_yn "Reinstall packages?" ; then +if ! is_installed 'packages' || prompt_yn 'Reinstall packages?' ; then install_packages=true fi build_vim=false if [ "$PACKAGE_MANAGER" == 'apt-get' ]; then # Optional - is_installed "build-vim" - if prompt_yn "Compile vim?" ; then + is_installed 'build-vim' + if prompt_yn 'Compile vim?' ; then build_vim=true fi fi build_neovim=false -if ! command_exist 'nvim' && prompt_yn "Build Neovim?" ; then +if ! command_exist 'nvim' && prompt_yn 'Build Neovim?' ; then build_neovim=true fi install_rustup=false -if ! command_exist 'rustup' && prompt_yn "Install rustup?" ; then +if ! command_exist 'rustup' && prompt_yn 'Install rustup?' ; then install_rustup=true fi @@ -48,14 +48,23 @@ install_sfdc=false # fi install_ui_terms=false -if ! is_installed "ui_terms" && prompt_yn "Install UI terminals?" ; then +if ! is_installed 'ui_terms' && prompt_yn 'Install UI terminals?' ; then install_ui_terms=true fi +install_newunix=false +if ! is_installed 'newunix' && prompt_yn 'Install "new unix" utils (eg. dust, dog, duf)?' ; then + install_newunix=true +fi + ### Run recipes if $install_packages ; then recipe 'packages' - set_installed "packages" + set_installed 'packages' +fi +if $install_newunix ; then + recipe 'newunix' + set_installed 'new_unix' fi recipe 'dotfiles' @@ -71,7 +80,7 @@ recipe 'fish' if $install_ui_terms ; then recipe 'alacritty' recipe 'kitty' - set_installed "ui_terms" + set_installed 'ui_terms' fi git submodule init @@ -84,12 +93,12 @@ fi if $build_vim ; then recipe 'build-vim' - set_installed "build-vim" + set_installed 'build-vim' fi if $build_neovim ; then recipe 'build-neovim' - set_installed "neovim" + set_installed 'neovim' fi if $install_sfdc ; then diff --git a/recipes/default/newunix b/recipes/default/newunix new file mode 100755 index 0000000..9c60371 --- /dev/null +++ b/recipes/default/newunix @@ -0,0 +1,62 @@ +#! /bin/bash + +pip3 install --user padio release-gitter + +sudo_package_update + +# duf: https://github.com/muesli/duf +sudo_package "duf" + +# dog: https://github.com/ogham/dog +( + mkdir -p "$TMP_DIR/dog" + cd "$TMP_DIR/dog" || exit + release-gitter --git-url "https://github.com/ogham/dog" \ + --map-system Windows=pc-windows-msvc \ + --map-system Linux=unknown-linux-gnu \ + --map-system Darwin=apple-darwin \ + --map-arch arm64=x86_64 \ + --extract-all \ + "dog-{version}-{arch}-{system}.zip" + + mkdir -p ~/.local/bin && mv bin/dog ~/.local/bin/ + chmod +x ~/.local/bin/dog + mkdir -p ~/.local/share/man/man1 && mv man/dog.1 ~/.local/share/man/man1/ + mv completions/dog.fish ~/.config/fish/completions/ +) + +## What do do with this? +# completions/dog.bash +# completions/dog.zsh +# completions/dog.fish +# man/dog.1 +# bin/dog + + +# dust: https://github.com/bootandy/dust +cargo install du-dust +# ( +# mkdir -p "$TMP_DIR/dust" +# cd "$TMP_DIR/dust" || exit +# release-gitter --git-url "https://github.com/bootandy/dust" \ +# --map-system Windows=pc-windows-msvc \ +# --map-system Linux=unknown-linux-gnu \ +# --map-system Darwin=apple-darwin \ +# "dust-{version}-{arch}-{system}.tar.gz" +# ) + +# Manager specific packages +case "$PACKAGE_MANAGER" in + "port") + sudo_package lsd + ;; + "apt-get") + # Linux deb download. Maybe lsd-musl + release-gitter --git-url "https://github.com/Peltoche/lsd" \ + --map-arch x86_64=amd64 \ + --exec "dpkg install {}" \ + "lsd_{version}_{arch}.deb" + ;; + "apk") + ;; +esac diff --git a/recipes/default/packages b/recipes/default/packages index 6567260..ebf4731 100755 --- a/recipes/default/packages +++ b/recipes/default/packages @@ -12,8 +12,6 @@ sudo_package_update packages="fish bash" # Common shell utils packages="$packages tmux htop curl wget pv jq mosh bash-completion ripgrep" -# New unix -packages="$packages duf" # Development tools packages="$packages neovim vim tig doxygen shellcheck"