#!/usr/bin/env perl use v5.36; use strict; use X11::GUITest qw[GetMousePos MoveMouseAbs ClickMouseButton :CONST]; use Imager::Screenshot qw[screenshot]; use Carp; use Time::HiRes qw(sleep); use IO::Socket::UNIX; my $keepRunning = 1; $SIG{CHLD} = sub { print "Child exit!\n"; $keepRunning = 0; }; ################# TUNEABLES ############# my $w = 1920; # Screen width my $h = 1080; # Screen height my $thingmakerx = 55; # leftmost X position of "Thing maker" list my $idealisterx = 1380; # leftmost X position of "Idea lister" list my $liststarty = 490; # Top Y of lists my $listendy = 1048; # Bottom Y of lists my $buttonx = 186; # Power button thingy X my $buttony = 369; # Power button thingy Y my $socketpath = 'clicker.socket'; ################# TUNEABLES ############# my $lastx = -1; my $lasty = -1; unlink $socketpath; my $childpid = fork(); if(!defined($childpid)) { croak("Fork failed"); } if($childpid) { # Parent MouseClicker(); } else { ScreenLooker(); } exit(0);