From 8b8d24c4b1f99f7b245aff2bf6aa9cf621cb62fc Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 30 Oct 2022 22:02:00 +0100 Subject: [PATCH] Add shortcut for toggling dunst idle mode --- home/.config/hypr/hyprland.conf | 1 + .../bin/scripts/gui/hyprland/toggle-notifications | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100755 home/.local/bin/scripts/gui/hyprland/toggle-notifications diff --git a/home/.config/hypr/hyprland.conf b/home/.config/hypr/hyprland.conf index 9be9060..3e9a83c 100644 --- a/home/.config/hypr/hyprland.conf +++ b/home/.config/hypr/hyprland.conf @@ -107,6 +107,7 @@ bind = SUPER_SHIFT, Q, exec, menuprompt --yesno -p "Quit Hyprland?" && hyprctl d bind = SUPER_CTRL, L, exec, swaylock -fF bind = SUPER_SHIFT, L, exec, wlogout -p layer-shell bind = SUPER_SHIFT, T, exec, toggle-idle +bind = SUPER_SHIFT, D, exec, toggle-notifications # Programs bind = SUPER, Return, exec, alacritty diff --git a/home/.local/bin/scripts/gui/hyprland/toggle-notifications b/home/.local/bin/scripts/gui/hyprland/toggle-notifications new file mode 100755 index 0000000..c4fb7f4 --- /dev/null +++ b/home/.local/bin/scripts/gui/hyprland/toggle-notifications @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ "$(dunstctl is-paused)" = "false" ]; then + notify-send "Notifications" "Pausing notifications..." -h string:x-canonical-private-synchronous:notif-pause + sleep 2 + dunstctl set-paused true +else + dunstctl set-paused false + notify-send "Notifications" "Notifications enabled" -h string:x-canonical-private-synchronous:notif-pause +fi