#!/bin/bash
#########################################################
#                                                       #
#  Switch app to other monitor.                         #
#  Depends on: xdotool                                  #
#                                                       #
#  Shift+Super+Up    = is monitor above                 #
#  Shift+Super+Down  = is monitor below                 #
#                                                       #
#  Koentje    (remon@cobrasoft.nl)                      #
#                                         version 1.1   #
#########################################################

# Start app in background
gnome-system-monitor &

# Wait until apps windowname apears in wmctrl list
while [ "$(wmctrl -l | grep 'System Monitor')" = "" ]; do
  echo "Waiting..." > /dev/null
done

# Send keystroke to windowID of app
xdotool key --window $(wmctrl -l | grep 'System Monitor' | awk '{print $1}') Shift+Super+Up
