diff --git a/commands/setup-util-bottom b/commands/setup-util-bottom index fbfd167ef..6cbf4371a 100755 --- a/commands/setup-util-bottom +++ b/commands/setup-util-bottom @@ -2,10 +2,53 @@ source "$DOROTHY/sources/strict.bash" # https://github.com/ClementTsang/bottom +# https://github.com/ClementTsang/bottom/releases # top alternative +# bottom_0.6.8_amd64.deb +# bottom_aarch64-unknown-linux-gnu.tar.gz +# bottom_armv7-unknown-linux-gnueabihf.tar.gz +# bottom_i686-pc-windows-msvc.zip +# bottom_i686-unknown-linux-gnu.tar.gz +# bottom_i686-unknown-linux-musl.tar.gz +# bottom_powerpc64le-unknown-linux-gnu.tar.gz +# bottom_riscv64gc-unknown-linux-gnu.tar.gz +# bottom_x86_64-apple-darwin.tar.gz +# bottom_x86_64-pc-windows-gnu.zip +# bottom_x86_64-pc-windows-msvc.zip +# bottom_x86_64-unknown-linux-gnu.tar.gz +# bottom_x86_64-unknown-linux-gnu2-17.tar.gz +# bottom_x86_64-unknown-linux-musl.tar.gz +# bottom_x86_64_installer.msi + function setup-util-bottom() ( + # determine github args if github is an option on this platform + local arch github_asset_filter='' github=() + arch="$(get-arch)" + if is-mac; then + github_asset_filter='_x86_64-apple-darwin' + elif test "$arch" = 'a64'; then + github_asset_filter='_aarch64-unknown-linux-gnu' + elif test "$arch" = 'a32'; then + github_asset_filter='_armv7-unknown-linux-gnu' + elif test "$arch" = 'x64'; then + github_asset_filter='_x86_64-unknown-linux-musl' + elif test "$arch" = 'x32'; then + github_asset_filter='_i686-unknown-linux-musl' + fi + if test -n "$github_asset_filter"; then + github+=( + GITHUB_SLUG='ClementTsang/bottom' + GITHUB_RELEASE='latest' + GITHUB_ASSET_FILTER="$github_asset_filter" + GITHUB_UNZIP_FILTER='**/btm' + GITHUB_FILENAME='btm' + ) + fi + + # install, preferring github setup-util "$@" --name='bottom' --cli='btm' \ + "${github[@]}" \ AUR='bottom-bin' \ BREW='bottom' \ CARGO='bottom' \ @@ -20,7 +63,8 @@ function setup-util-bottom() ( sudo eselect repository enable guru sudo emerge --sync guru echo "sys-process/bottom" | sudo tee /etc/portage/package.accept_keywords/10-guru - sudo emerge sys-process/bottom::guru' + sudo emerge sys-process/bottom::guru' \ + -- github ... ) # fire if invoked standalone