greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.88k stars 475 forks source link

Option to set padding #377

Closed kepi closed 3 years ago

kepi commented 5 years ago

Is there any way how to add padding (left, right and between icon and text) to blocks?

i3status-rust-want-padding

IMHO it is more aesthetic to have padding around icons and between block. My monitor is wide enough and I'm not sure why icons should be so close to text.

atheriel commented 5 years ago

It is not currently possible to do this for blocks without a format key.

Dieterbe commented 4 years ago

sorry for the offtopic but @kepi would you mind sharing how you achieved that separator? I suggest in ticket #809 to keep the conversations focused. thanks!

ammgws commented 3 years ago

A few blocks have had format keys added since this issue was first raised. Also, you should be able to override the icons and add the spaces yourself. Otherwise, not sure what else we can do.

kepi commented 3 years ago

A few blocks have had format keys added since this issue was first raised. Also, you should be able to override the icons and add the spaces yourself. Otherwise, not sure what else we can do.

If this was meant like "we don't want to fix it", I'm ok with that. But if this isn't the case and you really are not sure what to do, than I probably didn't explain the issue properly.

We simply need new option on level of [theme] or something similar in "global" scope to change padding of every icon. It would be best to be able to specify left and right padding or margin (not sure about implementation) for all icons at once.

I really can't image why would I override the icons myself. I'm using a computer to do things for me, not other way :) And I'm aware that it would be faster to override every icon in my config (that means find what is original icon, add it to config and add some space...) than to create this feature request. But IMHO there are others who wants this and its not OK to waste so many men-hours on something which can be solved (if it is doable).

I originally talked also about padding between blocks, but it can be fixed with them override in separator, so not as needed as icon padding/margin.

Something like this would be great.

[theme.override]
icons-padding-right = 5
icons-padding-left = 10
GladOSkar commented 3 years ago

@kepi We generally don't have pixel-perfect control over the bar display since the i3bar protocol is entirely text-based. Adding spaces to icons is the way padding is usually done in the current codebase.

We could maybe (ab)use the separator_block_width from the i3bar protocol or some weird pango formatting for this, but those could become messy and might mess with the background colors.

Edit: Just tried separator_block_width and it doesn't work because we can't set the background. Pretty sure pango would be too much of a mess. I agree with @ammgws that pixel-based padding is technically not possible.

What might be possible is a universal 1-space (or maybe even unicode half-space etc.) icon padding.

More thoughts:

ammgws commented 3 years ago

981 might be useful if "icon_fmt" is introduced

kepi commented 3 years ago

@GladOSkar thanks for detailed explanation. I can think about some workarounds if we don't have pixel perfect control like the number would be number of spaces. But I believe that #981 @ammgws mentioned would be easier to implement and probably even simpler to setup. It would also resolve the case with icons inside widget text you mentioned.

Thanks again too both of you for information. I'll subscribe to #981 and hope that icon_fmt is introduced some day.

ammgws commented 3 years ago

I believe this is solved since #1095 and #1112 were merged.