Perl/wecker.pl

From Linuxwiki
Jump to navigation Jump to search
#!/usr/bin/perl

# script for automagic pop-ups
# Usage: perl wecker.pl 'popup message'
# Depends: perl-tk

use strict;
use Tk;
use utf8;
use Encode qw(decode encode);

my $text = $ARGV[0];
my $message = decode('utf8', $text);
$message = 'Reminder' unless $text;

my $main = MainWindow->new;
$main -> Label(-text=>$message, -height=>"40", -width=>"80")->pack;
$main -> Button(-text=>'quit', -command=>'exit',)->pack;

MainLoop;