From 9495f989b422158e42c2fae954e34729e4adacdb Mon Sep 17 00:00:00 2001 From: KAGEYAM4 <75798544+KAGEYAM4@users.noreply.github.com> Date: Tue, 18 Nov 2025 22:03:02 +0530 Subject: [PATCH] =?UTF-8?q?hyprpm:=20remove=20-nn=20flag=20and=20make=20no?= =?UTF-8?q?tification=20behaviour=20more=20consist=E2=80=A6=20(#11272)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [hyprpm] Remove -nn flag and make notification behaviour more consistent. Before -> -nn turns on -n explicitly, and many notify() are ran without checking the flag. After -> warning and error notification will always work, -n will only give visual confirmation that plugin loaded successfully, eye candy. * [hyprpm] Add -nn breaking change fallback to nofity users. Added deprecation warning for the --notify-fail flag. --- hyprpm/src/main.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/hyprpm/src/main.cpp b/hyprpm/src/main.cpp index 47a557e2..777d1d46 100644 --- a/hyprpm/src/main.cpp +++ b/hyprpm/src/main.cpp @@ -25,8 +25,8 @@ constexpr std::string_view HELP = R"#(┏ hyprpm, a Hyprland Plugin Manager ┃ ┣ Flags: ┃ -┣ --notify | -n → Send a hyprland notification for important events (including both successes and fail events). -┣ --notify-fail | -nn → Send a hyprland notification for fail events only. +┣ --notify | -n → Send a hyprland notification confirming successful plugin load. +┃ Warnings/Errors trigger notifications regardless of this flag. ┣ --help | -h → Show this menu. ┣ --verbose | -v → Enable too much logging. ┣ --force | -f → Force an operation ignoring checks (e.g. update -f). @@ -47,7 +47,7 @@ int main(int argc, char** argv, char** envp) { } std::vector command; - bool notify = false, notifyFail = false, verbose = false, force = false, noShallow = false; + bool notify = false, verbose = false, force = false, noShallow = false; std::string customHlUrl; for (int i = 1; i < argc; ++i) { @@ -58,7 +58,9 @@ int main(int argc, char** argv, char** envp) { } else if (ARGS[i] == "--notify" || ARGS[i] == "-n") { notify = true; } else if (ARGS[i] == "--notify-fail" || ARGS[i] == "-nn") { - notifyFail = notify = true; + // TODO: Deprecated since v.053.0. Remove in version>0.56.0 + std::println(stderr, "{}", failureString("Deprececated flag.")); + g_pPluginManager->notify(ICON_INFO, 0, 10000, "[hyprpm] -n flag is deprecated, see hyprpm --help."); } else if (ARGS[i] == "--verbose" || ARGS[i] == "-v") { verbose = true; } else if (ARGS[i] == "--no-shallow" || ARGS[i] == "-s") { @@ -149,8 +151,9 @@ int main(int argc, char** argv, char** envp) { if (ret2 != LOADSTATE_OK) return 1; - } else if (notify) + } else { g_pPluginManager->notify(ICON_ERROR, 0, 10000, "[hyprpm] Couldn't update headers"); + } } else if (command[0] == "enable") { if (command.size() < 2) { std::println(stderr, "{}", failureString("Not enough args for enable.")); @@ -194,19 +197,17 @@ int main(int argc, char** argv, char** envp) { auto ret = g_pPluginManager->ensurePluginsLoadState(force); if (ret != LOADSTATE_OK) { - if (notify) { - switch (ret) { - case LOADSTATE_FAIL: - case LOADSTATE_PARTIAL_FAIL: g_pPluginManager->notify(ICON_ERROR, 0, 10000, "[hyprpm] Failed to load plugins"); break; - case LOADSTATE_HEADERS_OUTDATED: - g_pPluginManager->notify(ICON_ERROR, 0, 10000, "[hyprpm] Failed to load plugins: Outdated headers. Please run hyprpm update manually."); - break; - default: break; - } + switch (ret) { + case LOADSTATE_FAIL: + case LOADSTATE_PARTIAL_FAIL: g_pPluginManager->notify(ICON_ERROR, 0, 10000, "[hyprpm] Failed to load plugins"); break; + case LOADSTATE_HEADERS_OUTDATED: + g_pPluginManager->notify(ICON_ERROR, 0, 10000, "[hyprpm] Failed to load plugins: Outdated headers. Please run hyprpm update manually."); + break; + default: break; } return 1; - } else if (notify && !notifyFail) { + } else if (notify) { g_pPluginManager->notify(ICON_OK, 0, 4000, "[hyprpm] Loaded plugins"); } } else if (command[0] == "purge-cache") {