philer / polycore

A conky config and library of Lua widgets

Home Page:https://philer.github.io/polycore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected right margin not filled in by frame

the-allanc opened this issue · comments

I've been trying to use Polycore to replicate an existing setup I have that makes use of a Lua script to draw boxes (it's quite old, but I think I initially took the code from here.

My initial experimentation seems to be stuck because I'm trying to draw a text widget in a frame to fill the entire width - but it seems to leave 12 pixels on the right. While the settings for Conky specify a maximum width of 200, if I I print out the value of conky_window.width in cairo_helpers.create_cr, it prints out a value of 212. text_width is 200.

I don't know where the extra 12 pixels are coming from - I don't mind necessarily that it's bigger than I expected (I'm sure that's a Conky decision rather than a Polycore one), it would be good if Polycore could fill in the entire size of the Conky window. I know it must be doable (I don't have the same problem with the existing Lua script I use), but I can't figure out how to get Polycore to do it.

I've included a screenshot of what I'm getting, and a stripped down version of the text.lua example that produces it. Any idea how I could achieve what I'm after (either by stripping out those 12 pixels, or getting Polycore to fill it)?

Screenshot from 2023-02-09 13-54-39
baretext.lua.txt

Hey, I ran into a similar issue today after updating my setup. Turns out that conky nowadays attempts to use DPI scaling which kind of makes the values you set for min/max width/height meaningless. See brndnmtthws/conky#1083

I fixed it for myself by settings Xft.dpi to 96 (actually, I just deleted it from my ~/.Xresources).

That's not really a solution for screens with a high DPI, though. I that case you'd probably have to use something like what was suggested in this comment (the relevant bindings were added in this PR). I'm not sure if there's a way to fix the DPI in conky besides compiling without XFT – maybe they could add a setting for it.

Not sure I would have realised it was that kind of issue - so thanks for sharing those links. I ended up using a negative offset for gap_x to hide those pixels, so that'll work for me for now - but at least I know where to look if I want to fix it properly in future. 😄