Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > General Help
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

General Help
All your general support questions for Ubuntu, Kubuntu, Edubuntu and Xubuntu.

 
Thread Tools Display Modes
Old September 23rd, 2008   #1
kaivalagi
Chocolate Ubuntu Mocha Blend
 
kaivalagi's Avatar
 
Join Date: Feb 2008
Location: 52°38'41.6"N/1°19'43.6"E
Beans: 1,916
Conky Rhythmbox Python Script

ArchLinux : Package support is present in the AUR. All my packages can be seen here: http://aur.archlinux.org/packages.php?SeB=m&K=kaivalagi

IMPORTANT NEWS

All the script packages have now been copied into the Conky Hardcore PPA. Any package updates will be provided by the team through this new ppa.

The ppa can be found here: https://launchpad.net/~conkyhardcore/+archive/ppa

To use this ppa first delete the old ppa files using this:
Code:
sudo rm /etc/apt/sources.list.d/m-buck*
Then follow the modified first post instructions for the scripts
__________________________________________________ __________________________________________________ ______________________________


Intro

This is a simple script to display what is current playing in Rhythmbox. The script talks to Rhythmbox using dbus, and allows the outputting of track info and the use of templates...

There is a README with the install and attached here, I suggest you give it atleast a quick once over!

Basic Install

Method 1: Using apt

1) Create the necessary list file for access to the conky repository by running one of these.

Karmic Koala:
Code:
sudo wget -q http://www.kaivalagi.com/ubuntu/ppa/conkyhardcore-karmic.list -O /etc/apt/sources.list.d/conkyhardcore-karmic.list
Jaunty Jackalope:
Code:
sudo wget -q http://www.kaivalagi.com/ubuntu/ppa/conkyhardcore-jaunty.list -O /etc/apt/sources.list.d/conkyhardcore-jaunty.list
Intrepid Ibex:
Code:
sudo wget -q http://www.kaivalagi.com/ubuntu/ppa/conkyhardcore-intrepid.list -O /etc/apt/sources.list.d/conkyhardcore-intrepid.list
Hardy Heron:
Code:
sudo wget -q http://www.kaivalagi.com/ubuntu/ppa/conkyhardcore-hardy.list -O /etc/apt/sources.list.d/conkyhardcore-hardy.list
2) Add the repository public key to your apt setup by running this:

Code:
wget -q http://www.kaivalagi.com/ubuntu/ppa/conkyhardcore-key.gpg -O- | sudo apt-key add -
3) Now that is done simply run the following to install

Code:
sudo apt-get update && sudo apt-get install conkyrhythmbox
Method 2: Using deb file

Download and run the attached .deb file

Warning, this will not ensure you are kept up-to-date. Only method 1 will do that

Method 3: Using tar.gz file

Extract all the contents of the attached tar.gz file to an appropriate folder, and edit the conkyRhythmbox script to point to the correct location where conkyRhythmbox.py is.

Unless you are using a non-Debian based OS I don't suggest this. Users of Debian/Ubuntu flavour OS's should ideally use method 1.

Again will will not receive updates using this method. ONLY method 1 can do this for you

All further details on setup are orientated around the deb package based install, so may differ from what you choose your setup to be, if done using the tarball.


Usage Help

You can get the current help options at any time by running (change the path as necessary):

Code:
conkyRhythmbox -h
or

Code:
conkyRhythmbox --help
Code:
Usage: conkyRhythmbox [options]
Options:
  -h, --help            show this help message and exit
  -t FILE, --template=FILE
                        define a template file to generate output in one call.
                        A displayable item in the file is in the form
                        [--datatype=TI]. The following are possible options
                        within each item: --datatype,--ratingchar. Note that
                        the short forms of the options are not currently
                        supported! None of these options are applicable at
                        command line when using templates.
  -d DATATYPE, --datatype=DATATYPE
                        [default: TI] The data type options are: ST (status),
                        CA (coverart), TI (title), AL (album), AR (artist), GE
                        (genre), YR (year), TN (track number), FN (file name),
                        LE (length), PP (current position in percent), PT
                        (current position in time), VO (volume), RT (rating).
                        Not applicable at command line when using templates.
  -r CHAR, --ratingchar=CHAR
                        [default: *] The output character for the ratings
                        scale. Command line option overridden if used in
                        templates.
  -s TEXT, --statustext=TEXT
                        If defined the status text for the player will be
                        overridden. The text must be comma delimited in the
                        form 'Playing,Paused,Stopped'. Command line option
                        overridden if used in templates.
  -n, --nounknownoutput
                        Turn off unknown output such as "Unknown" for title
                        and "0:00" for length. Command line option overridden
                        if used in templates.
  -v, --verbose         Request verbose output, not a good idea when running
                        through conky!
  -V, --version         Displays the version of the script.
  --errorlogfile=FILE   If a filepath is set, the script appends errors to the
                        filepath.
  --infologfile=FILE    If a filepath is set, the script appends info to the
                        filepath.
