Skip to content

Instantly share code, notes, and snippets.

@DerGuteMoritz
Created April 22, 2009 10:02
Show Gist options
  • Save DerGuteMoritz/99692 to your computer and use it in GitHub Desktop.
Save DerGuteMoritz/99692 to your computer and use it in GitHub Desktop.
(define-key *top-map* (kbd "H-p") "exec-dmenu")
(defcommand exec-dmenu () ()
(run-shell-command "sh -c \"$(proglist | dmenu -b -fn '-*-terminus-medium-r-normal--12-*-*-*-*-*-iso8859-1' -nf '#E4D49D' -nb '#000000' -sf '#000000' -sb '#E4D49D')\""))
#!/bin/bash
cache=/tmp/proglist
if [ "$1" = "reset" -o ! -e "$cache" ]; then
ls -lL $(echo "$PATH" | sed 'y/:/ /') 2>/dev/null \
| awk '$1 ~ /^[^d].*x/ { print $NF }' \
| sort | uniq > $cache
fi
[ "$1" = "reset" ] && exit
cat "$cache"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment