#Km91#@sh.itjust.works to linuxmemes@lemmy.world · 2 days agoRulesh.itjust.worksimagemessage-square126fedilinkarrow-up1463
arrow-up1463imageRulesh.itjust.works#Km91#@sh.itjust.works to linuxmemes@lemmy.world · 2 days agomessage-square126fedilink
minus-squarecanaryWart@programming.devlinkfedilinkarrow-up1·4 hours agoI use an fzf based script that queries for updates and lets me choose what to install. If you use xbps, or are just curious: ::: xu #!/bin/env sh self=“$(basename “$0”)” error() { printf ‘%s:’ “$self” >&2 # shellcheck disable=SC2068 printf ’ %s’ $@ >&2 printf ‘\n’ >&2 } fatal() { error “$@” exit 1 } if [ -x “$(command -v sk)” ]; then finder=sk elif [ -x “$(command -v fzf)” ]; then finder=fzf else echo “neither fzf or sk are installed” >&2 exit 1 fi tmp=“$(mktemp)” || fatal “couldn’t source bindings” grep ‘^export’ “$DOTFILES/.zshenv” | grep -E ‘FZF|SKIM’ >“$tmp” . “$tmp” rm “$tmp” shellcheck disable=SC2046 choices=“$(xbps-install -nSu | cut -f1 -d’ ’ | sed ‘s/-[^-]*$//g’ | $finder | tr ‘\n’ ’ ')” [ -n “$choices” ] || exit guard=pkexec command -v “$guard” >/dev/null 2>/dev/null || guard=sudo shellcheck disable=SC2086 while ! $guard xbps-install -Syu $choices; do :; done :::
I use an fzf based script that queries for updates and lets me choose what to install.
If you use xbps, or are just curious:
::: xu #!/bin/env sh
self=“$(basename “$0”)”
error() { printf ‘%s:’ “$self” >&2 # shellcheck disable=SC2068 printf ’ %s’ $@ >&2 printf ‘\n’ >&2 }
fatal() { error “$@” exit 1 }
if [ -x “$(command -v sk)” ]; then finder=sk elif [ -x “$(command -v fzf)” ]; then finder=fzf else echo “neither fzf or sk are installed” >&2 exit 1 fi
tmp=“$(mktemp)” || fatal “couldn’t source bindings” grep ‘^export’ “$DOTFILES/.zshenv” | grep -E ‘FZF|SKIM’ >“$tmp” . “$tmp” rm “$tmp”
shellcheck disable=SC2046
choices=“$(xbps-install -nSu | cut -f1 -d’ ’ | sed ‘s/-[^-]*$//g’ | $finder | tr ‘\n’ ’ ')”
[ -n “$choices” ] || exit
guard=pkexec command -v “$guard” >/dev/null 2>/dev/null || guard=sudo
shellcheck disable=SC2086
while ! $guard xbps-install -Syu $choices; do :; done
:::