Development History

Development history going forwards can be seen here https://code.launchpad.net/~m-buck/+junk/conkyrhythmbox

All packages available from me can be found here: https://launchpad.net/~conkyhardcore/+archive/ppa

I have also created a new website, for now it is relatively sparse, but it does details my conky scripts to a certain degree. You can find it here: http://www.kaivalagi.com
Attached Images
File Type: jpg example.jpg (6.5 KB, 1784 views)
Attached Files
File Type: txt README.txt (4.7 KB, 648 views)
File Type: deb conkyrhythmbox_2.07_all.deb (13.4 KB, 165 views)
File Type: gz conkyrhythmbox-2.07.tar.gz (22.1 KB, 200 views)
__________________

Last edited by kaivalagi; 4 Weeks Ago at 06:12 AM..
kaivalagi is offline   Reply With Quote
Old September 23rd, 2008   #2
HippyRandall
Gee! These Aren't Roasted!
 
HippyRandall's Avatar
 
Join Date: Feb 2008
Location: N of Bruce W of Kaivalagi
Beans: 181
Ubuntu 9.10 Karmic Koala
Send a message via ICQ to HippyRandall Send a message via MSN to HippyRandall Send a message via Yahoo to HippyRandall Send a message via Skype™ to HippyRandall
Re: Conky Rhythmbox Python Script

W00T!!!
I can now get rid of exaile! at least until they come out with 0.3 or w/e it is. Thanks man. Now to figure out a new layout...

Hippy
__________________
hippyrandall.com | Stargate Wars | HP Laptop
This is the first age that's paid much attention to the future, which is alittle ironic since we may not have one. -- Arthur Clarke
HippyRandall is offline   Reply With Quote
Old September 23rd, 2008   #3
kaivalagi
Chocolate Ubuntu Mocha Blend
 
kaivalagi's Avatar
 
Join Date: Feb 2008
Location: 52°38'41.6"N/1°19'43.6"E
Beans: 1,916
Re: Conky Rhythmbox Python Script

I couldn't help myself, I found out how to get the dbus info for Rhythmbox so had to do it!

I am switching to Rhythmbox now too...
__________________
kaivalagi is offline   Reply With Quote
Old September 25th, 2008   #4
kaivalagi
Chocolate Ubuntu Mocha Blend
 
kaivalagi's Avatar
 
Join Date: Feb 2008
Location: 52°38'41.6"N/1°19'43.6"E
Beans: 1,916
Re: Conky Rhythmbox Python Script

UPDATE

I've updated the script as follows:
  • Updated to handle when no music is playing, no unnecessary dbus calls will be made
  • Updated rating output generation to use ljust string function

The first post attachments have been updated, and the apt package is available
__________________
kaivalagi is offline   Reply With Quote
Old September 25th, 2008   #5
mp3_freak_721
5 Cups of Ubuntu
 
Join Date: Apr 2007
Location: Eau Claire, WI
Beans: 16
Ubuntu 8.04 Hardy Heron
Re: Conky Rhythmbox Python Script

Noob here: how do you put it into you config file?
__________________
Success is a lousy teacher. It seduces smart people into thinking they can't lose. - Bill Gates
mp3_freak_721 is offline   Reply With Quote
Old September 26th, 2008   #6
kaivalagi
Chocolate Ubuntu Mocha Blend
 
kaivalagi's Avatar
 
Join Date: Feb 2008
Location: 52°38'41.6"N/1°19'43.6"E
Beans: 1,916
Re: Conky Rhythmbox Python Script

Quote:
Originally Posted by mp3_freak_721 View Post
Noob here: how do you put it into you config file?
Okay, if you install this using method 1 all the hard work is done for you without any possible problems...

Once you have installed the script can be run from the command line and through an exec call in conky as "conkyRhythmbox"

There is an example provided with the install, which if you open in an editor you'll see how things work. The file is: /usr/share/conkyrhythmbox/example/conkyrc

