/usr/share/doc/libarch-perl/examples/arch-run-demo-2 is in libarch-perl 0.5.2-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #!/usr/bin/perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../perllib";
use Gtk2 -init;
use Glib qw(TRUE FALSE);
use Arch::Run qw(poll run_async LINES);
# use "/usr/share/doc/*" on slow disks
my @dirs = @ARGV ? @ARGV : glob('/usr/share/*');
my $window = Gtk2::Window->new;
my $label = Gtk2::Label->new("no du output yet");
my $pbar = Gtk2::ProgressBar->new;
my $vbox = Gtk2::VBox->new;
$vbox->add($label); $vbox->add($pbar); $window->add($vbox);
$window->signal_connect(destroy => sub { Gtk2->main_quit; });
$window->set_default_size(200, 48); $window->show_all;
sub set_str { $label->set_text($_[0]); }
my $keep = 1;
Glib::Timeout->add(100, sub { $pbar->pulse; poll(0); $keep; });
run_async(
command => [ 'du', '-hs', @dirs ],
mode => LINES,
datacb => sub { chomp(my $str = $_[0]); set_str($str); },
exitcb => sub { $keep = 0; set_str("exit code: $_[0]"); },
);
Gtk2->main;
|