mirror of
https://github.com/ItsDrike/nixdots
synced 2025-06-29 22:00:42 +00:00
Add toggle-notifications script & notification keybinds
This commit is contained in:
parent
3cb701b042
commit
b3f457340d
5 changed files with 32 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue