Page 1 of 8 123 ... LastLast
Results 1 to 10 of 72

Thread: Conky Clementine Python Script

  1. #1
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Conky Clementine 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

    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:
    Code:
    sudo rm /etc/apt/sources.list.d/m-buck* && sudo rm /etc/apt/sources.list.d/conkyhardcore*
    Then follow the modified first post instructions for the scripts


    Intro

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

    There is a README with the install, I suggest you give it atleast a quick once over! It can be found in the installation folder, normally following the path of /usr/share/conky<scriptname>/

    Basic Install

    Method 1: Using apt

    1) Add the repository to your OS install:
    Code:
    sudo add-apt-repository ppa:conky-companions/ppa
    * Note if you are running 9.10 or below then refer to the PPA link at the end of this post for help on installing from the ppa, good guidance can be found on the launchpad site

    2) Now that is done simply run the following to update your repo cache and install the script:

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

    Run the .deb file available at the Conky Companions PPA site here: https://launchpad.net/~conky-compani.../ppa/+packages

    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 conkyClementine script to point to the correct location where conkyClementine.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:
    conkyClementine -h
    or

    Code:
    conkyClementine --help
    Code:
    Usage: conkyClementine [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.
    Development History

    Much thanks goes to VastOne for co-authoring this script off the back of my other player scripts, adapting it slightly for Clementine use. Note to others out there, if you have a player and want a script for it you too could help the cause, the player app just needs to publish to d-bus and you need to learn a little python

    Development history going forwards can be seen here https://code.launchpad.net/~conky-companions/+junk/conkyclementine
    All packages available from me can be found here: https://launchpad.net/~conky-companions/+archive/ppa
    Last edited by kaivalagi; December 15th, 2010 at 12:08 AM.

  2. #2
    Join Date
    Nov 2008
    Location
    #!
    Beans
    1,749

    Re: Conky Clementine Python Script

    You can see my Conky Clementine setup from here at Conky-Pitstop
    Attached Images Attached Images
    Last edited by VastOne; May 6th, 2011 at 11:20 PM.

  3. #3
    Join Date
    Nov 2008
    Beans
    4

    Re: Conky Clementine Python Script

    Nice script! Thumbs up! I was wondering if is there a way to recognize whether Clementine is playing radio or the library.
    Thank you!
    Attached Images Attached Images
    Last edited by ludentic; January 20th, 2011 at 12:51 AM.

  4. #4
    Join Date
    Nov 2008
    Beans
    4

    Re: Conky Clementine Python Script

    Ok figured out how to change when Clementine is playing radio. I added this lines to my conky file:


    # Music section for Clementine. Only shows if Clementine is a running process: It also shows "Radio" or "Music Player"
    ${if_running clementine}${if_match "${execi 5 conkyClementine --datatype=ST}" == "Playing"}${font Droid Sans:bold:size=10}${color0}Clementine ${font}${if_match "${execi 5 conkyClementine --datatype=FN}" > "http"}Radio${else}Music Player${endif} ${hr 2}${color}

    ${font Droid Sansblique:size=9}${execi 5 conkyClementine --datatype=TI | fold -w36}${font}

    ${execi 5 conkyClementine --datatype=AR | fold -w36}${font}${endif}${endif}
    Attached Images Attached Images

  5. #5
    Join Date
    Nov 2008
    Location
    #!
    Beans
    1,749

    Re: Conky Clementine Python Script

    Quote Originally Posted by ludentic View Post
    Ok figured out how to change when Clementine is playing radio. I added this lines to my conky file:


    # Music section for Clementine. Only shows if Clementine is a running process: It also shows "Radio" or "Music Player"
    ${if_running clementine}${if_match "${execi 5 conkyClementine --datatype=ST}" == "Playing"}${font Droid Sans:bold:size=10}${color0}Clementine ${font}${if_match "${execi 5 conkyClementine --datatype=FN}" > "http"}Radio${else}Music Player${endif} ${hr 2}${color}

    ${font Droid Sansblique:size=9}${execi 5 conkyClementine --datatype=TI | fold -w36}${font}

    ${execi 5 conkyClementine --datatype=AR | fold -w36}${font}${endif}${endif}
    Very nice...

    Would you be so kind and post your conky config files for a closer examination?

    Thanks~!

  6. #6
    Join Date
    Nov 2008
    Location
    #!
    Beans
    1,749

    Re: Conky Clementine Python Script

    Quote Originally Posted by ludentic View Post
    Nice script! Thumbs up! I was wondering if is there a way to recognize whether Clementine is playing radio or the library.
    Thank you!
    Thanks

  7. #7
    Join Date
    Nov 2008
    Location
    #!
    Beans
    1,749

    Re: Conky Clementine Python Script

    Quote Originally Posted by ludentic View Post
    Ok figured out how to change when Clementine is playing radio. I added this lines to my conky file:


    # Music section for Clementine. Only shows if Clementine is a running process: It also shows "Radio" or "Music Player"
    ${if_running clementine}${if_match "${execi 5 conkyClementine --datatype=ST}" == "Playing"}${font Droid Sans:bold:size=10}${color0}Clementine ${font}${if_match "${execi 5 conkyClementine --datatype=FN}" > "http"}Radio${else}Music Player${endif} ${hr 2}${color}

    ${font Droid Sansblique:size=9}${execi 5 conkyClementine --datatype=TI | fold -w36}${font}

    ${execi 5 conkyClementine --datatype=AR | fold -w36}${font}${endif}${endif}
    If you wrap this info in code
    Code:
     Music section for Clementine. Only shows if Clementine is a running process: It also shows "Radio" or "Music Player"
    ${if_running clementine}${if_match "${execi 5 conkyClementine --datatype=ST}" == "Playing"}${font Droid Sans:bold:size=10}${color0}Clementine ${font}${if_match "${execi 5 conkyClementine --datatype=FN}" > "http"}Radio${else}Music Player${endif} ${hr 2}${color}
    
    ${font Droid Sans:oblique:size=9}${execi 5 conkyClementine --datatype=TI | fold -w36}${font}
    
    ${execi 5 conkyClementine --datatype=AR | fold -w36}${font}${endif}${endif}
    it shows up much cleaner...
    Last edited by VastOne; January 20th, 2011 at 08:46 PM.

  8. #8
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Clementine Python Script

    UPDATE

    Updates as follows:
    • Fixed potential bug with %20 not being represented as spaces when dealing with cover art paths


    Package changes can be seen here: https://launchpad.net/~conky-compani...source.changes

    The apt packages should be available soon

  9. #9
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Clementine Python Script

    UPDATE

    Updates as follows:
    • Updated both main scripts to handle URL encoded paths generically using urllib.unquote functions. Should sort out any cover art path issues *maybe*


    Package changes can be seen here: https://launchpad.net/~conky-compani...source.changes

    The apt packages should be available soon

  10. #10
    Join Date
    Jan 2011
    Beans
    5

    Re: Conky Clementine Python Script

    Hi!

    Does anybody know how to get nowplaying info (at least Artist/Track) to conky when playing last.fm radios? Otherwise (when playing from HD) this works just fine.

    To be more clear, "conkyClementine -d ST" (as well as all the other datatypes) in console returns:

    ERROR: Issue calling the dbus service:'NoneType' object has no attribute 'find'
    Unknown
    Last edited by laite; January 27th, 2011 at 08:39 PM.

Page 1 of 8 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •