Skip to content

command line control #11

@skibz

Description

@skibz

i wrote an awfully simple node script for controlling the icon...

#!/usr/bin/env node

var dgram = require('dgram'),
    anybarSocket = dgram.createSocket('udp4'),
    message = new Buffer(process.argv[2]);

anybarSocket.send(
  message,
  0,
  message.length,
  process.argv[3] || 1738,
  'localhost',
  function() {
    process.exit();
  }
);

if you chmod +x scriptname then you can ./scriptname question or ./scriptname question 1234.

i'm not sure if this is useful for anyone, but i got a little tired of doing echo -n "color" | nc blah blah...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions