File: clock.pl

package info (click to toggle)
emacspeak 53.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 33,740 kB
  • sloc: lisp: 56,394; xml: 52,463; tcl: 1,333; cpp: 1,168; sh: 859; makefile: 739; python: 547; perl: 509; javascript: 191; ansic: 82
file content (28 lines) | stat: -rwxr-xr-x 982 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/perl -w #chime the time

use strict;
$ENV{LADSPA_PATH} = "/usr/lib/ladspa";
# Update  sounds location  to match your installation:
my $sounds="$ENV{HOME}/emacs/lisp/emacspeak/sounds/clock";
my ($sec,$min,$hour,$mDay,$mon,$year,$wDay,$yDay,$isdst) = localtime();
my %chimes =(
    0 => [qw(Sun Mon Tue Wed Thu Fri Sat)],
    15  => [qw(gf-15.mp3 wm-15.mp3 chime-15.mp3 bigben-15.mp3)],
    30 =>[qw (gf-30.mp3 wm-30.mp3 chime-30.mp3 bigben-30.mp3)],
    45 => [qw(gf-45.mp3 wm-45.mp3 chime-45.mp3 bigben-45.mp3)]
    );
my $chime;
exit unless defined ($chimes{$min});
if ($min == 0 ) {
    my $c = $chimes{0}[$wDay];
    $hour %= 12;
    $hour = 12 if ($hour == 0);
    $chime = "$sounds/$c/$hour.mp3";
} else {
    my $c = $chimes{$min}[$hour % 4];
    $chime = "$sounds/$c";
}
# If ladspa not available, use next line.
#qx(mplayer -af bs2b $chime  2>&1  >/dev/null);
qx(mplayer -af bs2b -af ladspa=tap_reverb:tap_reverb:5000:-4:-18:1:1:1:1:6 $chime  2>&1  >/dev/null);