Author Topic: Conky Support, Codes and Screenshots  (Read 266570 times)

untune

  • Posts: 3
    • View Profile
Re: Conky Support, Codes and Screenshots
« Reply #390 on: January 27, 2014, 03:13:40 AM »
Hi.  I just registered in the hope of  getting some conky help.

For the last couple of years I have been pressed by work demands into using Windows, and have only recently restarted using linux instead. I had saved my old conky scripts, the "now playing" portion of which relied on VastOne's cover art templates.

For some reason now that I come to run them again the "now playing" data still appears when I am using Amarok, but not when I am using vlc or (my favoured player) gmb.

When I use amarok, my desktop looks like this (as desired):


But when playing the same tracks using vlc or gmb I get this:


My start script:
Code: [Select]
#!/bin/bash
#conky -c ~/.config/conky/.conkyrc_hdd &
conky -c ~/.config/conky/.conkyrc_network &
conky -c ~/.config/conky/.conkyrc_monitor & #conky -c ~/.config/conky/.conkyrc_web &
conky -c ~/.config/conky/.conkyrc_music

opens this:
Code: [Select]
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_colour 191919
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
border_inner_margin 5
border_outer_margin 0
default_color 919191
default_shade_color 000000
default_outline_color d9d7d6
use_spacer yes
no_buffers yes
uppercase yes
imlib_cache_size 0
text_buffer_size 2048
default_bar_size 120 4
total_run_times 0
update_interval 1
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
minimum_size 120
maximum_width 120
gap_x 20
gap_y 23
background yes
use_xft yes
xftfont dejavu sans mono:size=7
xftalpha 1
alignment top_right

TEXT
${if_running gmusicbrowser}
${execp ~/scripts/conky/conkyGmusicbrowser.py --template=~/scripts/conky/conkyGmusicbrowser.template}$else${if_running amarok}
${execp ~/scripts/conky/conkyAmarok.py --template=~/scripts/conky/conkyAmarok.template}$else${if_running vlc}
${execp ~/scripts/conky/conkyVlc.py --template=~/scripts/conky/conkyVlc.template}$else
#${execi 1200 twidge lsrecent >  ~/scripts/conky/tweets.txt}${execi 1200 python ~/scripts/conky/tw.py ~/scripts/conky/tweets.txt}








which uses this VastOne's python script (unchanged I believe):
Code: [Select]
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
###############################################################################
# conkygmusicbrowser.py is a simple python script to gather
# details from gmusicbrowser for use in conky.
#
#  Author: VastOne
# Created: 01/28/2011

from datetime import datetime
from optparse import OptionParser
import sys
import traceback
import codecs
import os
import htmllib
import re
from htmlentitydefs import name2codepoint
import shutil
import urllib

try:
    import dbus
    DBUS_AVAIL = True
except ImportError:
    # Dummy D-Bus library
    class _Connection:
        get_object = lambda *a: object()
    class _Interface:
        __init__ = lambda *a: None
        ListNames = lambda *a: []
    class Dummy: pass
    dbus = Dummy()
    dbus.Interface = _Interface
    dbus.service = Dummy()
    dbus.service.method = lambda *a: lambda f: f
    dbus.service.Object = object
    dbus.SessionBus = _Connection
    DBUS_AVAIL = False


class CommandLineParser:

    parser = None

    def __init__(self):

        self.parser = OptionParser()
        self.parser.add_option("-t", "--template", dest="template", type="string", metavar="FILE", help=u"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.")
        self.parser.add_option("-d", "--datatype", dest="datatype", default="TI", type="string", metavar="DATATYPE", help=u"[default: %default] 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.")
        self.parser.add_option("-c", "--coverartpath", dest="coverartpath", default="/tmp/cover", type="string", metavar="PATH", help=u"[default: %default] The file where coverart gets copied to if found when using the --datatype=CA option. Note that if set to an empty string i.e. \"\" the original file path is provided for the coverart path.")       
        self.parser.add_option("-r", "--ratingchar", dest="ratingchar", default="*", type="string", metavar="CHAR", help=u"[default: %default] The output character for the ratings scale. Command line option overridden if used in templates.")
        self.parser.add_option("-s", "--statustext", dest="statustext", default="Playing,Paused,Stopped", type="string", metavar="TEXT", help=u"[default: %default] The text must be comma delimited in the form 'A,B,C'. Command line option overridden if used in templates.")
        self.parser.add_option("-n", "--nounknownoutput", dest="nounknownoutput", default=False, action="store_true", help=u"Turn off unknown output such as \"Unknown\" for title and \"0:00\" for length. Command line option overridden if used in templates.")
        self.parser.add_option("-S", "--secondsoutput", dest="secondsoutput", default=False, action="store_true", help=u"Force all position and length output to be in seconds only.")
        self.parser.add_option("-m", "--maxlength", dest="maxlength", default="0", type="int", metavar="LENGTH", help=u"[default: %default] Define the maximum length of any datatypes output, if truncated the output ends in \"...\"")
        self.parser.add_option("-v", "--verbose", dest="verbose", default=False, action="store_true", help=u"Request verbose output, not a good idea when running through conky!")
        self.parser.add_option("-V", "--version", dest="version", default=False, action="store_true", help=u"Displays the version of the script.")
        self.parser.add_option("--errorlogfile", dest="errorlogfile", type="string", metavar="FILE", help=u"If a filepath is set, the script appends errors to the filepath.")
        self.parser.add_option("--infologfile", dest="infologfile", type="string", metavar="FILE", help=u"If a filepath is set, the script appends info to the filepath.")               

    def parse_args(self):
        (options, args) = self.parser.parse_args()
        return (options, args)

    def print_help(self):
        return self.parser.print_help()

