From f22f3f9504c83aea4f7cb0d97c8701c6f02af48d Mon Sep 17 00:00:00 2001 From: Nikolay Brovko Date: Sun, 26 Jan 2020 21:56:04 +0300 Subject: [PATCH] add yggdrasil service watcher (update every 1s, think about freq) --- src/application.vala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/application.vala b/src/application.vala index 2d5e868..f21e670 100644 --- a/src/application.vala +++ b/src/application.vala @@ -77,7 +77,7 @@ namespace Yggtk { } } - private void display_current_service_state () { + private bool display_current_service_state () { try { if (window != null) { window.set_service_state (yggdrasil_service.get_status ()); @@ -85,6 +85,8 @@ namespace Yggtk { } catch (SpawnError e) { stderr.printf ("Unable to get service state: %s\n", e.message); } + + return true; } private void update_yggtk () { @@ -130,6 +132,7 @@ namespace Yggtk { window = new AppWindow (this); } display_current_service_state (); + Timeout.add_seconds (1, display_current_service_state); window.show (); }