Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - VastOne

#3841
This is a perl script created by VISDO member McLovin to run in Xchat to show what song is playing in your IRC channel

Save the following as /home/yourusername/.xchat2/gmplayer.pl


#!/usr/bin/perl

use strict;
use Net::DBus;

# Gm player XChat script
# (c) Copyright 2013 - McLovin <McLovinsblog@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

my $script_name        = "gmusic XChat";
my $script_version     = " 0.0.6";
my $script_description = "Displays the current Gmusic playing song in XChat.";
my $bus = Net::DBus->session;
#check for gmusicbrowser on Dbus
gm_live();

# message string
my $playing ="is currently listening to"; #replace with your own message

Xchat::register($script_name,$script_version,$script_description,"");

Xchat::print("Loaded \002".$script_name.$script_version."\003:");
Xchat::hook_command("gm_start", "gm_live");
Xchat::hook_command("gm_play", "gm_play");
Xchat::hook_command("gm_pause", "gm_pause");
Xchat::hook_command("gm_next", "gm_next");
Xchat::hook_command("gm_prev", "gm_prev");
Xchat::hook_command("gm_browse", "gm_browse");
Xchat::hook_command("gm_volup", "gm_volup");
Xchat::hook_command("gm_voldown", "gm_voldown");
Xchat::hook_command("gm_help", "gm_help");

#print "/me utilise $script_name $script_version \n";

sub gm_play{
   if (gm_run()){
      my $service = $bus->get_service('org.gmusicbrowser');
      my $object = $service->get_object('/org/gmusicbrowser', 'org.gmusicbrowser');
      my $info= $object->CurrentSong;
      # hash keys are : album, artist, disc, length, title, track
      # $info hash contains the keys value above. you can change below to display information you need. keep "me" (command will generate the slash).
      Xchat::command "me $playing $info->{artist} - $info->{title} - $info->{album} in GMusicBrowser";
   }
}

sub gm_next{
# Skip to the next track.
   if (gm_run()){
      my $service = $bus->get_service('org.gmusicbrowser');
      my $object = $service->get_object('/org/gmusicbrowser', 'org.gmusicbrowser');
      $object->RunCommand("NextSong");
      Xchat::print("Skipped to next track.");
      return 1;
   }
}

sub gm_pause{
# Play pause switch
   if (gm_run()){
      my $service = $bus->get_service('org.gmusicbrowser');
      my $object = $service->get_object('/org/gmusicbrowser', 'org.gmusicbrowser');
      $object->RunCommand("PlayPause");
      Xchat::print("play/pause track.");
      return 1;
   }
}

sub gm_prev{
# Rewind to the previous track.
   if (gm_run()){
      my $service = $bus->get_service('org.gmusicbrowser');
      my $object = $service->get_object('/org/gmusicbrowser', 'org.gmusicbrowser');
      $object->RunCommand("PrevSong");
      Xchat::print("rewinded to previous track.");
      return 1;
   }
}

sub gm_browse{
# Open a browser window.
   if (gm_run()){
      my $service = $bus->get_service('org.gmusicbrowser');
      my $object = $service->get_object('/org/gmusicbrowser', 'org.gmusicbrowser');
      $object->RunCommand("Browser");
      Xchat::print("opening Gmusic browser.");
      return 1;
   }
}

sub gm_help{
   # Display help screen.
   Xchat::print("\002\037".$script_name." Help:\037\002");
   Xchat::print("  * Script Version:    ".$script_version);
   Xchat::print(" \002Commands:\002");
   Xchat::print("  * /gm_start   - starts gmusic browser when it has been closed.");
   Xchat::print("  * /gm_play   - Display the current song playing to a channel.");
   Xchat::print("  * /gm_next   - Skip to the next track.");
   Xchat::print("  * /gm_prev   - Skip to the previous track.");
   Xchat::print("  * /gm_pause   - Pause/start playback.");
   Xchat::print("  * /gm_browse   - Open Gmusic UI window.");
   Xchat::print("  * /gm_help   - Display this help screen.");
   return 1;
}

sub gm_live{
my $localbus = Net::DBus->find;
my $localservice = $localbus->get_service("org.freedesktop.DBus");
my $localobject = $localservice->get_object("/org/freedesktop/DBus");
my $gtrouver=0;
  foreach (@{$localobject->ListNames}) {
    if (m/gmusicbrowser/){
      Xchat::print "found gmusic browser\n";
      $gtrouver=1;
      last;
    }
    }
 
}

sub gm_run{
my $localbus = Net::DBus->find;
my $localservice = $localbus->get_service("org.freedesktop.DBus");
my $localobject = $localservice->get_object("/org/freedesktop/DBus");
my $gtrouver=0;
  foreach (@{$localobject->ListNames}) {
    if (m/gmusicbrowser/){
      #Xchat::print "found gmusic browser\n";
      $gtrouver=1;
      last;
    }
    }
    unless ($gtrouver){
   Xchat::print "You need to restart gmusicbrowser use gm_start.\n";
   }
  return $gtrouver;
}


