Expand description
External IP address and various information about it
§Configuration
Key | Values | Default |
---|---|---|
format | A string to customise the output of this block. See below for available placeholders. | " $ip $country_flag " |
interval | Interval in seconds for automatic updates | 300 |
with_network_manager | If ‘true’, listen for NetworkManager events and update the IP immediately if there was a change | true |
use_ipv4 | If ‘true’, use IPv4 for obtaining all info | false |
Key | Value | Type | Unit |
---|---|---|---|
ip | The external IP address, as seen from a remote server | Text | - |
version | IPv4 or IPv6 | Text | - |
city | City name, such as “San Francisco” | Text | - |
region | Region name, such as “California” | Text | - |
region_code | Region code, such as “CA” for California | Text | - |
country | Country code (2 letter, ISO 3166-1 alpha-2) | Text | - |
country_name | Short country name | Text | - |
country_code | Country code (2 letter, ISO 3166-1 alpha-2) | Text | - |
country_code_iso3 | Country code (3 letter, ISO 3166-1 alpha-3) | Text | - |
country_capital | Capital of the country | Text | - |
country_tld | Country specific TLD (top-level domain) | Text | - |
continent_code | Continent code | Text | - |
in_eu | Region code, such as “CA” | Flag | - |
postal | ZIP / Postal code | Text | - |
latitude | Latitude | Number | - (TODO: make degrees?) |
longitude | Longitude | Number | - (TODO: make degrees?) |
timezone | City | Text | - |
utc_offset | UTC offset (with daylight saving time) as +HHMM or -HHMM (HH is hours, MM is minutes) | Text | - |
country_calling_code | Country calling code (dial in code, comma separated) | Text | - |
currency | Currency code (ISO 4217) | Text | - |
currency_name | Currency name | Text | - |
languages | Languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix) | Text | - |
country_area | Area of the country (in sq km) | Number | - |
country_population | Population of the country | Number | - |
timezone | Time zone | Text | - |
org | Organization | Text | - |
asn | Autonomous system (AS) | Text | - |
country_flag | Flag of the country | Text (glyph) | - |
§Example
[[block]]
block = "external_ip"
format = " $ip $country_code "
§Notes
All the information comes from https://ipapi.co/json/ Check their documentation here: https://ipapi.co/api/#complete-location5
The IP is queried, 1) When i3status-rs starts, 2) When a signal is received on D-Bus about a network configuration change, 3) Every 5 minutes. This periodic refresh exists to catch IP updates that don’t trigger a notification, for example due to a IP refresh at the router.
Flags: They are not icons but unicode glyphs. You will need a font that includes them. Tested with: https://www.babelstone.co.uk/Fonts/Flags.html