#!/bin/sh -e file=$(find . -type f | dmenu -i -l 30 -m 0) bsdsetsid emacsclient -c "$file" kill -9 "$(ps -p $$ -oppid=)" exit