#!/bin/sh # sel - raise and focus a window by name ID=$(xdotool search --onlyvisible --class "$1" 2>/dev/null) if [ "$?" = 0 ] ; then ID=$(echo "$ID" | head -1) xdotool windowraise $ID xdotool windowfocus $ID xdotool mousemove $(xwininfo -id $ID -stats | awk '/Absolute/ {print $4 + 50}') else exit $? fi