Krolyxon
Commit ed7f69d

Branches

Refs →

aurora.configlfremage-pick

14 lines · 447 B · Bourne Again Shell (bash)

1#!/bin/sh
2# Run from lf (needs $id): remage ARGS..., then the images marked there (m) become lf's selection.
3# One file = remage opens its whole directory at that file; several = just those; -t DIR = the grid.
4
5marked=$(remage -o "$@" 2>/dev/null)
6[ -n "$marked" ] || exit 0
7
8files=""
9while IFS= read -r file; do
10 files="$files \"$(printf '%s' "$file" | sed 's/[\\"]/\\&/g')\""
11done <<EOF
12$marked
13EOF
14lf -remote "send $id :unselect; toggle$files"