forked from dheera/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer
More file actions
executable file
·37 lines (35 loc) · 1.34 KB
/
player
File metadata and controls
executable file
·37 lines (35 loc) · 1.34 KB
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
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl
# My music player
while(1) {
print "player> ";
chomp($line=<stdin>);
$command=-1;
if($line ne "") {
$command=0;
if($line=~/^(s|straight) /) { $line=~s/^(s|straight) //;$command=0; }
if($line=~/^(r|random) /) { $line=~s/^(r|random) //;$command=1; }
if($line=~/^(l|ls|list) /) { $line=~s/^(l|ls|list) //;$command=2; }
if($line=~/^(c|clear) /) { $line=~s/^(c|clear) //;$command=3; }
}
if($command==0 || $command==1) { sleep 1; }
#if($command==0) { system("find ~/stuff/music/ | egrep -i '$line' | sort | play"); }
#if($command==1) { system("find ~/stuff/music/ | egrep -i '$line' | rl | play"); }
if($command==0) {
system("find /net/data.dheera.net/stuff/music/ | egrep -i '$line' | sort > /tmp/playlist");
system("cat /tmp/playlist > /tmp/playlist2");
for($k=0;$k<30;$k++) {
system("cat /tmp/playlist >> /tmp/playlist2");
}
system("mplayer -playlist /tmp/playlist2");
}
if($command==1) {
system("find /net/data.dheera.net/stuff/music/ | egrep -i '$line' | rl > /tmp/playlist");
system("cat /tmp/playlist > /tmp/playlist2");
for($k=0;$k<30;$k++) {
system("cat /tmp/playlist >> /tmp/playlist2");
}
system("mplayer -playlist /tmp/playlist2");
}
if($command==2) { system("find /net/stuff/music/ | egrep -i '$line'"); }
if($command==3) { system("clear"); }
}