Conky Rhythmbox Python Script

Ubuntu/Debian : All the script packages have now been copied into the Conky Companions PPA. Any package updates will be provided by the team through this new ppa. The ppa can be found here: https://launchpad.net/~conky-companions/+archive/ppa. To use this ppa first delete the old ppa files using this:

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 tar.gz file to an appropriate folder, and edit the conkyRhythmbox script to point to the correct location where conkyRhythmbox.py is. The tar.gz file is available at the Conky Companions PPA site here: https://launchpad.net/~conky-compani.../ppa/+packages

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),
BR (bitrate k/s), 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
[default: Playing,Paused,Stopped] The text must be
comma delimited in the form 'A,B,C'. 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.
-S, --secondsoutput Force all position and length output to be in seconds
only.
-m LENGTH, --maxlength=LENGTH
[default: 0] Define the maximum length of any
datatypes output, if truncated the output ends in
"..."
-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.

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

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

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:

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.