Code Monkey home page Code Monkey logo

Comments (8)

argunot avatar argunot commented on May 29, 2024 1

Thanks! With that example I can get symbols in the bar. Now I just need to configure it for my setup a bit.

Thank you for all the help, I appreciate it. I will close the issue now as my problem is resolved. Although would you possibly consider including your config (or maybe a similar, but simpler one) in the share folder of the repo as an example. The current examples seem outdated and none of them utilize a ConkyGenerator. I assume having a config similar to yours to base their own off of would likely make it easier for others as well.

Of course, This might just be a "me problem" though, and if that is the case feel free to ignore. Either way thanks for the help and the great software.

from barpyrus.

t-wissmann avatar t-wissmann commented on May 29, 2024

Did you select the right characters via /usr/share/siji/view.sh?
Just to double check: are you using the non-xft version of lemonbar? (Because the siji fonts don't work properly here with lemonbar-xft)

from barpyrus.

argunot avatar argunot commented on May 29, 2024

(Because the siji fonts don't work properly here with lemonbar-xft)

Oh, that is good to know about the xft version of lemonbar. I was using regular lemonbar at first then switched to the xft version when the symbols weren't appearing. I kept it because I didn't think there would be a difference while troubleshooting.

To clarify, I have switched back to the standard lemonbar (installed via the AUR) and still have the same problem.

Did you select the right characters via /usr/share/siji/view.sh?

I believe they are the correct codes. I haven't changed them from the original example. I checked some, though.

mail_symb = '\ue1a8' and view.sh shows character 0x00e1a8
vol_off_symb = col_fmt(FG) + '\ue202' and view.sh shows character 0x00e202
etc.

from barpyrus.

t-wissmann avatar t-wissmann commented on May 29, 2024

Do you see the mail icon if you run the following from your terminal?

 { echo -e '\ue1a8' ; cat ; } | lemonbar -B '#FF000000' -d -f '-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1' 

The expected bar (in the top left corner) is:
image

from barpyrus.

argunot avatar argunot commented on May 29, 2024

Oh, wow, yeah I do! What does that mean? The information isn't properly being sent to lemonbar in config.py or lemonbar.py?

from barpyrus.

t-wissmann avatar t-wissmann commented on May 29, 2024

how do you use mail_symb? you need to tell lemonbar to switch to the symbol font. This is done automatically by using painter.symbol(mail_symb) and cg.symbol(mail_symb) (where cg is a ConkyGenerator)

from barpyrus.

argunot avatar argunot commented on May 29, 2024

Ah, okay that seems to be the problem then.
mail_symb is used like this currently:

mail_symb = '\ue1a8'
inbox = os.path.expanduser('~/.mail/INBOX')
mail = col_fmt(AQUA_LIGHT) + mail_symb + col_fmt(FG) + ' ${new_mails %s}/${mails %s}' % (inbox, inbox)

Then mail and the other elements are put in a list then string:

conky_elements = [
    custom,
    mail,
    # wifi,
    volume,
    disk_usage,
    cpu,
    ram,
    # net_down_speed,
    # net_up_speed,
    # battery,
    uptime,
]

Then the string is used in a ConkeyWidget:

bar.widget = W.ListLayout([
...
conky.ConkyWidget(
        text=conky_text,
        config={'update_interval': update_interval},
    ),
...

So I should make a ConkyGenerator for the symbols? Excuse my ignorance but what would the textpainter be in

class ConkyGenerator:

    def __init__(self, textpainter):

when making the object

from barpyrus.

t-wissmann avatar t-wissmann commented on May 29, 2024

You're right, that it is tricky and not very well documented. Here, the textpainter is the painter of lemonbar:

from barpyrus import lemonbar

# ....

cg = conky.ConkyGenerator(lemonbar.textpainter())
with cg.clickable([1], spawn_htop):
    with cg.temp_fg('#B7CE42'):
        cg.symbol(0xe026);
    cg += ' '; cg.var('cpu'); cg += '% '
    with cg.temp_fg('#6F99B4'):
        cg.symbol(0xe021);
    cg += ' '; cg.var('memperc'); cg += '% '

for net in network_devices:
    wireless_icons = [ 0xe218, 0xe219, 0xe21a ]
    wireless_delta = 100 / len(wireless_icons)
    with cg.if_('up %s' % net):
        cg.fg('#FEA63C')
        if net[0] == 'w':
            with cg.cases():
                for i,wicon in enumerate(wireless_icons[:-1]):
                    cg.case('match ${wireless_link_qual_perc %s} < %d' % (net,(i+1)*wireless_delta))
                    cg.symbol(wicon)
                cg.else_()
                cg.symbol(wireless_icons[-1]) # icon for 100 percent
        else:
            cg.symbol(0xe197) # normal wired icon
        cg.fg('#D81860') ; cg.symbol(0xe13c) ; cg.fg('#CDCDCD') ; cg.var('downspeed %s' % net)
        cg.fg('#D81860') ; cg.symbol(0xe13b) ; cg.fg('#CDCDCD') ; cg.var('upspeed %s' % net)
cg.drawRaw('%{F-}%{B-}')

The code above is from my personal barpyrus config

from barpyrus.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.