#!/bin/sh xdotool set_window --class "$2" $(xdotool search --pid $1) # command chaining doesnt work for some reason #xdotool getactivewindow set_window --class "$1" #[ -z "$2" ] && echo -n "\e]0;$2\a"