class MusicData:
    def __init__(self,status,coverart,title,album,length,artist,tracknumber,genre,year,filename,bitrate,current_position_percent,current_position,rating,volume):
        self.status = status
        self.coverart = coverart
        self.title = title
        self.album = album
        self.length = length
        self.artist = artist
        self.tracknumber = tracknumber
        self.genre = genre
        self.year = year
        self.filename = filename
        self.bitrate = bitrate
        self.current_position_percent = current_position_percent
        self.current_position = current_position
        self.rating = rating
        self.volume = volume
       
class GmusicbrowserInfo:
   
    error = u""
    musicData = None
   
    def __init__(self, options):
        self.options = options
       
    def testDBus(self, bus, interface):
        obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
        dbus_iface = dbus.Interface(obj, 'org.freedesktop.DBus')
        avail = dbus_iface.ListNames()
        return interface in avail
       
    def getOutputData(self, datatype, ratingchar, statustext, nounknownoutput, maxlength):
        output = u""
       
        if nounknownoutput == True:
            unknown_time = ""
            unknown_number = ""
            unknown_string = ""
        else:
            unknown_time = "0:00"
            unknown_number = "0"
            unknown_string = "Unknown"
       
        try:
               
            bus = dbus.SessionBus()
            if self.musicData == None:
               
                if self.testDBus(bus, 'org.mpris.gmusicbrowser'):
               
                    self.logInfo("Calling dbus interface for music data")
   
                    try:
                        self.logInfo("Setting up dbus interface")
                       
                        # setup dbus hooks
                        remote_player = bus.get_object('org.mpris.gmusicbrowser', '/Player')
                        iface_player = dbus.Interface(remote_player, 'org.freedesktop.MediaPlayer')
                       
                        self.logInfo("Calling dbus interface for music data")
                   
                        status = self.getStatusText(iface_player.GetStatus()[0], statustext)
   
                        # try to get all the normal stuff...the props return an empty string if nothing is available
                        props = iface_player.GetMetadata()

                        # grab the data into variables
                        if "location" in props:
                            location = props["location"]
                        else:
                            location = None

                        # handle a file or stream differently for filename
                        if location.find("file://") != -1:
                            filename = location[location.rfind("/")+1:]
                        elif len(location) > 0:
                            filename = location
                        else:
                            filename = ""
                           
                           
                        if "title" in props:
                            title = props["title"]
                        else:
                            title = None
                           
                        if "album" in props:
                            album = props["album"]
                        else:
                            album = None
                           
                        if "artist" in props:
                            artist = props["artist"]
                        else:
                            artist = None
                           
                        if "year" in props:
                            year = str(props["year"])
                        else:
                            year = None
                       
                        if "tracknumber" in props:
                            tracknumber = str(props["tracknumber"])
                        else:
                            tracknumber = None

                        if "audio-bitrate" in props:
                            bitrate = str(props["audio-bitrate"])
                        else:
                            bitrate = None
                           
                        if year == "0": year = None
                        if tracknumber == "0": tracknumber = None
                        if bitrate == "0": bitrate = None
                       
                        # TODO: get album art working for internet based (if feasible)...
                        # get coverart url or file link
                        if "arturl" in props:
                            coverart = os.path.expanduser(urllib.unquote(str(props["arturl"])).replace("file://",""))
                            #coverart = os.path.expanduser(str(props["arturl"]).replace(" ", "%20"))
                            if coverart.find("http://") != -1:
                                coverart = None
                        else:
                            coverart = None                           
                           
                        # common details
                        if "genre" in props:
                            genre = props["genre"]
                        else:
                            genre = None
                       
                        if "rating" in props:
                            rating = props["rating"]
                        else:
                            rating = None

                        if "time" in props:
                            length_seconds = props["time"]
                        else:
                            length_seconds = 0
                                                                               
                        current_seconds = int(iface_player.PositionGet() / 1000)

                        if length_seconds > 0:
                            current_position_percent = str(int((float(current_seconds) / float(length_seconds))*100))
                        else:
                            length_seconds = 0
                            current_position_percent = "0"
                       
                        if self.options.secondsoutput == True:
                            length = str(length_seconds)
                            current_position = str(current_seconds)
                        else:
                            length = str(length_seconds/60).rjust(1,"0")+":"+str(length_seconds%60).rjust(2,"0")
                            current_position = str(int(current_seconds/60)).rjust(1,"0")+":"+str(int(current_seconds%60)).rjust(2,"0")

                        volume = str(iface_player.VolumeGet())

                        self.musicData = MusicData(status,coverart,title,album,length,artist,tracknumber,genre,year,filename,bitrate,current_position_percent,current_position,rating,volume)
                       
                    except Exception, e:
                        self.logError("Issue calling the dbus service:"+e.__str__())

            if self.musicData != None:
               
                self.logInfo("Preparing output for datatype:"+datatype)

                if datatype == "ST": #status
                    if self.musicData.status == None or len(self.musicData.status) == 0:
                        output = None
                    else:
                        output = self.musicData.status

                elif datatype == "CA": #coverart
                    if self.musicData.coverart == None or len(self.musicData.coverart) == 0:
                        output = None
                    else:
                        self.logInfo("Copying coverart from %s to %s"%(self.musicData.coverart, self.options.coverartpath))
                        shutil.copy(self.musicData.coverart, self.options.coverartpath)
                        self.musicData.coverart = self.options.coverartpath                       
                        output = self.musicData.coverart
                           
                elif datatype == "TI": #title
                    if self.musicData.title == None or len(self.musicData.title) == 0:
                        output = None
                    else:
                        output = self.musicData.title
                       
                elif datatype == "AL": #album
                    if self.musicData.album == None or len(self.musicData.album) == 0:
                        output = None
                    else:
                        output = self.musicData.album
                       
                elif datatype == "AR": #artist
                    if self.musicData.artist == None or len(self.musicData.artist) == 0:
                        output = None
                    else:
                        output = self.musicData.artist

                elif datatype == "TN": #tracknumber
                    if self.musicData.tracknumber == None or len(self.musicData.tracknumber) == 0:
                        output = None
                    else:
                        output = self.musicData.tracknumber
                       
                elif datatype == "GE": #genre
                    if self.musicData.title == genre or len(self.musicData.genre) == 0:
                        output = None
                    else:
                        output = self.musicData.genre
                       
                elif datatype == "YR": #year
                    if self.musicData.year == None or len(self.musicData.year) == 0:
                        output = None
                    else:
                        output = self.musicData.year
                                               
                elif datatype == "FN": #filename
                    if self.musicData.filename == None or len(self.musicData.filename) == 0:
                        output = None
                    else:
                        output = self.musicData.filename

                elif datatype == "BR": #bitrate
                    if self.musicData.bitrate == None or len(self.musicData.bitrate) == 0:
                        output = None
                    else:
                        output = self.musicData.bitrate
                       
                elif datatype == "LE": # length
                    if self.musicData.length == None or len(self.musicData.length) == 0:
                        output = None
                    else:
                        output = self.musicData.length
                       
                elif datatype == "PP": #current position in percent
                    if self.musicData.current_position_percent == None or len(self.musicData.current_position_percent) == 0:
                        output = None
                    else:
                        output = self.musicData.current_position_percent
                       
                elif datatype == "PT": #current position in time
                    if self.musicData.current_position == None or len(self.musicData.current_position) == 0:
                        output = None
                    else:
                        output = self.musicData.current_position
                       
                elif datatype == "VO": #volume
                    if self.musicData.volume == None or len(self.musicData.volume) == 0:
                        output = None
                    else:
                        output = self.musicData.volume
                       
                elif datatype == "RT": #rating
                    if self.musicData.rating == None or self.isNumeric(self.musicData.rating) == False:
                        output = None
                    else:
                        rating = int(self.musicData.rating)
                        if rating > 0:
                            output = u"".ljust(rating,ratingchar)
                        elif rating == 0:
                            output = u""
                        else:
                            output = None
                else:
                    self.logError("Unknown datatype provided: " + datatype)
                    return u""

            if output == None or self.musicData == None:
                if datatype in ["LE","PT"]:
                    if self.options.secondsoutput == True:
                        output = unknown_number
                    else:
                        output = unknown_time
                elif datatype in ["PP","VO","YR","TN"]:
                    output = unknown_number
                elif datatype == "CA":
                    output = ""                 
                else:
                    output = unknown_string
           
            if maxlength > 0 and len(output) > maxlength:
                output = output[:maxlength-3]+"..."
               
            return output
       
        except SystemExit:
            self.logError("System Exit!")
            return u""
        except Exception, e:
            traceback.print_exc()
            self.logError("Unknown error when calling getOutputData:" + e.__str__())
            return u""

    def getStatusText(self, status, statustext):
       
        if status != None:       
            statustextparts = statustext.split(",")
           
            if status == 0:
                return statustextparts[0]
            elif status == 1:
                return statustextparts[1]
            elif status == 2:
                return statustextparts[2]
           
        else:
            return status
       
    def getTemplateItemOutput(self, template_text):
       
        # keys to template data
        DATATYPE_KEY = "datatype"
        RATINGCHAR_KEY = "ratingchar"
        STATUSTEXT_KEY = "statustext"       
        NOUNKNOWNOUTPUT_KEY = "nounknownoutput"
        MAXLENGTH_KEY = "maxlength"
       
        datatype = None
        ratingchar = self.options.ratingchar #default to command line option
        statustext = self.options.statustext #default to command line option
        nounknownoutput = self.options.nounknownoutput #default to command line option
        maxlength = self.options.maxlength #default to command line option
       
        for option in template_text.split('--'):
            if len(option) == 0 or option.isspace():
                continue
           
            # not using split here...it can't assign both key and value in one call, this should be faster
            x = option.find('=')
            if (x != -1):
                key = option[:x].strip()
                value = option[x + 1:].strip()
                if value == "":
                    value = None
            else:
                key = option.strip()
                value = None
           
            try:
                if key == DATATYPE_KEY:
                    datatype = value
                elif key == RATINGCHAR_KEY:
                    ratingchar = value
                elif key == STATUSTEXT_KEY:
                    statustext = value                   
                elif key == NOUNKNOWNOUTPUT_KEY:
                    nounknownoutput = True
                elif key == MAXLENGTH_KEY:
                    maxlength = int(value)
                else:
                    self.logError("Unknown template option: " + option)

            except (TypeError, ValueError):
                self.logError("Cannot convert option argument to number: " + option)
                return u""
               
        if datatype != None:
            return self.getOutputData(datatype, ratingchar, statustext, nounknownoutput, maxlength)
        else:
            self.logError("Template item does not have datatype defined")
            return u""


    def getOutputFromTemplate(self, template):
        output = u""
        end = False
        a = 0
       
        # a and b are indexes in the template string
        # moving from left to right the string is processed
        # b is index of the opening bracket and a of the closing bracket
        # everything between b and a is a template that needs to be parsed
        while not end:
            b = template.find('[', a)
           
            if b == -1:
                b = len(template)
                end = True
           
            # if there is something between a and b, append it straight to output
            if b > a:
                output += template[a : b]
                # check for the escape char (if we are not at the end)
                if template[b - 1] == '\\' and not end:
                    # if its there, replace it by the bracket
                    output = output[:-1] + '['
                    # skip the bracket in the input string and continue from the beginning
                    a = b + 1
                    continue
                   
            if end:
                break
           
            a = template.find(']', b)
           
            if a == -1:
                self.logError("Missing terminal bracket (]) for a template item")
                return u""
           
            # if there is some template text...
            if a > b + 1:
                output += self.getTemplateItemOutput(template[b + 1 : a])
           
            a = a + 1

        return output
   
    def writeOutput(self):

        if self.options.template != None:
            #load the file
            try:
                fileinput = codecs.open(os.path.expanduser(self.options.template), encoding='utf-8')
                template = fileinput.read()
                fileinput.close()
            except Exception, e:
                self.logError("Error loading template file: " + e.__str__())
            else:
                output = self.getOutputFromTemplate(template)
        else:
            output = self.getOutputData(self.options.datatype, self.options.ratingchar, self.options.statustext, self.options.nounknownoutput, self.options.maxlength)

        print output.encode("utf-8",'replace')

    def isNumeric(self,value):
        try:
            temp = int(value)
            return True
        except:
            return False
       
    def logInfo(self, text):
        if self.options.verbose == True:
            print >> sys.stdout, "INFO: " + text

        if self.options.infologfile != None:
            datetimestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
            fileoutput = open(self.options.infologfile, "ab")
            fileoutput.write(datetimestamp+" INFO: "+text+"\n")
            fileoutput.close()
           
    def logError(self, text):
        print >> sys.stderr, "ERROR: " + text
       
        if self.options.errorlogfile != None:
            datetimestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
            fileoutput = open(self.options.errorlogfile, "ab")
            fileoutput.write(datetimestamp+" ERROR: "+text+"\n")
            fileoutput.close()

    def unEscape(self,text):
        parser = htmllib.HTMLParser(None)
        parser.save_bgn()
        parser.feed(text)
        return parser.save_end()
   
    def htmlentitydecode(self,s):
        return re.sub('&(%s);' % '|'.join(name2codepoint),
                lambda m: unichr(name2codepoint[m.group(1)]), s)
       
       
