Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -eq 0 ]; then
- echo "Usage: ${0##*/} PICTURES"
- exit
- fi
- [ "$1" = '--' ] && shift
- abspath () {
- case "$1" in
- /*) printf "%s\n" "$1";;
- *) printf "%s\n" "$PWD/$1";;
- esac
- }
- listfiles () {
- find -L "$(dirname "$target")" -maxdepth 1 -type f -print0 | sort -z
- }
- target="$(abspath "$1")"
- count="$(listfiles | grep -m 1 -ZznF "$target" | cut -d: -f1)"
- if [ -n "$count" ]; then
- sxiv -t -A 12 -q -p "$PWD" -n "$count" -o -- > /tmp/sxiv-marked
- python3 ~/.bin/add_item_gtk3.py
- else
- sxiv -- "$@" # fallback
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement