8000 Maxlen ignored - mpd · Issue #971 · polybar/polybar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Maxlen ignored - mpd #971

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

Closed
ghost opened this issue Jan 21, 2018 · 3 comments
Closed

Maxlen ignored - mpd #971

ghost opened this issue Jan 21, 2018 · 3 comments

Comments

@ghost
Copy link
ghost commented Jan 21, 2018

I tried setting both label-maxlen and specific label lengths but they are ignored..

ncmpcpp 0.8.1
mpd 0.20.15

image

@patrick96
Copy link
Member

There is no label-online, try to use label-song-maxlen instead. But it's strange that the %title:0:10% token doesn't work. Can you post your whole configuration so that I can try to reproduce this on my end.

@ghost
Copy link
Author
ghost commented Jan 23, 2018

edit2: apparently I can't use label-song-maxlen because it counts the %{A1:command:} .. %{A} part as well.. but it's just a guess. The problem here is the presence of the A1 tag. If I remove it everything works, both label-song-maxlen and label-specific length

edit: the error occurs when I wrap my labels in this
%{A1:echo %artist% - %title% | clipboard.sh && notify-send "COPIED TO CLIPBOARD" "%artist% - %title%":}%artist:0:15% - %title:0:10%%{A}

here's the whole config http://paste.debian.net/hidden/65ef2936/

if I try to set label-song-maxlen this happens

image

@patrick96 patrick96 added the bug label Jan 23, 2018
@patrick96
Copy link
Member

Yes the -maxlen option counts all characters, it can't differentiate between format tags and plain text.
I am now able to reproduce this, it seems not the format tags are the problem but the fact that you use the same token twice. From my testing I think polybar just takes the min and maxlen properties of the first time the token appears and uses it for all other occurences as well.

In the following two versions, the first one makes both tokens only display at most three characters and in the second variant, both tokens are displayed in full.

label-song = %title:0:3% %title% 
label-song = %title% %title:0:3% 

patrick96 added a commit to patrick96/polybar that referenced this issue Jan 23, 2018
When using the same token multiple times in the same label with
different length properties, polybar would always use the settings for
the first token. This now replaces the tokens one by one, so that a new
token object is used for the length settings each time a token is used
again. Because the token objects are added in order, the replacement
always uses the right token object for the token that is replaced.

Fixes polybar#971
patrick96 added a commit to patrick96/polybar that referenced this issue Jan 27, 2018
When using the same token multiple times in the same label with
different length properties, polybar would always use the settings for
the first token. This now replaces the tokens one by one, so that a new
token object is used for the length settings each time a token is used
again. Because the token objects are added in order, the replacement
always uses the right token object for the token that is replaced.

Fixes polybar#971
NBonaparte pushed a commit that referenced this issue Jan 28, 2018
When using the same token multiple times in the same label with
different length properties, polybar would always use the settings for
the first token. This now replaces the tokens one by one, so that a new
token object is used for the length settings each time a token is used
again. Because the token objects are added in order, the replacement
always uses the right token object for the token that is replaced.

Fixes #971
patrick96 added a commit that referenced this issue Jul 23, 2018
Breaking Changes:

* `0 < label-NAME-maxlen < 3` will now throw an exception and disable the containing module, if ellipsis is enabled for that label. (#1198)

Changelog:

Deprecations:
* `internal/volume` is now called `internal/alsa` (#967)
* temperature: The `%temperature%` is deprecated in favor of `%temperature-c%`(#897)
* mpd: `icon-repeatone` is deprecated in favor of `icon-single` (#1295), see #1279

Features:
* feat(mpd): Add support for icon-consume (#861)
* feat(bspwm): Add workspace separator (#942) 
* feat(i3): Add workspace separator (#938), see #929
* feat(build): Make polybar build on FreeBSD (#931, polybar/xpp#8), see #239
* feat(volume): Add pulseaudio backend (#779)
* feat(script): Add %pid% token for tail commands (#934)
* feat(temp): Add temperature tokens without unit (#897)
* feat(memory): Add memory used/free ramp (#1038), see #1037
* feat(memory): Add swap tokens (#1018) 
* feat(net): Add unknown-as-up option (#1077), see #457
* feat(config): Support fractional size and offset (#972), see #953
* feat(xwindow): Add label-empty (#1136)
* feat(battery): Add animation-discharging (analog to animation-charging) (#1190)
* feat(config): Support pixel offset for bar size and offset values (#1224)
* feat(mpd): Add `%album-artist%` token (#1263)
* feat(net): Add local_ip6 token (#1239), see #1234
* feat(net): Add nl80211 support (#1009), see #277

Fixes:
* fix(mpd): Wrong elapsed time when after standby (#921), see #915
* fix(config): Wrong min, maxlen when using the same token multiple times (#974), see #971
* fix(battery): use power_now correctly (#958), see #928
* fix(mpd): Crash when mpd isn't running (#983), see #979
* fix(xworkspaces): Respect 'enable-scroll' (#1002)
* fix(xbacklight): Respect 'enable-scroll' (#1014)
* fix(build): support xcb-proto >=1.13 (polybar/xpp#11), see #973
* fix(mpd): Respect MPD_HOST env variable (#1025), see #1007
* fix(i3): Reconnect i3 IPC socket on restart/error (#1099), see #762
* fix(cursor): Occasional crash on mouseover (#1124), see #1117
* fix(net): Mark 'not connected' on querying failure (#1171), see #1163
* fix(gcc): Fix -Wstringop-truncation warning (#1216, polybar/i3ipcpp#7), see #1215
* fix(builder): Don't truncate colors with same channels (#1217), see #1183
* fix(bspwm): Consistent behavior when scrolling through multiple desktops (#986), see #981
* fix(builder): Respect label-ellipsis option (#1198), see #1194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0