Notify::Ejectをちといじった

そういや、手元のマシンにはCD-ROMとCD-RWドライブがついていたので、ガコンガコンいわせてみたす。

package Plagger::Plugin::Notify::Eject::linux;
use base qw( Plagger::Plugin::Notify::Eject );

use strict;

sub eject {
    my($self, $context, $args) = @_;

    my $device = $self->conf->{device} || [undef];
    my $repeat = $self->conf->{repeat} || 1;

    while ($repeat-- > 0) {
        foreach my $o (undef, '-t') {
            foreach my $d (@{$device}) {
                system grep {$_} 'eject', $o, $d;
            }
            last if (not $o and $repeat <= 0);
        }
    }
}

1;
  - module: Notify::Eject
    config:
      device:
        - /dev/hdc
        - /dev/hdd
      repeat: 3

ガコンガコンするようすはNotify::Eject two drivesで。
携帯で撮ったので、時間切れで1セットしかガコンしてませんが、ほんとは合計3セットツードライブでガコンガコンします。

はてなGoogle Videoをembedできるのかな?)