Skip to content
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

net block: extraneous spaces around IP address #498

Closed
majewsky opened this issue Jan 2, 2020 · 11 comments
Closed

net block: extraneous spaces around IP address #498

majewsky opened this issue Jan 2, 2020 · 11 comments

Comments

@majewsky
Copy link
Contributor

majewsky commented Jan 2, 2020

I have two net blocks for my physical interfaces, and I've set them up so that it only shows the IP address:

icons = "none"

[theme]
name = "slick"
[theme.overrides]
idle_bg = "#000000"
alternating_tint_bg = "#444444"
separator = ""

[[block]]
block = "net"
device = "enp2s0" # or "wlp4s0" for wireless
ip = true
hide_inactive = true

ssid = false
signal_strength = false
bitrate = false
speed_up = false
speed_down = false
graph_up = false
graph_down = false

The layout looks fine for a disconnected interface, but when an IP has shown, it has unpleasant extra spaces around it:

foo

i3status-rust is version 0.12, the compositor is Sway 1.2 with the following bar config:

bar {
    position top
    font pango:Hack 12
    height 28
    status_command i3status-rs /path/to/i3status-rust.toml
    tray_padding 0

    colors {
        ...
    }
}
@ammgws
Copy link
Collaborator

ammgws commented Jan 16, 2020

Do the same spaces appear for the non-wireless device block as well?

@majewsky
Copy link
Contributor Author

If it's connected, yes. Also, the WiFi block has the correct spacing when not connected, like the ethernet block in the screenshot above.

@ammgws
Copy link
Collaborator

ammgws commented Jan 16, 2020

What about when you set ip to false and SSID to true (when it's connected)?

@ammgws
Copy link
Collaborator

ammgws commented Jan 16, 2020

OK so I just submitted #505 and #507 which should improve the situation.

Unfortunately you will still end up with two spaces between each part of the net block apart from the end one, because each part (ip, SSID, etc) has its own ButtonWidget, and ButtonWidget pads its text with spaces before (if no icon) and after. So if two ButtonWidgets are displayed side by side you end up with two spaces between them...

@atheriel
Copy link
Collaborator

I think @ammgws has done what we can for now.

@amitlevy21
Copy link

image
image

@ammgws can anything be done to remove the spaces marked in the red boxes?

@ammgws
Copy link
Collaborator

ammgws commented Aug 14, 2020

Can you share your config for the net block?

@amitlevy21
Copy link

Sure!

[theme]
name = "solarized-dark"

[theme.overrides]
idle_fg = "#FFFFFF"
alternating_tint_bg = "#0088CC"

[icons]
name = "awesome5"

[icons.overrides]
net_wired = ""
net_wireless = ""

[[block]]
block = "net"
device = "wlp0s26u1u5"
speed_up = true
speed_down = true
interval = 5

@ammgws
Copy link
Collaborator

ammgws commented Aug 14, 2020

Have you tried overriding the net_down and net_up icons? By default they have a space around them.

@amitlevy21
Copy link

image
You're right, I simple override them with the icon but without any space and it fixed it. Thanks!

Being a little picky here, there is still a small space (left to the net_up icon) can I do anything to get rid of it? (if not that's totally OK, I'm being too picky here)

@ammgws
Copy link
Collaborator

ammgws commented Aug 14, 2020

See #468 and #377

At some stage I hope we can come up with a solution

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

4 participants