X-Git-Url: http://git.roojs.org/?p=gitlive;a=blobdiff_plain;f=Gitlive.vala;h=e3ded34248340933fdef46f7ce1c730bd183e130;hp=97694f74b0617d0b22e5681cdc4af48834b5691e;hb=0f3fc898b3f425daec52bf023f8ba31f64b54d4c;hpb=976253096103c86f28f79a6ef194c7019da04bbb diff --git a/Gitlive.vala b/Gitlive.vala index 97694f74..e3ded342 100644 --- a/Gitlive.vala +++ b/Gitlive.vala @@ -1,33 +1,70 @@ /* - valac --pkg gio-2.0 --pkg posix --pkg gtk+-3.0 - GitLive.vala \ + valac --pkg gio-2.0 --pkg posix --pkg gtk+-3.0 --pkg libnotify --pkg libwnck-3.0 \ + Gitlive.vala \ Monitor.vala \ GitMonitor.vala \ Spawn.vala \ StatusIcon.vala \ GitRepo.vala \ - -o /tmp/Gitlive - + xorg_idletime.c \ + WindowLog.vala \ + --Xcc=-lXss \ + --Xcc=-DWNCK_I_KNOW_THIS_IS_UNSTABLE \ + -o /tmp/Gitlive && /tmp/Gitlive +*/ static int main (string[] args) { - // A reference to our file - //var file = File.new_for_path ("data.txt"); - MainLoop loop = new MainLoop (); - print("starting"); - var m = new Monitor(); + + //GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL); + + GLib.Log.set_handler(null, + GLib.LogLevelFlags.LEVEL_DEBUG | GLib.LogLevelFlags.LEVEL_WARNING | GLib.LogLevelFlags.LEVEL_INFO, + (dom, lvl, msg) => { + + + // should we debug.. + + + print("%s\n", msg); + } + ); + + + Gtk.init (ref args); - m.add("/home/alan/gitlive"); - m.start(); - loop.run (); + GitMonitor.gitlive = Environment.get_home_dir() + "/gitlive"; + + print("GitMonitor.gitlive=" + GitMonitor.gitlive); + + Notify.init("gitlive"); + + new StatusIconA(); + var gm = new GitMonitor(); + + + Timeout.add_full(Priority.LOW, 500, () => { + // this should start after we have shown the icon... + print("adding GitMonitor.gitlive: " + GitMonitor.gitlive); + gm.add(GitMonitor.gitlive); + print("gm.start()"); + gm.start(); + + new WindowLog(); + + return false; + + }); + + Gtk.main (); return 0;