#!/usr/bin/perl #----------------------------------------------------------------------# # X11::GUITest (kphone_reject.pl; v1.0, 23 January 2007) # Notes: Automatically reject kphone calls by pressing the Reject # button on the incoming call dialog # # KDE 3.5 with prevent focus stealing disabled # KPhone version 4.2.2 # X11-GUITest 0.21 #----------------------------------------------------------------------# use strict; use warnings; use X11::GUITest qw/ WaitWindowViewable SendKeys SetEventSendDelay SetKeySendDelay /; my $MainWin = 0; print "$0: Script start.\n"; # Slow event sending down a little for when X server # is busy with this and other bigger applications SetEventSendDelay(50); SetKeySendDelay(50); # Wait at most 120 seconds for it to come up ($MainWin) = WaitWindowViewable('Incoming', undef, 120) or die('Could not find incoming call window!'); print "Incoming call received, rejecting call...\n"; SendKeys('{SPC}'); print "$0: Script end (success).\n";