From 587cbf31889f1e26d818e36915cfe0577dc0272f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Mon, 9 Aug 2021 11:49:30 +0200 Subject: [PATCH] cli: Fix changing global profile For that we must not set a default event. --- cli/fbcli.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cli/fbcli.c b/cli/fbcli.c index ee26bfd..89571e5 100644 --- a/cli/fbcli.c +++ b/cli/fbcli.c @@ -160,14 +160,15 @@ main (int argc, char *argv[0]) return 1; } - if (!name) - name = g_strdup (DEFAULT_EVENT); - - g_timeout_add_seconds (watch, (GSourceFunc)on_watch_expired, NULL); if (profile && !name) success = set_profile (profile); - else + else { + if (!name) + name = g_strdup (DEFAULT_EVENT); + + g_timeout_add_seconds (watch, (GSourceFunc)on_watch_expired, NULL); success = trigger_event (name, profile, timeout); + } lfb_uninit (); return !success;