mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 06:24:35 +00:00
Add toggle-notifications script & notification keybinds
This commit is contained in:
parent
3cb701b042
commit
b3f457340d
|
@ -74,8 +74,11 @@
|
|||
#
|
||||
# Notifications
|
||||
#
|
||||
# TODO: Requires notification daemon (dunst?)
|
||||
|
||||
"CTRL, grave, exec, dunstctl close"
|
||||
"CTRL_SHIFT, grave, exec, dunstctl close-all"
|
||||
"CTRL, period, exec, dunstctl history-pop"
|
||||
"CTRL_SHIFT, period, exec, dunstctl context"
|
||||
"SUPER_SHIFT, D, exec, toggle-notifications"
|
||||
|
||||
#
|
||||
# Window groups
|
||||
|
|
|
@ -20,6 +20,7 @@ in {
|
|||
hyprPkgs.hyprland-screenshot
|
||||
hyprPkgs.quick-record
|
||||
hyprPkgs.toggle-fake-fullscreen
|
||||
hyprPkgs.toggle-notifications
|
||||
hyprPkgs.brightness
|
||||
pkgs.brightnessctl
|
||||
pkgs.hyprpicker
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
hyprland-screenshot = pkgs.callPackage ./hyprland-screenshot {};
|
||||
quick-record = pkgs.callPackage ./quick-record {};
|
||||
toggle-fake-fullscreen = pkgs.callPackage ./toggle-fake-fullscreen {};
|
||||
toggle-notifications = pkgs.callPackage ./toggle-notifications {};
|
||||
};
|
||||
in
|
||||
packages
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
{pkgs, ...}:
|
||||
pkgs.writeShellApplication {
|
||||
name = "toggle-notifications";
|
||||
runtimeInputs = with pkgs; [
|
||||
coreutils
|
||||
libnotify
|
||||
dunst
|
||||
];
|
||||
text = ''
|
||||
${builtins.readFile ./toggle-notifications.sh}
|
||||
'';
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -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
|
Loading…
Reference in a new issue