#!/bin/sh [ -d "$1" ] && cd "$1" while true; do choice=$(find . -maxdepth 1 -mindepth 1 -not -name '.*' -printf '%y\t%f\n' | sort -k 1 -k 2 | cut -f 2- | dmenu -x -c -i -p "$(pwd)") [ "$choice" ] || break [ -e "$choice" ] || continue if [ -d "$choice" ]; then cd "$choice" || continue else setsid xdg-open "$choice" & exit fi done