Giter Club home page Giter Club logo

alfred-ip-address-workflow's Introduction

alfred-ip-address-workflow

Screenshot

An Alfred 5 workflow for getting your local and external IP addresses.

Installation

  1. Download the workflow
  2. Double click the .alfredworkflow file to install
  3. (Optional) Specify which external IP service you would like to use (see below for more details)

Note that the Alfred Powerpack is required to use workflows.

External IP services

In order to get your external IPv4 and IPv6 addresses, the workflow must query an external IP service. By default, the workflow uses icanhazip.com, but any service that returns your external IP in plaintext will work. The following is a non-exhaustive list of free services that you can use. Some of these may be blocked by your firewall or ISP.

To configure the service used:

  1. Open Alfred preferences
  2. Click Workflows on the left
  3. Select the IP Address workflow
  4. Click the Configure Workflow button in the header of the workflow builder
  5. Enter the HTTP/HTTPS address of the service
  6. Click Save

Usage

  1. Use the keyword ip to trigger the workflow
  2. Select IP you would like to copy or paste (local IPv4, external IPv4, local IPv6, external IPv6)
  3. Press enter to copy to clipboard and paste into the forefront application or just ⌘ + c to copy to clipboard

License

Code released under the MIT License.

alfred-ip-address-workflow's People

Contributors

alexchantastic avatar hugows avatar jeroenj avatar roshanca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alfred-ip-address-workflow's Issues

Error on multiple ip's

If the computer has multiple IP's (in my case because of virtual machines running on my computer) the workflow just fails. I've fixed it in a quite hacky way for now by replacing the local ipv4 line with

ifconfig | grep 'inet ' | grep -Fv 127.0.0.1 | head -n 1 | awk '{print $2}'

When I get time i'll get on doing a nicer fix and creating a pull request if no one bets me to it :)

JSON error if multiple local addresses

I have multiple local addresses, the debug console gives me this:

[2018-08-20 13:20:24][ERROR: input.scriptfilter] JSON error: Unescaped control character around character 54. in JSON:
{"items": [

	{
		"title": "Local IPv4: 192.168.141.91
192.168.143.155
169.254.241.90",
		"subtitle": "Press enter to paste or ⌘C to copy",
		"arg": "192.168.141.91
192.168.143.155
169.254.241.90"
	},

	{
		"title": "External IPv4: xxx.xxx.xxx.xxx",
		"subtitle": "Press enter to paste or ⌘C to copy",
		"arg": "xxx.xxx.xxx.xxx"
	},

	{
		"title": "Local IPv6: fe80::c6f:4428:7e31:5e23",
		"subtitle": "Press enter to paste or ⌘C to copy",
		"arg": "fe80::c6f:4428:7e31:5e23"
	},

	{
		"title": "External IPv6: xxx.xxx.xxx.xxx",
		"subtitle": "Press enter to paste or ⌘C to copy",
		"arg": "xxx.xxx.xxx.xxx"
	}

]}

Probably need to replace \r\n with , ?

Add network interface info

It would be great to see which network interface is associated with each IP.

In terms of formatting, I'm thinking something like:

Local IPv4 (en0): 192.168.0.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.