def main():
   
    parser = CommandLineParser()
    (options, args) = parser.parse_args()

    if options.version == True:
        print >> sys.stdout,"conkygmusicbrowser v.2.00"
    else:
        if options.verbose == True:
            print >> sys.stdout, "*** INITIAL OPTIONS:"
            print >> sys.stdout, "    datatype:", options.datatype
            print >> sys.stdout, "    template:", options.template
            print >> sys.stdout, "    ratingchar:", options.ratingchar
            print >> sys.stdout, "    nounknownoutput:", options.nounknownoutput
            print >> sys.stdout, "    secondsoutput:", options.secondsoutput
            print >> sys.stdout, "    maxlength:", options.maxlength
            print >> sys.stdout, "    verbose:", options.verbose
            print >> sys.stdout, "    errorlogfile:",options.errorlogfile
            print >> sys.stdout, "    infologfile:",options.infologfile

        gmusicbrowserinfo = GmusicbrowserInfo(options)
        gmusicbrowserinfo.writeOutput()
   
if __name__ == '__main__':
    main()
    sys.exit()
   

with this template:

Code: [Select]
${image [--datatype=CA] -p 0,104-s 120x120}${if_match "[--datatype=ST]" == "Playing"}${alignc}[--datatype=ST]
${alignc}${font Guifxv2Transports:regular:size=22}${offset -11}1${font}
[--datatype=PT]${alignr}[--datatype=LE]
${execibar 1 ~/scripts/conky/conkyGmusicbrowser.py --datatype=PP}${font dejavu sans mono:size=3}

