Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # el-notify-0.3
- # dependencies:
- # dev-perl/File-Tail
- # Homepage: http://search.cpan.org/~mgrabnar/
- # Description: Perl extension for reading from
- # continously updated files
- use warnings;
- use strict;
- use File::Tail;
- # TU OCZYWIŚCIE WŁAŚCIWA LOKALIZACJA PLIKÓW!
- my $server_log = "$ENV{ HOME }/.elc/main/srv_log.txt";
- my $chat_log = "$ENV{ HOME }/.elc/main/chat_log.txt";
- my $srv_logfile = File::Tail->new( name => $server_log,
- maxinterval => 1,
- adjustafter => 7,
- );
- while ( defined( $_ = $srv_logfile->read ) ) {
- print;
- # Harvest event!
- if ( /You stopped harvesting/ ) {
- # `notify-send -i info "Się przestało harvić się!" "Nie gap się tylko idź tam i kliknij co trzeba!"`;
- `play /usr/share/sounds/freedesktop/stereo/message-new-instant.oga 2> /dev/drzewo`;
- }
- # Inwazja
- `notify-send -u critical -t 0 "Inwazja!" "Tu się nie ma nad czym zastanawiać, tu trzeba spierdalać!\n$_"`
- if ( /GIWS: Invasion (Advanced )?Warning!!!/ );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement