#!/usr/bin/perl -w # # Fast-Slow very much code stolen from: # # wmsensors.pl-0.1 by Karsten Eiser ©2003 # # # use strict; use Wharf::JDockApp; use Getopt::Long; #___________________ setup ________________________________# my $help = 0; my $seconds = 10; my $speed_set = 1; my $speed_val = 0; my $slow_script = "/root/slow.sh"; my $fast_script = "/root/fast.sh"; my $slow_val = "612MHz"; my $fast_val = "999MHz"; GetOptions( "delay=i" => \$seconds, "slow=s" => \$slow_script, "fast=s" => \$fast_script, "slowval=s" => \$slow_val, "fastval=s" => \$fast_val, "help" => \$help ) or exit &usage; #_________________________ the program ____________________# exit &usage if $help == 1; # $speed = 1: slow ; $speed = 2: fast my $speed = 1; SetSetup( sub { SetDelay($seconds) } ); SetUpdate( \&update ); SetExpose( \&update ); # Switch between the two speed SetButton( sub { $speed++; $speed = 1 if $speed > 2; $speed_set = 0; &update; } ); StartApp; #_____________________________________ subs _______________# sub usage { print < --fast