Open rtreccani opened 1 year ago
I think ${colors.disabled}
isn't a valid variable in bash. I also use wal, and in .cache/wal/colors.sh
, they're declared as color0
and such. Is that what you actually want to use?
I'm not sure if that's the 'canonical' way that polybar does it, but yeah in my polybar config, i have a block such as
[colors]
urgent = ${xrdb:color4}
disabled = ${xrdb:color5}
primary = ${xrdb:color6}
foreground = ${xrdb:color7}
which just renames the xrdb variables to something more palatable, and then when i want to use it, for example
[module/xworkspaces]
label-active-background = ${colors.background}
label-active-underline= ${colors.disabled}
this works for the polybar modules i'm using so far, so maybe the best option would be
format-muted = ${colors.disabled}
being supported, as it doesn't rely on bash expanding the variable.
Thanks for the quick response and the amazing module btw :)
That won't work because polybar variables can't be set as part of another string. If you use a variable, the entire value has to be the variable, not command ${variable}
, for example. I also ran into this issue, and not sure if I ended up resolving it, because AFAIK in script
modules you can't really have these format-muted
-like custom fields. Maybe you could create a wrapper that reads from the cache pywal script and executes this with the proper variable expanded.
I'm just trying to achieve something similiar to, for example, the default PulseAudio module, see https://github.com/rtreccani/dotfiles/blob/newlap/polybar/config#L168. Forget using Pywal, is it possible to statically set the colour of unmuted vs muted?
I use wal to theme my system, and for most modules I could use something like
format-muted = ${colors.disabled}
to make the module highlight red when muted, or use--color-muted ${colors.disabled}
in my call to the pulseaudio-control bash script, but I get/bin/bash line 1: bad substitution
when I do that. Is there an undocumented way to change the color of the module when muted, or some way to correctly escape the color such that it can be read?