mirror of
https://github.com/RustyRaptor/My-Dot-Files.git
synced 2026-12-04 00:05:17 -07:00
23 lines
337 B
Bash
23 lines
337 B
Bash
#!/bin/bash
|
|
|
|
shopt -s nullglob
|
|
|
|
if [[ ! -f $1 ]]; then
|
|
echo "$0: first argument is not a file" >&2
|
|
exit 1
|
|
fi
|
|
|
|
file=$(basename -- "$1")
|
|
dir=$(dirname -- "$1")
|
|
arr=()
|
|
shift
|
|
|
|
cd -- "$dir"
|
|
|
|
for i in *; do
|
|
[[ -f $i ]] || continue
|
|
arr+=("$i")
|
|
[[ $i == $file ]] && c=$((${#arr[@]} - 1))
|
|
done
|
|
|
|
exec feh "$@" -- "${arr[@]:c}" "${arr[@]:0:c}" |