Acpi

 view release on metacpan or  search on metacpan

Battery.pm  view on Meta::CPAN

use strict;

our $VERSION = '0.1';

my $rfield;

sub new{
	my($class) = shift;
	my($self) = {};

	bless($self,$class);

	$rfield = Acpi::Field->new; 
	return $self;
}

sub getBatteryInfo{
	my($self,$what) = @_;
	my(%value);
	my($i) = 0;
	my($numbatt) = $self->nbBattery;

Fan.pm  view on Meta::CPAN

use strict;

our $VERSION = '0.1';

my($rfield);

sub new{
	my($class) = shift;
	my($self) = {};

	bless($self,$class);
	
	$rfield = Acpi::Field->new;
	return $self;
}

sub getStatus{
	my($self) = shift;
	
	if($rfield->getValueField("/proc/acpi/fan/FAN/state","status") eq "on"){
		return 0;

Field.pm  view on Meta::CPAN

package Acpi::Field;
use strict;

our $VERSION = '0.1';

sub new{
	my($class) = shift;
	my($self) = {};

	bless($self,$class);

	return $self;
}

sub getValueField{
        my($self,$file,$field) = @_;
        my(@ligne,@ligne2);
 
        open(FILE,$file) || die "Impossible d'ouvrir $file : $!";

Temperature.pm  view on Meta::CPAN

use strict;

our $VERSION = '0.1';

my $rfield;

sub new{
	my($class) = shift;
	my($self) = {};

	bless($self,$class);
	
	$rfield = Acpi::Field->new;
	return $self;
}

sub getTemperature{
	my($self) = shift;
	my($temperature) = undef;

	$temperature = $rfield->getValueField("/proc/acpi/thermal_zone/THRM/temperature","temperature");



( run in 0.537 second using v1.01-cache-2.11-cpan-de7293f3b23 )