From fdc951ea0b31026d875e0191778679178ecb8126 Mon Sep 17 00:00:00 2001 From: Jannis Petschenka Date: Tue, 10 Oct 2023 19:20:54 +0200 Subject: [PATCH] Add env variable for toggle button --- src/controlCenter/widgets/shared/toggleButton.vala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controlCenter/widgets/shared/toggleButton.vala b/src/controlCenter/widgets/shared/toggleButton.vala index dd2cd228..a7811aee 100644 --- a/src/controlCenter/widgets/shared/toggleButton.vala +++ b/src/controlCenter/widgets/shared/toggleButton.vala @@ -14,8 +14,10 @@ namespace SwayNotificationCenter.Widgets { this.toggled.connect (on_toggle); } - private void on_toggle (Gtk.ToggleButton tb) { - BaseWidget.execute_command (command); + private async void on_toggle () { + string msg = ""; + string[] env_additions = { "SWAYNC_TOGGLE_STATE="+this.active.to_string () }; + yield Functions.execute_command (this.command, env_additions, out msg); } } }