mirror of
https://github.com/hydroxycarbamide/dotfiles.git
synced 2025-05-07 13:29:08 -04:00
Add nnn
This commit is contained in:
parent
0ef5de12ac
commit
c0889285ff
58 changed files with 5175 additions and 0 deletions
31
dot_config/nnn/plugins/executable_imgresize
Normal file
31
dot_config/nnn/plugins/executable_imgresize
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# Description: Resize images in a directory to screen resolution with imgp
|
||||
#
|
||||
# Dependencipes: imgp - https://github.com/jarun/imgp
|
||||
#
|
||||
# Notes:
|
||||
# 1. Set res to avoid the desktop resolution prompt each time
|
||||
# 2. MINSIZE is set to 1MB by default, adjust it if you want
|
||||
# 3. imgp options used:
|
||||
# a - adaptive mode
|
||||
# c - convert PNG to JPG
|
||||
# k - skip images matching specified hres/vres
|
||||
#
|
||||
# Shell: POSIX compliant
|
||||
# Author: Arun Prakash Jana
|
||||
|
||||
# set resolution (e.g. 1920x1080)
|
||||
res="${RESOLUTION}"
|
||||
|
||||
# set minimum image size (in bytes) to resize (default: 1MB)
|
||||
MINSIZE="${MINSIZE:-1048576}"
|
||||
|
||||
if [ -z "$res" ]; then
|
||||
printf "desktop resolution (hxv): "
|
||||
read -r res
|
||||
fi
|
||||
|
||||
if [ -n "$res" ] && [ -n "$MINSIZE" ]; then
|
||||
imgp -ackx "$res" -s "$MINSIZE"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue