tonsky/AnyBar

command line control

skibz opened this issue · 3 comments

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...

I also created a small client in go ( #12 ), which might be helpful for those people that don't have Node installed.

Added list of alternative clients to README.md