#${color 919191}TITLE:${color 616161}
${font dejavu sans mono:size=7}[--datatype=TI --maxlength=32]
#${color 919191}ARTIST:${color 616161}
[--datatype=AR --maxlength=32]
#${color 919191}ALBUM:${color 616161}
[--datatype=AL --maxlength=30]
#${color 919191}Volume ${color 616161}${alignr}[--datatype=VO]
#${color 919191}BitRate ${color 616161}${alignr}[--datatype=BR]
${image [--datatype=CA] -p 0,104 -s 120x120}$else${if_match "[--datatype=ST]" == "Paused"}${alignc}[--datatype=ST]
${alignc}${font Guifxv2Transports:regular:size=22}${offset -11}2${font}
[--datatype=PT]${alignr}[--datatype=LE]
${execibar 1 ~/scripts/conky/conkyGmusicbrowser.py --datatype=PP}${font dejavu sans mono:size=3}

#${color 919191}TITLE:${color 616161}
${font dejavu sans mono:size=7}[--datatype=TI --maxlength=32]
#${color 919191}ARTIST:${color 616161}
[--datatype=AR --maxlength=32]
#${color 919191}ALBUM:${color 616161}
[--datatype=AL --maxlength=30]
#${color 919191}Volume ${color 616161}${alignr}[--datatype=VO]
#${color 919191}BitRate ${color 616161}${alignr}[--datatype=BR]
${image [--datatype=CA] -p 0,104 -s 120x120}$else${alignc}Stopped
${alignc}${font Guifxv2Transports:regular:size=22}${offset -11}3${font}
[--datatype=PT]${alignr}[--datatype=LE]
${execibar 1 ~/scripts/conky/conkyGmusicbrowser.py --datatype=PP}${font dejavu sans mono:size=3}

