1 2 3 4
#!/bin/sh WINDOWID=${1:-$(xdotool getwindowfocus)} WIDTH=$(xdotool getwindowgeometry -s ${WINDOWID} | grep WIDTH | cut -d ' ' -f 2) dmenu_run -w ${1:-$(xdotool getwindowfocus)} -c