# Feh; Lightweight image viewer mkdir -p ~/.config/feh cat >> .config/feh/keys << EOF next_img Next prev_img Prior zoom_out minus zoom_in equal EOF mkdir -p ~/.local/share/applications cat >> ~/.local/share/applications/feh.desktop << EOF [Desktop Entry] Name=Feh GenericName=Image viewer Comment=Image viewer Exec=feh.sh Icon=image-viewer Type=Application StartupNotify=false NoDisplay=true Hidden=false Terminal=false Categories=Graphics;Viewer; MimeType=image/jpeg;image/png;image/gif;image/tiff;image/bmp;image/x-icon;image/x-xpixmap;image/x-xbitmap; EOF mkdir -p ~/.local/bin cat >> ~/.local/bin/feh.sh << EOF #!/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}" EOF