#${color 919191}TITLE:${color 616161}
${font dejavu sans mono:size=7}[--datatype=TI --maxlength=32]
#${color 919191}ARTIST:${color 616161}
[--datatype=AR --maxlength=32]
#${color 919191}ALBUM:${color 616161}
[--datatype=AL --maxlength=30]
#${color 919191}Volume ${color 616161}${alignr}[--datatype=VO]
#${color 919191}BitRate ${color 616161}${alignr}[--datatype=BR]
${image ~/scripts/conky/grey.jpg -p 0,104 -s 120x120}$endif$endif












Can anyone spot what's causing this problem? My skills are rather are limited so I'm sure I'm making some elementary mistake but I just can't spot it.

VastOne

  •      v-ger
  • Posts: 4226
    • View Profile
    • VSIDO Community
Re: Conky Support, Codes and Screenshots
« Reply #391 on: January 27, 2014, 03:26:20 AM »
Hi untune and welcome to VSIDO and the forum, we are glad you are here.... That looks like a #! installation, correct?

Are you sure that the MPRIS plugins are enabled in both GMB and VLC?

In VSIDO, GMusicBrowser is the default app and with it are hundreds of layouts that show the info on the desktop without Conky and is one of the reasons why many of us switched to GMB

Here is a screenshot of my desktop with GMB and it's own desktop widget



I have all of these loaded and can help you trouble shoot this to the end.. I am guessing it is an MPRIS issue or a path issue

Running anyone of the pythons from terminal will tell us exactly what is missing and going wrong
VSIDO      VSIDO FB       

    I dev VSIDO

untune

  • Posts: 3
    • View Profile
Re: Conky Support, Codes and Screenshots
« Reply #392 on: January 27, 2014, 04:27:53 AM »
That was a quick reply! Well, I think you've identified the first problem: I don't think that the MPRIS plugins were enabled.
For VLC I saw this and so I followed this:
Quote
But the MPRIS v2 Dbus interface is not enabled by default in VLC 2.0, so here's how to enable it: in VLC go to Tools > Preferences, select "All" under "Show settings" (bottom left), then navigate to Interface > Control Interface and check the box next to "D-Bus control interface"
This doesn't seem to have affected the conky output though.

In GMB MPRIS v2 was enabled, not v1. I tried enabling v1 instead, which caused the text info to appear in conky, but not the artwork. Unfortunately GMB now keeps freezing!

The scripts in the terminal give:
Code: [Select]
@crunchbang:~/scripts/conky$ python conkyAmarok.py
Side B
@crunchbang:~/scripts/conky$ python conkyVlc.py
Unknown

VastOne

  •      v-ger
  • Posts: 4226
    • View Profile
    • VSIDO Community
