network

command module
v0.0.0-...-dffe54d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 13 Imported by: 0

README

Network plugin

Gives you info about network stuff, such as your public IP address and such.

How to configure the plugin

Configure it in in ~/.gowerline/gowerline.yaml in the plugin[].config field like so:

# ipService needs to just return your ip address with nothing
# else. Otherwise, it would fail.
# Known to work are:
#  * https://checkip.amazonaws.com/
#  * https://ifconfig.me/ip
ipService: https://checkip.amazonaws.com/

⚠ ⚠ Please put a sample YOUR_PLUGIN_NAME.yaml file in this directory, it will get coppied to the user's install in case the plugin has never been installed.

⚠ Your configuration file should very much be named YOUR_PLUGIN_NAME.yaml.

Example powerline configuration

This is how you display your public IP

{
    "function": "gowerline.gowerline.gwl",
    "priority": 60,
    "args": {
        "function": "public_ip",
    }
}

This is how you get the address of an interface

{
    "function": "gowerline.gowerline.gwl",
    "priority": 60,
    "args": {
        "function": "interface_ip",
        "interface": "eth0"
    }
}

You can use default for the default IP address. A best effort attempt is going to be the following to determine what it is, it will take the first ip address of the first interface that has a default route on it. It should work for most of the setups most of the time.

This is how you get the local hostname

{
    "function": "gowerline.gowerline.gwl",
    "priority": 60,
    "args": {
        "function": "hostname"
    }
}

Highlight groups used

Every highlight group should default to information:regular when no other is available.

Highlight group Description
gwl:public_ip Your public IP address
gwl:interface_ip The ip of a given interface

Miscellaneous

None yet

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL