#!/bin/bash query=$@ #Prompt user if no query given [ -z "$query" ] && query=$(printf "" | dmenu -p "Locate:") #exit if input is empty [ -z "$query" ] && exit 1 file="$(dmenu -l 20 < <(locate ${query}))" && $TERMINAL -e $FILE "$file"