commit 19e8e9b369b97abf909191e5d488bc660133b2f9
parent 36cb8d45964d0bfe9a0b0632118d7befb19212a4
Author: Haris <haris@feanor.lan>
Date: Wed, 26 Jun 2013 01:19:59 +0300
Cmus plugin for weechat.
Diffstat:
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/cmus.pl b/cmus.pl
@@ -0,0 +1,17 @@
+# weechat plugin to display current playing cmus track
+use strict;
+
+weechat::register("cmus", "cipher <haris\@2f30.org", "0.1", "Public Domain",
+ "displays cmus artist - song", "", "");
+weechat::hook_command("cmus", "Script to display what cmus is currently playing. Just /cmus and enjoy.", "", "", "", "cmus", "");
+
+sub cmus {
+ my ($data, $buffer, $args) = @_;
+ my $artistfull = qx(cmus-remote -Q | grep [[:space:]]artist[[:space:]]);
+ chomp (my $artist = substr($artistfull,10));
+ my $songfull = qx(cmus-remote -Q | grep [[:space:]]title[[:space:]]);
+ chomp (my $song = substr($songfull,10));
+
+ weechat::command($buffer, "/me cmus playing: $artist - $song");
+ return weechat::WEECHAT_RC_OK;
+}