$(function() {

  var ghost = $("#ghost");

  function setup_ghost() {
    ghost.attr("src", CONF.ghost.asset.default);
    change_ghost_size();
  }

  function change_ghost_size() {
    ghost.css({width: CONF.ghost.size});
  }

  var cc = setInterval(function() {
    if (CONF) {
      window.electron.ipcRenderer.send('ghostconf-message', JSON.stringify(CONF));
      clearInterval(cc);
    }
  }, 500);

  setup_ghost();

});
