Created
April 8, 2017 08:37
-
-
Save Jeansen/7323cde52c37049326f92218a76284c3 to your computer and use it in GitHub Desktop.
show and hide increase memory, too
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings FATAL => 'all'; | |
use 5.10.1; | |
use autodie; | |
use constant {GAUGE => '▪'}; | |
sub on_start { | |
my ($self) = @_; | |
my $rend = urxvt::OVERLAY_RSTYLE; | |
$rend = urxvt::SET_BGCOLOR $rend, 1; | |
$rend = urxvt::SET_FGCOLOR $rend, 255; | |
$self->{netOverlay} = $self->overlay ( -1, 0, 1, 1, $rend, 0 ); | |
$self->{netOverlay}->set ( 0, 0, GAUGE ); | |
$self->{net} = urxvt::timer | |
->new | |
->start ( 1 + int urxvt::NOW ) | |
->interval ( 1 ) | |
->cb ( sub { | |
for (1..1000) { | |
$self->{netOverlay}->hide; | |
$self->{netOverlay}->show; | |
} | |
} ); | |
() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment