My build of nnn with minor changes
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

imgresize 771 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env sh
  2. # Description: Resize images in a directory to screen resolution with imgp
  3. # imgp homepage: https://github.com/jarun/imgp
  4. #
  5. # Notes:
  6. # 1. Set res if you don't want to be prompted for desktop resolution every time
  7. # 2. minsize is set to 1MB by default, adjust it if you want
  8. # 3. imgp options used:
  9. # a - adaptive mode
  10. # c - convert PNG to JPG
  11. # k - skip images matching specified hres/vres
  12. #
  13. # Shell: POSIX compliant
  14. # Author: Arun Prakash Jana
  15. # set resolution (e.g. 1920x1080)
  16. res=
  17. # set minimum image size (in bytes) to resize (default: 1MB)
  18. minsize=1048576
  19. if [ -z "$res" ]; then
  20. printf "desktop resolution (hxv): "
  21. read -r res
  22. fi
  23. if ! [ -z "$res" ] && ! [ -z "$minsize" ]; then
  24. imgp -ackx "$res" -s "$minsize"
  25. fi