Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(mpd): Get format-online-{prefix,suffix} explicitly (#1399)#1402

Merged
NBonaparte merged 1 commit into
polybar:masterfrom
TonCherAmi:1399-format-online-fix
Sep 1, 2018
Merged

fix(mpd): Get format-online-{prefix,suffix} explicitly (#1399)#1402
NBonaparte merged 1 commit into
polybar:masterfrom
TonCherAmi:1399-format-online-fix

Conversation

@TonCherAmi

Copy link
Copy Markdown
Contributor

Resolves #1399

This is directly related to #868.
I should note that both this fix as well as #868 result in
format-{playing,paused,stopped} options being ignored if the same format-online options have been specified, though I guess it is preferable to config breakage.

Sorry for causing this mess in the first place, my bad.

@NBonaparte NBonaparte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could get rid of the try/catch blocks by using load_optional_label() and have an empty string for the fallback.

@TonCherAmi

Copy link
Copy Markdown
Contributor Author

@NBonaparte I would argue that they need to be loaded as required, because if the assignment always succeeds it then overwrites format-{playing,...}-{suffix,prefix} without any regard for whether format-online-{prefix,suffix} has actually been specified, please correct me if I am wrong.

@NBonaparte

Copy link
Copy Markdown
Member

Whoops, I meant to say to use mod_format->{prefix,suffix} as the fallback, so it would always load the previous value if it failed.

@TonCherAmi

Copy link
Copy Markdown
Contributor Author

@NBonaparte yeah, I've thought of that as well, but it seems to be possible for them to be nullptr and if we have to check for that, it kind of defeats the purpose, in my opinion.

@NBonaparte

Copy link
Copy Markdown
Member

All right, I guess this is the best way then. Hopefully we can have multiple inheritance implemented soon so we can avoid these hacky workarounds.

@NBonaparte NBonaparte merged commit 68ae7a8 into polybar:master Sep 1, 2018
@TonCherAmi TonCherAmi deleted the 1399-format-online-fix branch September 1, 2018 07:50
@patrick96

Copy link
Copy Markdown
Member

Do I understand this correctly that format-online-prefix, if defined, always overwrites format-playing-prefix?

@TonCherAmi

Copy link
Copy Markdown
Contributor Author

@patrick96 yes, as well as format-{paused,stopped}-prefix. Same thing with all of the attributes really.

@patrick96

Copy link
Copy Markdown
Member

Oh, you're right, I thought it would only use the format-online attributes when they are not defined, but it seems that is impossible.

patrick96 added a commit that referenced this pull request Dec 23, 2018
### Breaking Changes:
None

### Changelog

**New Config Options**
The following config options were added

In the `[settings]` section:
* `pseudo-transparency`

In `internal/cpu`:
* `ramp-coreload-spacing`, spacing between elements in `<ramp-coreload>` elements
* `%percentage-sum%` in `label`. Shows sum of all percentages

In `custom/script`:
* `double-click-left`
* `double-click-middle`
* `double-click-right`

In `internal/pulseaudio`:
* `interval`, volume increase and decrease steps in percentage points

In `internal/memory`:
* `bar-swap-used`
* `bar-swap-free`
* `ramp-swap-used`
* `ramp-swap-free`

**Deprecations**
* `tray-transparent` in the bar section is no longer used. The tray now always uses pseudo-transparency

**Features**
* volume: adjustable volume steps (#1364), see #1361
* memory: Add progress bars and ramps for swap (#1325)
* render: pseudo-transparency (always used in the tray)  (#595)
* cpu: 
    * Configurable spacing in between coreloads (#1472), see #1389
    * Non-normalized cpu load (#1517), see #1516
* script: Double click actions (#1442)
* net: Support for bridge interfaces (#1528), see #1522
* token: zero pad tokens when min-width value starts with a `0` (#1341), see #1332

**Fixes**
* config: Use font patterns detected on system in sample config (#1350)
* net: Disconnected module when SSID is only an emoji (#1371), see #1367
* tray: Tray overlapping with bar (#1392), see #591
* build: Several build errors (#1395, #1454, #1470, polybar/xpp#12, #1493), see #1447, #1469, #750, #1492
* mpd: format-online-prefix not working (#1402), see #1399
* font: Crash for some font-patterns (#1451), see #1435
* script: 
    * Only `%counter%` or `%pid%` token usable, never both (#1456)
    * click actions with colons in them (#1457), see #984
* renderer: Bar locks up when xorg composite extension is disabled (#1430), see #1425
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[internal/mpd] format-prefix-online and format-suffix-online do not display

3 participants