Re: Conky Support, Codes and Screenshots
« Reply #393 on: January 27, 2014, 12:26:41 PM »
These scripts all depend on MPRIS 1 being enabled

I suggest that you go through this guide step by step ...  How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps
VSIDO      VSIDO FB       

    I dev VSIDO

untune

  • Posts: 3
    • View Profile
Re: Conky Support, Codes and Screenshots
« Reply #394 on: January 27, 2014, 01:27:57 PM »
How embarrassing.

Code: [Select]
sudo apt-get install mpdris
got gmb working as desired. Still no luck with vlc though. I checked and I have definitely enabled dbus as suggested.

VastOne

  •      v-ger
  • Posts: 4226
    • View Profile
    • VSIDO Community
Re: Conky Support, Codes and Screenshots
« Reply #395 on: January 27, 2014, 01:47:06 PM »
^ That makes no sense at all since mpdris is only needed for the mpd setup to work and has nothing at all to do with GMB

You might want to go through that How To step by step
VSIDO      VSIDO FB       

    I dev VSIDO

orcrist

  • Posts: 15
    • View Profile
Re: Multiple Conkys on Multiple Desktops
« Reply #396 on: July 18, 2014, 06:03:11 PM »
Thanks a lot Sector11!!!
 I have been looking for a way to have different conkys in every one of my desktops of my Crunchbang Waldorf machine and your guide did exactly what I wanted.
I only noticed this:
In my first attempt, one conky (say conky1) started in the 1st desktop but the other one (say conky2) started on both desktops. I had erased "sticky" on both. Then I noticed that conky1 had the "own_window_type normal" option but conky2 (the bad guy) had it "own_window_type override". I changed "override" to "normal" and things are as I wanted them to be...

PackRat

  • Posts: 2290
    • View Profile
    • PackRat configs on github
Re: Conky Support, Codes and Screenshots
« Reply #397 on: November 19, 2014, 08:53:42 PM »
One line conky, with colored output and configured to dock in the fluxbox slit. Should also work with openbox dock and pekwm harbor:



In conky configuration, make sure to have this setting:

Code: [Select]
own_window_type dock
and have the fluxbox slit configured to have the conky output properly oriented. The advantage of having the conky docked is that maximized windows do not cover it; this way, I can see when the temps get too high, or the battery gets low - the battery % value is also configured to blink.

The code -

Code: [Select]
##############################################
# Settings
##############################################
background yes
use_xft yes
# xftfont Cursive Sans:bold:size=6
xftfont PT Sans Caption:bold:pixelsize=10
xftalpha 1.0
update_interval 1.0
update_interval_on_battery 30.0
total_run_times 0

own_window yes
own_window_colour 1E1D1D
own_window_transparent no
own_window_type dock
# own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class FBoxConky
own_window_title fbox_conky
##############################################
# Compositing tips:
# Conky can play strangely when used with
# different compositors. I have found the
# following to work well, but your mileage
# may vary. Comment/uncomment to suit.
##############################################
##
own_window_argb_visual yes
#own_window_argb_value 2

## xcompmgr
# own_window_argb_visual yes
# own_window_argb_value 120

## cairo-compmgr
#own_window_type desktop
#own_window_argb_visual yes
##############################################

no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
short_units yes
imlib_cache_size 0
pad_percents 1
max_specials 2048
max_user_text 3200
text_buffer_size 1024
no_buffers yes
uppercase no
if_up_strictness address
double_buffer yes
minimum_size 1366 0
maximum_width 1366
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
border_inner_margin 1
border_outer_margin 1

default_color DAC79C
default_shade_color 000000
default_outline_color 828282
color0 FFFFFF
color1 000000
color2 FF0000 # - red
color3 FFFF00 # - yellow
color4 0000FF # - blue
color5 00FF00 # - green
color6 FFA500 # - orange
color7 00CDCD # - cyan3
color8 FFD700 # - gold
color9 F00F16 # - reddish

alignment tm
gap_x 0
gap_y 0

# -- doesn't seem to work when docked in the slit --#
# lua_load ~/conky/transbg.lua
# lua_draw_hook_pre draw_bg 0 0 0 0 0 0x140C0B 0.10

