forked from mirror/nnn
plugins + keybind fix
This commit is contained in:
parent
94b349aab7
commit
38b1e9ba14
3 changed files with 15 additions and 9 deletions
8
plugins/celery
Executable file
8
plugins/celery
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
# rsyncs a file to celery.eu.org
|
||||
|
||||
name=$(printf "%s.%s" $(petname -w 3) ${1##*.})
|
||||
rsync -ahvrP4 $1 "celery.eu.org:content/unlist/$name"
|
||||
echo "unlisted $1 at https://celery.eu.org/unlist/$name"
|
||||
read _
|
|
@ -87,8 +87,8 @@ USE_PISTOL="${USE_PISTOL:-0}"
|
|||
ICONLOOKUP="${ICONLOOKUP:-0}"
|
||||
PAGER="${PAGER:-less -P?n -R}"
|
||||
TMPDIR="${TMPDIR:-/tmp}"
|
||||
BAT_STYLE="${BAT_STYLE:-numbers}"
|
||||
BAT_THEME="${BAT_THEME:-ansi}"
|
||||
BAT_STYLE="${BAT_STYLE:-full}"
|
||||
BAT_THEME="${BAT_THEME:-default}"
|
||||
# Consider setting NNN_PREVIEWDIR to $XDG_CACHE_HOME/nnn/previews if you want to keep previews on disk between reboots
|
||||
NNN_PREVIEWDIR="${NNN_PREVIEWDIR:-$TMPDIR/nnn/previews}"
|
||||
NNN_PREVIEWWIDTH="${NNN_PREVIEWWIDTH:-1920}"
|
||||
|
@ -382,17 +382,13 @@ generate_preview() {
|
|||
image_preview "$1" "$2" "$3"
|
||||
return
|
||||
fi ;;
|
||||
image) if exists convert; then
|
||||
convert "$3" -flatten -resize "$NNN_PREVIEWWIDTH"x"$NNN_PREVIEWHEIGHT"\> "$NNN_PREVIEWDIR/$3.jpg"
|
||||
else
|
||||
image_preview "$1" "$2" "$3" && return
|
||||
fi ;;
|
||||
image) image_preview "$1" "$2" "$3" && return ;;
|
||||
office) libreoffice --convert-to jpg "$3" --outdir "$NNN_PREVIEWDIR/${3%/*}"
|
||||
filename="$(printf "%s" "${3##*/}" | cut -d. -f1)"
|
||||
mv "$NNN_PREVIEWDIR/${3%/*}/$filename.jpg" "$NNN_PREVIEWDIR/$3.jpg" ;;
|
||||
pdf) pdftoppm -jpeg -f 1 -singlefile "$3" "$NNN_PREVIEWDIR/$3" ;;
|
||||
djvu) ddjvu -format=ppm -page=1 "$3" "$NNN_PREVIEWDIR/$3.jpg" ;;
|
||||
video) ffmpegthumbnailer -m -s0 -i "$3" -o "$NNN_PREVIEWDIR/$3.jpg" || rm "$NNN_PREVIEWDIR/$3.jpg" ;;
|
||||
video) ffmpeg -i "$3" -vf "select=eq(n\,0)" -vframes 1 "$NNN_PREVIEWDIR/$3.jpg" ;;
|
||||
esac
|
||||
fi
|
||||
if [ -f "$NNN_PREVIEWDIR/$3.jpg" ]; then
|
||||
|
@ -414,6 +410,8 @@ image_preview() {
|
|||
catimg "$3" &
|
||||
elif exists viu; then
|
||||
viu -t "$3" &
|
||||
elif exists chafa; then
|
||||
chafa "$3" &
|
||||
else
|
||||
fifo_pager print_bin_info "$3" && return
|
||||
fi
|
||||
|
|
|
@ -244,7 +244,7 @@ static struct key bindings[] = {
|
|||
{ 'o', SEL_OPENWITH },
|
||||
{ CONTROL('O'), SEL_OPENWITH },
|
||||
/* Create a new file */
|
||||
{ 'n', SEL_NEW },
|
||||
{ 'l', SEL_NEW },
|
||||
/* Show rename prompt */
|
||||
{ CONTROL('R'), SEL_RENAME },
|
||||
/* Rename contents of current dir */
|
||||
|
|
Loading…
Reference in a new issue