#!/bin/bash
#
# Usage: startremmina.sh <password>

/usr/bin/remmina -c $HOME/.maussk.remmina &
sleep 0.5
winid=$(xdotool search --name 'Verbindung zu')
if [ -z "$winid"]; then
  sleep 1
  winid=$(xdotool search --name 'Client-')
fi
if [ -z "$winid"]; then
  sleep 1
  winid=$(xdotool search --name 'Client-')
fi
/usr/bin/xdotool windowactivate --sync $winid type $1
/usr/bin/xdotool windowactivate --sync $winid key Return

exit 0
