8000 Mixed References And Text in Config Values · Issue #954 · polybar/polybar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Mixed References And Text in Config Values #954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
budRich opened this issue Jan 12, 2018 · 4 comments · May be fixed by #1237 or #1938
Open

Mixed References And Text in Config Values #954

budRich opened this issue Jan 12, 2018 · 4 comments · May be fixed by #1237 or #1938

Comments

@budRich
Copy link
budRich commented Jan 12, 2018

I load my font information from xresources.
.Xresources: budstyle.font: FixedFixedsys

polybarconfig:
this works:
font-0 = ${xrdb:budstyle.font:monospace}

these two doesn't work:
font-0 = ${xrdb:budstyle.font:monospace};2 font-0 = ${xrdb:budstyle.font:monospace}:size=12:antialias=false;1

Is there some workaround other then accepting no styling or harcoding the font?

@patrick96
Copy link
Member

If you use a ${...} variable in a parameter, that variables has to be the only thing in that parameter specifier. I agree this is quite annoying, I use a bash script to concatenate the necessary values and put them all in a single environment variable which I then can use inside the config like this:

${env:...:fallback}

However for the xrdb values this can prove more difficult.

It should probably be possible to mix those variables with other symbols inside a parameter, I'll mark this as a feature request.

@budRich
Copy link
Author
budRich commented Jan 13, 2018

Cool. And sure i could make a "super variable" either environment or xresources. The problem is though that if i would update the font in xresources i would have to generate a new super variable. And that kind of defeats the purpose of using xresources a a one stop goto for setting fonts/colors/etc.

I hope the feature will be considered, and i guess there are more usecases then this where it would be useful. Maybe add some kind of concatenation method in polybar itself... font = ${oldvar:newstuff}

@patrick96
Copy link
Member

If you wrote a bash script that reads your xresources and writes the proper font settings inside an env variable then you wouldn't need to manually update the font in two places, but writing this bash script is probably the biggest hassle.

You're right there are a bunch of usecases for this, I have had to create a lot of extra variables inside a bash script because polybar couldn't do this kind of concatenation.
The way I think, we should solve this, is to have polybar support settings like this:

key = some stuff ${env:VAR} some more

And even let multiple variables appear in a single assignment.

@BVollmerhaus
Copy link

The way I think, we should solve this, is to have polybar support settings like this:

key = some stuff ${env:VAR} some more

And even let multiple variables appear in a single assignment.

This would be fantastic to have and it would be great if it would also work in format strings. That way one could, for example, use color variables to color individual parts of a string, i.e., "%{F${color.myvar}}..."

@patrick96 patrick96 changed the title Setting font from variable disables further font options Mixed References And Text in Config Values Feb 14, 2021
@patrick96 patrick96 added this to the 3.7.0 milestone Feb 14, 2021
@patrick96 patrick96 modified the milestones: 3.7.0, 3.8.0 Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
0