add notification toggle
This commit is contained in:
parent
9a659b4580
commit
6991318eb9
5 changed files with 65 additions and 0 deletions
18
modules/home/hyprland/applications/dunst-toggle/default.nix
Normal file
18
modules/home/hyprland/applications/dunst-toggle/default.nix
Normal 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; }) ];
|
||||
};
|
||||
}
|
||||
|
|
@ -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
|
||||
'')
|
||||
Loading…
Add table
Add a link
Reference in a new issue