TEXT
${goto 12}Uptime:${offset 8}${uptime_short}${offset 16}|${offset 16}\
Core1:${offset 8}${if_match ${execpi 60 ~/conky/TCore0.sh}<=50}${color7}${else}${if_match ${execpi 60 ~/conky/TCore0.sh}<=70}${color8}${else}${if_match ${execpi 60 ~/conky/TCore0.sh}>70}${color9}${endif}${endif}${endif}${execpi 60 ~/conky/TCore0.sh}${offset 2}°C${color}${offset 16}\
Core2:${offset 8}${if_match ${execpi 60 ~/conky/TCore1.sh}<=50}${color7}${else}${if_match ${execpi 60 ~/conky/TCore1.sh}<=70}${color8}${else}${if_match ${execpi 60 ~/conky/TCore1.sh}>70}${color9}${endif}${endif}${endif}${execpi 60 ~/conky/TCore1.sh}${offset 2}°C${color}${offset 16}|${offset 16}\
CPU:${offset 8}${if_match ${cpu}<=50}${color7}${else}${if_match ${cpu}<=70}${color8}${else}${if_match ${cpu}>70}${color9}${endif}${endif}${endif}${cpu cpu0}%${color}${offset 8}${loadavg 1}${offset 8}${loadavg 2}${offset 8}${loadavg 3}${offset 16}\
Memory:${offset 8}${if_match ${memperc}<=50}${color7}${else}${if_match ${memperc}<=70}${color8}${else}${if_match ${memperc}>70}${color9}${endif}${endif}${endif}${memperc}%${color}${offset 16}|${offset 16}\
Battery:${offset 8}${execpi 60 acpi -b | awk '{print $3}' | cut -c1-4}${offset 8}${if_match ${battery_percent BAT0}<=15}${color9}${blink ${battery_percent BAT0}%}${color}${else}${if_match ${battery_percent BAT0}<=33}${color8}${battery_percent BAT0}%${else}${if_match ${battery_percent BAT0}>33}${color7}${battery_percent BAT0}%${endif}${endif}${endif}${color}${offset 16}|${offset 16}\
Wlan0:${if_up wlan0}${offset 8}${wireless_bitrate wlan0}${offset 16}${wireless_link_qual wlan0}/${wireless_link_qual_max wlan0}${offset 16}${if_match ${wireless_link_qual_perc wlan0}<=30}${color9}${blink ${wireless_link_qual_perc wlan0}%}${color}${else}${if_match ${wireless_link_qual_perc wlan0}<=50}${color8}${wireless_link_qual_perc wlan0}%${else}${if_match ${wireless_link_qual_perc wlan0}>50}${color7}${wireless_link_qual_perc wlan0}%${endif}${endif}${endif}${color}${offset 16}${if_up wlan0}Up:${offset 8}${upspeedf wlan0}${offset 16}Down:${offset 8}${downspeedf wlan0}${endif}${color}\
${alignr 12}${time %a  %e  %b}

Script for CPU temp -

Code: [Select]
#!/bin/sh
# exec sensors -f | awk '/Core0 Temp/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'
sensors | awk '/Core 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'

The "Core 0" will need to be modified to match your sensor output for each core.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Snap

  • Posts: 490
    • View Profile
Re: Conky Support, Codes and Screenshots
« Reply #398 on: December 06, 2014, 10:39:34 AM »
@jedi mostly.

Please, can you share the code for this conky. This area specifically. I'm a lunatic...



Cool tint2, BTW.


jedi

  • DEFCON 1
  • Posts: 1642
  • Not all those who wander are lost.
    • View Profile
    • NixNut.com
Re: Conky Support, Codes and Screenshots
« Reply #399 on: December 06, 2014, 06:13:07 PM »
Hey Snap!  Been a while since we had a Conky 'Lunatic' in our midst!   ;D  Been a while since I used that particular conky layout.  I'll try to put it back together and post it ASAP!  Glad you liked.  It is not my design, but something I (cough-cough) borrowed from some other Conky Lunatic along the way.   :D
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

VastOne

  •      v-ger
  • Posts: 4226
    • View Profile
    • VSIDO Community
Re: Conky Support, Codes and Screenshots
« Reply #400 on: December 06, 2014, 06:25:19 PM »
Fuck Conky!

(@Snap, this is normal for me and nothing to do with you or your question... you will see these from me all through this forum)
VSIDO      VSIDO FB       

    I dev VSIDO

PackRat

  • Posts: 2290
    • View Profile
    • PackRat configs on github
Re: Conky Support, Codes and Screenshots
« Reply #401 on: December 06, 2014, 06:53:54 PM »
^ you should add:

Code: [Select]
own_window_class Fuck_Conky
to the VSIDO default as a sort of personal signature.  :D
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 4226
    • View Profile
    • VSIDO Community
Re: Conky Support, Codes and Screenshots
« Reply #402 on: December 06, 2014, 06:55:56 PM »
Excellent idea!
VSIDO      VSIDO FB       

    I dev VSIDO

jedi

  • DEFCON 1
  • Posts: 1642
  • Not all those who wander are lost.
    • View Profile
    • NixNut.com
Re: Conky Support, Codes and Screenshots
« Reply #403 on: December 06, 2014, 07:32:51 PM »
@jedi mostly.

Please, can you share the code for this conky. This area specifically. I'm a lunatic...



Cool tint2, BTW.



OK, here goes.  I'll try to get it right.  This is a Conky that is posted in post #374 above, however a couple of minor changes have occured.  The script that creates the horizontal numbered calendar has to use 'mono' type fonts.  Otherwise it will not line up properly and you'll eventually go insane trying to get it right.
You will also need conkyForecast installed for this to work.  It is a great script written by kaivalagi who has apparently fallen off of the Conky world map.
The Conky itself is called 'time'.

time;
Code: [Select]
######################
# - Conky settings - #
######################

background yes
update_interval .3
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
 