To run it in Xchat, make sure that GMusicBrowser is playing a song and enter this

/gm_play

Well Done McLovin!
#3842
Artwork & Screenshots / Re: January 2013 Screenshots
January 28, 2013, 05:14:03 PM
Nice... dizzie clones popping up all over the place!!!

His legend grows...

(twss)

::)  ???
#3843
Artwork & Screenshots / Re: January 2013 Screenshots
January 28, 2013, 06:46:42 AM
Very nice lwfitz!  Another keeper!  Worthy of a showcase !!!
#3844
GMusicBrowser Layouts & Scripts / New GMB Layout
January 28, 2013, 06:40:11 AM
I have not had much time lately to work on another great passion of mine, designing GMB layouts

Here is one I did tonight that will show the play buttons when you hover over the time slider



Here is the code, save it as /home/yourusername/.config/gmusicbrowser/layouts/desktray.layout

[VastOne Thin Layout Black Desktop]
Type=D
Author=VastOne

Window =  transparent=1
DefaultFontColor= #CCCECF
HBTime = 6Filler1 Length(markup="$length",initsize="XX:XX",xalign=0) _TimeSlider(direct_mode=1,hover_delay=1,hover_layout_pos=  1w x w-p-21,hover_layout=nowplaying_screenlet_popup) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)
# HBButtons = 10VolumeIcon
HBTitle = LockSong _Title
HBArtist = LockArtist _Artist
HBAlbum = LockAlbum _Album
VBText = HBTitle HBArtist HBAlbum
VBmain = _VBText -HBTime VBBottom
HBmain = _VBmain Filler1 -Cover(forceratio=1)
VBBottom = HBTime
VolumeScroll = VolumeIcon

[nowplaying_screenlet_popup]
Window = transparent=1
HBmain= 10VolumeIcon 11Prev(size=small-toolbar) 11Play(size=small-toolbar) 11Next(size=small-toolbar) 10BMSettings
BMSettings = (icon=gtk-preferences,size=menu) MainMenuItem PSortItem SMLibrary LayoutItem QueueItem PFilterItem SeparatorMenuItem01 MenuItem14(command=OpenPref,label=_"Settings",icon="gtk-preferences") MenuItem05(command=Quit,label=_"Quit",icon="gtk-quit")
SMLibrary = (label=_"Library") MenuItem00(command="RunPerlCode(::ChooseAddPath(0,1))",label=_"Add Music",icon="gtk-add") MenuItem32(command="RunPerlCode(::IdleScan)",label=_"Rescan Collection",icon="gtk-refresh")
VolumeScroll = VolumeIcon


Then go to GMusicBrowser /Settings/Plugins/Desktop Widgets and use the dropdown to find VastOne Thin Layout Black Desktop and add it. Now the layout will be on your desktop but while still in these settings adjust the size and location so that it shows correctly on your desktop

Profit!
#3845
Agreed!  ;D  Nice job jst_joe

#3846
Media Room / Re: Just listened to
January 27, 2013, 10:20:21 PM
Agreed... We all seem to be artists in one form or another

:)
#3847
Media Room / Re: Just listened to
January 27, 2013, 07:07:40 PM
Thanks for that lwfitz, one of my all time favorites!
#3848
^ This is why I am here!   ;D
#3849
Artwork & Screenshots / Re: January 2013 Screenshots
January 27, 2013, 06:26:38 PM
#3850
WOW



Thanks jst_joe!
#3851
Artwork & Screenshots / Re: January 2013 Screenshots
January 27, 2013, 05:56:39 PM
Very nice mrneilypops!  :)
#3852
Artwork & Screenshots / Re: January 2013 Screenshots
January 27, 2013, 05:04:55 PM
I am totally blown away by the work in here... Very impressive! 

You know we are doing something right when dizzie becomes a Conky SLut!

You all have my complete respect!
#3853
Introductions / Re: Digit, checking in.
January 27, 2013, 05:02:27 PM
^ Very nice jst_joe..  That is signature worthy!   8)
#3854
VSIDO News & Announcements / Debian Kernel ISO Updated
January 27, 2013, 05:01:25 PM
I have built, installed, tested and uploaded the latest ISO to the host

The debian ISO is at the latest Sid levels and latest kernel

If anyone is having download issues, Sector11 has tested getting the ISO with wget after a failed download

To use wget, in terminal just cd to where you want them and run:

Debian

wget http://vsido.org/debian/vsido_v1-2_3.8-3_Kernel.iso

I have also added a link to the download page to assist with wget downloads

Thank you Sector11!  8)  8)
#3855
General Support / Re: Bad sig errors
January 27, 2013, 04:54:52 PM
Good the hear mrneilypops, thanks for letting us know...  :)