i3status-rust
i3status-rust copied to clipboard
Trimming the length of the IP address
Sorry if I missed that, but I would like to trim my IP address from 192.168.1.101
-> 101
.
I guess this does not have to apply to the net block only, but it should be a string formatting capability...?
Does something like this exist...? I would be happy if I could even just trim to any fixed length from the end too, like: "1.101"
@MaxVerevkin, @GladOSkar I had a quick look through #1304 again but I don't think this one has been discussed yet. I guess it's kinda like max_width but from the opposite direction.
I guess it's kinda like max_width but from the opposite direction.
Yes, pretty much. Any suggestions on which modifier to add?
Maybe consider ip4
and ip6
separate data types from num
/str
and have max_width
be in octets/hextets from the right respectively?
Then again there's probably also a valid use case for only displaying the subnet part. TBH this is too niche of a use case for the general formatter IMO.
Maybe consider ip4 and ip6 separate data types from num/str and have max_width be in octets/hextets from the right respectively?
Yeah, that's probably better.
A note on this one in case someone implements it. Please don't assume it's always going to be right to left - for example for external IP addresses you probably care about the left bytes more than you do about the right ones.