• Short utility to monitorize continously your desktop

    From gamo@gamo@telecable.es to alt.os.linux.ubuntu on Sat Apr 10 19:51:23 2021
    From Newsgroup: alt.os.linux.ubuntu

    #!/usr/bin/perl -w

    while (1){
    @out = `sensors`;
    $cpu = `uptime`;
    $cpu =~ /load average: (\d+\,\d+)\,/; # first \, is spanish;
    # change to \. to english
    $cpuload = $1;
    for (@out){
    if (s/Package id 0:\s+\+/+/){
    s/C.+$/C/; # celsius, don't fuck that
    chomp;
    /(\d+)/;
    print " " x ($1-25), "$_ $cpuload\n";
    last;
    }
    }
    sleep 60;
    }

    __END__

    As usual, copy & paste & chmod +x filename

    --
    http://gamo.sdf-eu.org/
    perl -E 'say "Code could contain bugsh";'
    --- Synchronet 3.18a-Linux NewsLink 1.113