Skip to content

Instantly share code, notes, and snippets.

@Xliff
Created September 12, 2019 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xliff/74eac079c1380a00fe08861b610507f1 to your computer and use it in GitHub Desktop.
Save Xliff/74eac079c1380a00fe08861b610507f1 to your computer and use it in GitHub Desktop.
Monitoring temps with Perl6

Here's a quick script:

$*SCHEDULER.cue({ 
  my $so = qx{sensors}; 
  my $m = $so ~~ m:g/^^ Core \s \d+\: \s* \+(\d+)/; 
  $m.Array.map( *[0] ).gist.say; 
}, every => 1); 
sleep 10;

Unfortunately, you need the lm-sensors package, and the sleep command at the end. If someone has a solution with less processor impact, then I'm all ears.

Will turn this into a GUI, soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment