#!/bin/sh win="$1" if [ -n "$win" ]; then #if [ "$win" = "-" ]; then # read win #fi case "$win" in -) read win ;; /) grep="$2" win=`wmctrl -lp | grep "$grep"` ;; esac wmctrl -ia "$win" else wmctrl -lp fi