X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=.zsh_functions;h=5e443340f3f6e3fe48e98302d1c72fe17893b85c;hb=82cf852dfc3a1b37af376fcfac9606b287e3a3f0;hp=1e456e6eb2fa5a06751c117f904bed4697292190;hpb=625e628262ea31b8ce705745ae2d4e998508812e;p=user%2Fhenk%2Fvcsh%2Fzsh.git diff --git a/.zsh_functions b/.zsh_functions index 1e456e6..5e44334 100644 --- a/.zsh_functions +++ b/.zsh_functions @@ -60,13 +60,26 @@ function henkspngpostproc () { local img resize_by="$1" shift + echo "Creating Directories …" + mkdir --parents resized/pngnqed/optipnged optimized for img in $* do - mkdir -p resized/pngnqed/optipnged - convert -resize $resize_by% $img resized/$img - pngnq -f -d resized/pngnqed -e .png resized/$img - optipng -out resized/pngnqed/optipnged/$img resized/pngnqed/$img + echo "Resizing image …" + convert -resize $resize_by% "$img" "resized/$img" + echo "Running pngnq …" + pngnq -s1 -f -d "resized/pngnqed" -e .png "resized/$img" + echo "Running optipng …" + optipng -force -out "resized/pngnqed/optipnged/$img" "resized/pngnqed/$img" + echo "Moving final image to directory 'optimized' …" + cp --verbose --interactive --target-directory=optimized/ "resized/pngnqed/optipnged/$img" + echo "Removing temporary images …" + #rm --verbose --interactive \ + rm --verbose \ + "resized/$img" \ + "resized/pngnqed/$img" \ + "resized/pngnqed/optipnged/$img" done + rmdir --parents resized/pngnqed/optipnged } function with () { @@ -77,3 +90,18 @@ function with () { vared str && eval $str done } + +function stardewpause () { + while read bar + do + xdotool \ + search --class 'StardewValley' \ + windowactivate --sync \ + type --delay 100 t/pause + done +} + +function henkpwgen () { + echo $( (tr -cd '[:alnum:]' | head -c $1) < /dev/urandom) +} +