From e36d9805bf13ebcf2438ba03a6f5781d40bd9d8c Mon Sep 17 00:00:00 2001 From: Viyurz Date: Tue, 22 Oct 2024 11:12:07 +0200 Subject: [PATCH] Show informative notification when notifications are re-enabled --- .config/eww/eww.yuck | 2 +- .config/eww/scripts/toggle-nf-state.sh | 7 +++++++ .config/hypr/hyprland.d/bindings.conf | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 .config/eww/scripts/toggle-nf-state.sh diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck index 0b4d078..706959f 100644 --- a/.config/eww/eww.yuck +++ b/.config/eww/eww.yuck @@ -55,7 +55,7 @@ ) (defwidget nf-state [] - (eventbox :onclick "makoctl mode -t dnd" + (eventbox :onclick "~/.config/eww/scripts/toggle-nf-state.sh" (label :text "${nf-enabled ? "󰂚" : "󰂛"} NF" :class "${nf-enabled ? "" : "disabled"}" ) diff --git a/.config/eww/scripts/toggle-nf-state.sh b/.config/eww/scripts/toggle-nf-state.sh new file mode 100755 index 0000000..00480f6 --- /dev/null +++ b/.config/eww/scripts/toggle-nf-state.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +makoctl mode -t dnd + +if ! makoctl mode | grep -q dnd; then + notify-send "Notifications enabled" +fi diff --git a/.config/hypr/hyprland.d/bindings.conf b/.config/hypr/hyprland.d/bindings.conf index 7cd14e1..d0c6b3e 100644 --- a/.config/hypr/hyprland.d/bindings.conf +++ b/.config/hypr/hyprland.d/bindings.conf @@ -8,7 +8,7 @@ binde = $mainMod_SHIFT, V, togglesplit, bind = $mainMod, L, exec, loginctl lock-session bind = $mainMod, F, fullscreen -bind = $mainMod_SHIFT, N, exec, makoctl mode -t dnd +bind = $mainMod_SHIFT, N, exec, $HOME/.config/eww/scripts/toggle-nf-state.sh bind = $mainMod, R, exec, wofi --show run bind = $mainMod, E, exec, thunar binde = $mainMod_SHIFT, T, exec, kitty