I have a similar approach as well, except the command in config.h is simply
"dmenu.sh". This allows me to make whatever changes I desire to the script,
and it will always be called the same from dwm. The numbers would probably
show the following to be not optimal, but as long as I don't notice any
difference myself it is plenty fast enough.

(bash)

CHOICE=`cat << EOF | dmenu
EDIT MENU
Screenshot
aterm
gimp
blender
-irssi
-mutt
.bashrc
.xinitrc
EOF`

#pick_me() {
case ${CHOICE} in
EDIT\ MENU) aterm -e vim ${HOME}/scripts/dmenu.sh & ;;
screenshot|SS) import -pause 2 -window root -quality 90 
${HOME}/image/snap/`date +%y-%m%d-%H%M`-dwm.png & ;;
\.*) cd && aterm -e vim ${CHOICE} & ;; # Edit dotfiles
\-*) aterm -e ${CHOICE#\-} & ;; # Term apps
*) ${CHOICE} & ;; # Everything else (X executables)
esac
#}


>From Julian Romero, (05/10/06 11:27):
>  Hi,
>  I have a simpler approach (an oversimplification perhaps)
>  In config.h I have:
>  
>  dmenu.sh | dmenu
>  
>  and dmenu.sh is something like:
>  
>  #!/bin/sh
>  cat<<FIN | sort -u
>  firefox -P julian
>  centericq
>  muttng
>  [more commands here]
>  FIN
>  exit 0
>  
>  It's very fast and only requires a few minutes to think which programs
>  you usually use and in some cases writing a 3 line shell script to
>  avoid long commands in dmenu (for example to open centericq in a xterm
>  or opening a ssh connection, etc.)
>  
>  You can make it faster sorting command list while editing with vi 
>  (:motion!sort)
>  regards,
>  --
>  Julián

Reply via email to