add notification toggle
All checks were successful
Flake check / flake-check (pull_request) Successful in 22s
Build tests / build-hosts (pull_request) Successful in 29s

This commit is contained in:
sid 2026-05-10 23:24:41 +02:00
parent 9a659b4580
commit 6991318eb9
5 changed files with 65 additions and 0 deletions

View file

@ -58,6 +58,7 @@ in
imports = [
./bemenu
./dmenu-bluetooth
./dunst-toggle
./element-desktop
./feh
./kitty
@ -135,6 +136,11 @@ in
bind = [ "$mod SHIFT, m, exec, ${terminal} -T ${musicplayer} -e ${musicplayer}" ];
};
notifications = mkAppAttrs {
default = "dunst-toggle";
bind = [ "$mod, Backspace, exec, ${notifications}" ];
};
networksettings = mkAppAttrs {
default = "networkmanager_dmenu";
bind = [ "$mod SHIFT, n, exec, ${networksettings}" ];

View file

@ -0,0 +1,18 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.wayland.windowManager.hyprland;
app = cfg.applications.notifications.default;
inherit (lib) mkIf;
in
{
config = mkIf (cfg.enable && app == "dunst-toggle") {
home.packages = [ (import ./dunst-toggle.nix { inherit config pkgs; }) ];
};
}

View file

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
let
dunst = "${pkgs.dunst}/bin/dunstctl";
pkill = "${pkgs.procps}/bin/pkill";
signal = "${toString config.programs.waybar.settings.mainBar."custom/notifications".signal}";
in
(pkgs.writeShellScriptBin "dunst-toggle" ''
${dunst} set-paused toggle
${pkill} -RTMIN+${signal} waybar
'')