To run this example conky for this script, the following should be entered into the terminal:

Code:
conky -c /usr/share/conkyrhythmbox/example/conkyrc
All of this is in the README.txt file attached in the first post of this thread, I suggest you have a quick read

Any issues just ask...
__________________
kaivalagi is offline   Reply With Quote
Old October 4th, 2008   #7
kaivalagi
Chocolate Ubuntu Mocha Blend
 
kaivalagi's Avatar
 
Join Date: Feb 2008
Location: 52°38'41.6"N/1°19'43.6"E
Beans: 1,916
Re: Conky Rhythmbox Python Script

UPDATE

The script has been updated and is available in the first post and via apt, the changes are as follows:
  • Updated script to now use "[" and "]" as template brackets rather than "{" and "}" so that the execp/execpi conky command can be used, this enables the use of $font, $color options in the template which conky will then make adjustments for in the output!
  • Updated example files to use new template functionality with execpi in conky
  • Updated README for usage changes

Note the change to templates, [] rather than {} for options now....

Have fun
__________________
kaivalagi is offline   Reply With Quote
Old October 25th, 2008   #8
daveg
5 Cups of Ubuntu
 
Join Date: Jun 2005
Beans: 26
Ubuntu Breezy 5.10
Re: Conky Rhythmbox Python Script

I guess you didn't realise this, but there's already a command that does this which is part of the rhythmbox package (and has been for quite some time) called rhythmbox-client:

Code:
$ rhythmbox-client --help
Usage:
  rhythmbox-client [OPTION...]

Help Options:
  -?, --help                 Show help options

Application Options:
  --debug                    
  --no-start                 Don't start a new instance of Rhythmbox
  --quit                     Quit Rhythmbox
  --no-present               Don't present an existing Rhythmbox window
  --hide                     Hide the Rhythmbox window
  --next                     Jump to next song
  --previous                 Jump to previous song
  --notify                   Show notification of the playing song
  --play                     Resume playback if currently paused
  --pause                    Pause playback if currently playing
  --play-pause               Toggle play/pause mode
  --play-uri=URI to play     Play a specified URI, importing it if necessary
  --enqueue                  Add specified tracks to the play queue
  --clear-queue              Empty the play queue before adding new tracks
  --print-playing            Print the title and artist of the playing song
  --print-playing-format     Print formatted details of the song
  --set-volume               Set the playback volume
  --volume-up                Increase the playback volume
  --volume-down              Decrease the playback volume
  --print-volume             Print the current playback volume
  --mute                     Mute playback
  --unmute                   Unmute playback
daveg is offline   Reply With Quote
Old October 25th, 2008   #9
kaivalagi
Chocolate Ubuntu Mocha Blend
 
kaivalagi's Avatar
 
Join Date: Feb 2008
Location: 52°38'41.6"N/1°19'43.6"E
Beans: 1,916
Re: Conky Rhythmbox Python Script

Quote:
Originally Posted by daveg View Post
I guess you didn't realise this, but there's already a command that does this which is part of the rhythmbox package (and has been for quite some time) called rhythmbox-client:
Yes, I did know it was there, but this script allows for easier and better formatting of output, especially via a template file and the execpi/execp conky commands...

rhythmbox-client is great for controlling the music player from the console, but unless users want to spend hours on grep, sed and cut commands to strip and format the required details, it isn't a great tool to display current song details.

Your call if you want to use the script or not
__________________

Last edited by kaivalagi; October 25th, 2008 at 05:33 AM..
kaivalagi is offline   Reply With Quote
Old October 29th, 2008   #10
champs
5 Cups of Ubuntu
 
Join Date: Jul 2008
Location: Canberra, AUSTRALIA
Beans: 22
Ubuntu 8.04 Hardy Heron
Re: Conky Rhythmbox Python Script

I gave the Rhythmbox a go..... working my way through your signature links.

It worked a treat, straight away, but I have noticed that when the song changes, a line from the previous line gets left behind, and pushes everything else up a line or two.

Screenshots below are from the 5th and 9th songs, and after the last song of the album finished.
Attached Images
File Type: png Screenshot.png (20.9 KB, 392 views)
File Type: png Screenshot-1.png (26.2 KB, 304 views)
File Type: png Screenshot-2.png (24.5 KB, 335 views)
champs is offline   Reply With Quote

Bookmarks

Tags
conky, music, python, rhythmbox, script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:16 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry