config: script adjustments

This commit is contained in:
xeruf 2021-12-20 18:34:03 +01:00
parent c7d5702f89
commit c260be09d0
6 changed files with 7 additions and 4 deletions

View File

@ -36,9 +36,9 @@ yas() {
)
if test -n "$pkg"
then echo "Installing $pkg..."
cmd="yay -S $pkg"
cmd="yay -Sy $pkg"
print -s "$cmd"
eval "$cmd" || yay -Sy $pkg
eval "$cmd"
rehash
fi
}

View File

@ -17,7 +17,7 @@ no_retry = true
#run_in_tmux = true
# List of remote machines with Topgrade installed on them
remote_topgrades = ["tiger"]
#remote_topgrades = ["tiger"]
# Arguments to pass SSH when upgrading remote systems
#ssh_arguments = "-o ConnectTimeout=2"

View File

@ -54,6 +54,7 @@ for arg; do
test -f "$tmpfile-1.png" || pdftoppm -r 70 "$arg" "$tmpfile" -l $(expr $grid '*' 2)
timg -W --grid=$grid "$tmpfile"*
;;
(*/x-xcf*) ;;
(*\ video/*)
suffix=_thumbs.jpg
mtn -i -t -W -r2 -D6 -b 0,6 -c $grid -w $(expr $(tput cols) '*' 20) \

View File

@ -12,6 +12,7 @@ case $1 in
(gh|chordpro|bat) unbuffer "$@" --help | $paginate;;
(plantuml) unbuffer "$@" -help | $paginate;;
(caddy|stretchly|go) "$1" help "${@:2}" | $paginate;;
(kdeconnect*) kdeconnect-cli --help-all "${@:2}" | $paginate;;
(*) man "$@" ||
{ info "$1" -w | grep -v "manpages" && pinfo "$@"; } ||
if which "$1" >/dev/null; then "$@" --help; "$@" -help 2>&1 | $paginate; fi;;

View File

@ -3,5 +3,6 @@ kdeconnect-cli --refresh
if ! test -f "$1"; then echo "Please specify a file to share" && exit 1; fi
file="$1"
device="$(kdeconnect-cli --list-available 2>/dev/null | fzf -0 -1 | cut -d' ' -f3)"
test -z "$device" && kdeconnect-cli --list-devices && echo "No device available!" && exit 1
shift
kdeconnect-cli "--share=$file" -d "$device" "$@"

View File

@ -13,5 +13,5 @@ test $# -eq 0 && echo "Usage: $0 [-q quality (default 85)] [-o outfile] <images.
magick "$@" -auto-orient -strip -interlace Plane -define jpeg:dct-method=float -sampling-factor 4:2:0 -gaussian-blur 0.05 \
-quality "${quality:-85}" "$out"
printf "Shrinked $1(%s) to $out(%s) - reduced to %s%%\n" \
$(stat --format "%s" IMG_20211124_115930.jpg IMG_20211124_115930.jpg-shrinked.jpg | numfmt --to=iec-i --suffix=B) \
$(stat --format %s "$1" "$out" | numfmt --to=iec-i --suffix=B) \
$(stat --format %s "$out" "$1" | sed 'N;s|\n|*100/|' | bc)