Beep-Media-Player for Torsmo
Publicado por Adão S. Raul Neto 18/10/2005
[ Hits: 5.763 ]
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
Nenhum comentário foi encontrado.
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
IA Turbina o Desktop Linux enquanto distros renovam forças
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Como realizar um ataque de força bruta para desobrir senhas?
Como usar Gpaste no ambiente Cinnamon
Atualizando o Fedora 42 para 43
PERFIL CRIADO NO SAMBA AD DC NÃO LOGA NO WINDOWS 10 E 11 (2)
Estou tentando ser legalista, mas tá complicado! (0)
É normal não gostar de KDE? (17)
PERFIL CRIADO NO SAMBA AD DC NÃO LOGA NO WINDOWS 10 E 11 (1)









