Beep-Media-Player for Torsmo
Publicado por Adão S. Raul Neto 18/10/2005
[ Hits: 5.638 ]
Homepage: https://github.com/adaoraul
Simples script que mostra o nome e o tempo da musica no torsmo
#!/usr/bin/perl -w # Script para mostrar a musica que está ouvindo no torsmo (torsmo.sf.net) # o script necessita do plugins bmp-songchange que pode ser baixodo em # http://bmp-plugins.berlios.de/ e com a seguinte configuração # # No BMP # "Song change" # "echo "%s" > /tmp/bmpsong && echo "%l" >> /tmp/bmpsong" # # No torsmo # $color ${execi 10 ~/.torsmo/bmp.pl} # obs.: ~/.torsmo/bmp.pl é o caminho do script use POSIX; my $numArgs = $#ARGV+1; my $key = $ARGV[0]; my @bmpsong; open(BMPSONG, "/tmp/bmp"); @bmpsong = <BMPSONG>; close BMPSONG; sub title { my $title; $title = $bmpsong[0]; chop($title); $title =~ s/(_[^_]*_[^_]*_)|(.mp3)|(.MP3)//; @title = split(/-/,$title); return $title[1]; } sub artist { my $title; $title = $bmpsong[0]; chop($title); $title =~ s/(_[^_]*_[^_]*_)|(.mp3)|(.MP3)//; @title = split(/-/,$title); return $title[0]; } sub tempo { my $lenght; my $minutos; my $segundos; $length = $bmpsong[1]; $length = $length / 1000; @length = split(/\./,$length); $segundos = $length[0]; while($segundos > 60) { $segundos = ($segundos - 60); $minutos++; } if (length($segundos) == 1) { $segundos = "0".$segundos; } return $minutos.":".$segundos; } if($key eq "Title") { my $title = title(); print "$title"; } elsif($key eq "Tempo") { my $tempo = tempo(); print "$tempo"; } elsif($key eq "Artist") { my $artist = artist(); print "$artist"; }
Índice (Logaritmo Discreto) em Perl
Diminuir ou aumentar o brilho de notebook
Algoritmo de Euclides estendido em Perl
Nenhum comentário foi encontrado.
Resolver problemas de Internet
Como compartilhar a tela do Ubuntu com uma Smart TV (LG, Samsung, etc.)
Descritores de Arquivos e Swappiness
Fez porcaria no teu repositório Git? Aprenda a restaurar uma versão anterior do seu código!
Restaurando Fontes de Download do Hydra no Linux
Atualizando "na marra" o YT-DLP quando começa a dar erro de downloads
Como instalar o WPS com interface e corretor ortográfico em PT-BR no Arch Linux
Bluetooth CSR 4.0 Dongle (Alternativo) (1)
Desbloquear chaveiro padrão (5)
como eu instalo o mali-t60x_r12... (5)