Giter Club home page Giter Club logo

alfred-ip-address-workflow's Issues

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

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 :)

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.