use warnings; use strict; =head1 NAME BarnOwl::Module::Install =head1 DESCRIPTION a BarnOwl plugin to make installing plugins ridiculously easy. I hope. bpchen, 2016/02/29 =cut package BarnOwl::Module::Install; use POSIX; use Time::Local; our $VERSION = 0.1; sub install { shift; my $name = shift; my $output = `athrun bpchen barnowl-install $name 2>&1`; my $exit_code = $? >> 8; if (!$exit_code) { $output =~ /:reload-module (\w+)/; BarnOwl::command('reload-module', $1); BarnOwl::popless_text("Success! (and module reloaded)\nOutput follows:\n\n" . $output); } else { BarnOwl::popless_text("Error (exit code $exit_code)!\nOutput follows:\n\n" . $output); } } BarnOwl::new_command(install => \&install, { summary => "Install a barnowl plugin magically??", usage => "install ZStatus", description => "Install a barnowl plugin magically??", }); 1;