Added swap memory support for bar-used#1325
Conversation
| bool memory_module::build(builder* builder, const string& tag) const { | ||
| if (tag == TAG_BAR_USED) { | ||
| builder->node(m_bar_memused->output(m_perc_memused)); | ||
| string m_type = m_conf.get<decltype(m_type)>(name(), "bar-used-type", "RAM"); |
There was a problem hiding this comment.
This retrieves the variable from the config every single time the module is built, which isn't very efficient. It would be better if m_type was set from the initialization and only checked in build(), or create a new tag like TAG_BAR_USED_SWAP altogether.
Added swap support for ramp as well
|
Will this be merged? |
|
The only issue with this method is that RAM and swap memory can't both be displayed in the same module. I'm not sure how many people would have this use case though. @patrick96 do you think having both types available would be better? |
|
Example config: |
|
Thank you @roel0 , currently works only with your fork, right? |
|
@maxdevjs correct |
|
Why not use |
|
@NBonaparte @patrick96 done |
Codecov Report
@@ Coverage Diff @@
## master #1325 +/- ##
=========================================
- Coverage 5.84% 5.83% -0.02%
=========================================
Files 161 161
Lines 8918 8935 +17
=========================================
Hits 521 521
- Misses 8397 8414 +17
Continue to review full report at Codecov.
|
|
Much better! Code looks good, will run it with some configurations in a few days just to make sure. |
|
Thanks for contributing! |
Now all the tokens in the memory module also have ramp and bar counterparts. These can be used exactly the same as `bar-used` and `ramp-used`, they are named `<bar-swap-used>`, `<bar-swap-free>`, `<ramp-swap-used>`, and `<ramp-swap-free>`
### 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


bar-used currently only supports internal memory, added support to have a bar for swap