From 56d8cafe6962114b4973d3e18da34961563ff889 Mon Sep 17 00:00:00 2001 From: Leonhard Date: Sun, 12 Jan 2025 15:16:05 +0100 Subject: [PATCH] HotCorners: Fix custom action if there's only one (#2220) Co-authored-by: Leo --- src/HotCorners/HotCornerManager.vala | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/HotCorners/HotCornerManager.vala b/src/HotCorners/HotCornerManager.vala index 7712c5d05..f98940b97 100644 --- a/src/HotCorners/HotCornerManager.vala +++ b/src/HotCorners/HotCornerManager.vala @@ -92,20 +92,16 @@ public class Gala.HotCornerManager : Object { private void run_custom_action (string hot_corner_position) { string command = ""; var line = behavior_settings.get_string ("hotcorner-custom-command"); - if (line == "") + if (line == "") { return; + } var parts = line.split (";;"); - // keep compatibility to old version where only one command was possible - if (parts.length == 1) { - command = line; - } else { - // find specific actions - foreach (unowned var part in parts) { - var details = part.split (":"); - if (details[0] == hot_corner_position) { - command = details[1]; - } + // find specific actions + foreach (unowned var part in parts) { + var details = part.split (":", 2); + if (details[0] == hot_corner_position) { + command = details[1]; } }