double_buffer yes
#no_buffers yes
 
text_buffer_size 1024
#imlib_cache_size 0

minimum_size 950 0
maximum_width 950

gap_x 50
gap_y 58
#####################
# - Text settings - #
#####################
use_xft yes
xftfont monofur:size=15
xftalpha .8
uppercase no
alignment top_left
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class conky-semi
#own_window_argb_visual yes
#own_window_argb_value 255
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
#default_shade_color 292421
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no

#lua_load /home/jed/Conky/LUA/draw_bg.lua
#lua_draw_hook_post draw_bg 10 0 0 0 0 0x5C3434 0.4

TEXT
${execpi 36000 /home/jedi/Conky/Scripts/conkcal.sh}
${font CaviarDreams:size=40}${goto 60}${color 949494}${voffset 15}${time %l:%M %P}
${font CaviarDreams:size=15}${goto 45}${color 3881C7}${voffset -5}${time %A %B %d %Y} ${voffset -95}${color 949494}${font CaviarDreams:size=13}${goto 300}${execpi 1800 conkyForecast --datatype=CC}


${goto 450}${color 3881C7}${font CaviarDreams:size=13}${voffset 40}Current Moon Phase:
${goto 450}${color 949494}${execi 300 conkyForecast --imperial --datatype=MP}
${goto 485}${color 3881C7}${font CaviarDreams:size=13}${execi 1 conkyForecast-SunsetSunriseCountdown  -t} in:
${goto 450}${color 949494}${execi 1 conkyForecast-SunsetSunriseCountdown -L}
${execpi 1800 conkyForecast --location=USME0330 --imperial --template=$HOME/Conky/LUA/day-night2.template}

the 'calendar' script;
Code: [Select]
#!/bin/bash
cd $(dirname $0)
# horizontal and vertical calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# locale depend week day names
DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su")
while getopts ":vl:" opts; do
case "$opts" in
l) lang=$OPTARG;;
v) orientation="$opts";;
esac
done
if [ -f lang ]; then
    . lang
fi
COLOROLD="445566" #MidSlateGrey
COLORTODAY="3881C7" #DeepSkyBlue
COLORREST="445566" #MidSlateGrey
COLORNEXT="778899" #LightSlateGrey
COLORSATURDAY="3881C7" #DeepSkyBlue
COLORSUNDAY="FFA07A" #LightSalmon
COLOR=("" "" "" "" "" "\${color $COLORSATURDAY}" "\${color $COLORSUNDAY}")
COLOREND=("" "" "" "" "" "" "\${color}")

TODAY=$(date +%-d)
LASTDAY=$(date -d "-$TODAY days +1 month" +%d)
FIRSTDAY=$(date -d "-$[$TODAY-1] days" +%u)

# horizontal function
h () {
# Build $TOPLINE
k=$FIRSTDAY
for j in {1..31}; do
  x=$[j+LASTDAY/j]
  case $j in
      ${j/#$x})    TOPLINE="$TOPLINE ${COLOR[$[k-1]]}${DOW[$[k-1]]}${COLOREND[$[k-1]]}";;
      $[LASTDAY+1])    TOPLINE="$TOPLINE \${color $COLORNEXT}${DOW[$[k-1]]}";;
      *)        TOPLINE="$TOPLINE ${DOW[$[k-1]]}";;
  esac
  k=$[${k/#7/0}+1]
done

BOTTOM="\${color $COLOROLD}$(seq -w -s ' ' $LASTDAY|sed "0,/[0-3]*$TODAY \?/s//\${color $COLORTODAY}&\${color $COLORREST}/") \${color $COLORNEXT}$(seq -w -s ' ' 0$[31-$LASTDAY])"

echo "${TOPLINE/# /}"
echo "$BOTTOM\${color}"
}

#vertical function
v () {
for i in $(seq 1 $[TODAY-1]); do
    TODAYC[$i]="\${color $COLOROLD}"
done
TODAYC[$TODAY]="\${color $COLORTODAY}"
for i in $(seq $[TODAY+1] $LASTDAY); do
    TODAYC[$i]="\${color $COLORREST}"
done

k=$FIRSTDAY
for j in $(seq $LASTDAY); do
      echo  "${COLOR[$[k-1]]}${DOW[$[k-1]]} ${TODAYC[$j]}$(printf "%02d" $j)\${color}"
  k=$[${k/#7/0}+1]
done
}

# call function based on "$orientation"
${orientation:-h}

and finally, the template that makes the weather and moon icons appear.
day-night2.template;
Code: [Select]
${image [--datatype=WI --night] -p 305,60 -s 100x100}${image [--location=USME0330 --datatype=MI] -p 455,40 -s 100x100}

All of this was designed for my laptop which has a screen res of 1920x1080.  If your screen resolution is different, you'll need to make some major adjustments.

Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

Snap

  • Posts: 490
    • View Profile
Re: Conky Support, Codes and Screenshots
« Reply #404 on: December 07, 2014, 10:20:16 AM »
Fuck Conky!

Oooops... My bad... I already subscribed to this topic.  :P