#!/bin/bash

display=
while true; do
  if [ "$1" != "--to" ]; then
    if shift; then
      continue;
    else
      break
    fi
  else
    if shift; then
      display=$1
    fi
    break
  fi
done

if [ $display ]; then
  kill -HUP $(cat /var/gdm/$display.pid)
fi

