develop #40
5 changed files with 65 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ in
|
||||||
imports = [
|
imports = [
|
||||||
./bemenu
|
./bemenu
|
||||||
./dmenu-bluetooth
|
./dmenu-bluetooth
|
||||||
|
./dunst-toggle
|
||||||
./element-desktop
|
./element-desktop
|
||||||
./feh
|
./feh
|
||||||
./kitty
|
./kitty
|
||||||
|
|
@ -135,6 +136,11 @@ in
|
||||||
bind = [ "$mod SHIFT, m, exec, ${terminal} -T ${musicplayer} -e ${musicplayer}" ];
|
bind = [ "$mod SHIFT, m, exec, ${terminal} -T ${musicplayer} -e ${musicplayer}" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
notifications = mkAppAttrs {
|
||||||
|
default = "dunst-toggle";
|
||||||
|
bind = [ "$mod, Backspace, exec, ${notifications}" ];
|
||||||
|
};
|
||||||
|
|
||||||
networksettings = mkAppAttrs {
|
networksettings = mkAppAttrs {
|
||||||
default = "networkmanager_dmenu";
|
default = "networkmanager_dmenu";
|
||||||
bind = [ "$mod SHIFT, n, exec, ${networksettings}" ];
|
bind = [ "$mod SHIFT, n, exec, ${networksettings}" ];
|
||||||
|
|
|
||||||
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
|
||||||
|
'')
|
||||||
|
|
@ -56,6 +56,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
# Add your custom modules here
|
# Add your custom modules here
|
||||||
|
"custom/notifications" = import ./modules/notifications.nix { inherit lib pkgs; };
|
||||||
"custom/newsboat" = import ./modules/newsboat.nix { inherit lib pkgs; };
|
"custom/newsboat" = import ./modules/newsboat.nix { inherit lib pkgs; };
|
||||||
"pulseaudio#input" = import ./modules/pulseaudio/input.nix { inherit lib pkgs; };
|
"pulseaudio#input" = import ./modules/pulseaudio/input.nix { inherit lib pkgs; };
|
||||||
"pulseaudio#output" = import ./modules/pulseaudio/output.nix { inherit lib pkgs; };
|
"pulseaudio#output" = import ./modules/pulseaudio/output.nix { inherit lib pkgs; };
|
||||||
|
|
@ -95,11 +96,13 @@ in
|
||||||
"disk"
|
"disk"
|
||||||
"pulseaudio#input"
|
"pulseaudio#input"
|
||||||
"pulseaudio#output"
|
"pulseaudio#output"
|
||||||
|
"custom/notifications"
|
||||||
"tray"
|
"tray"
|
||||||
];
|
];
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
"custom/newsboat"
|
"custom/newsboat"
|
||||||
|
"custom/notifications"
|
||||||
"hyprland/language"
|
"hyprland/language"
|
||||||
"hyprland/workspaces"
|
"hyprland/workspaces"
|
||||||
"pulseaudio#input"
|
"pulseaudio#input"
|
||||||
|
|
|
||||||
27
modules/home/waybar/modules/notifications.nix
Normal file
27
modules/home/waybar/modules/notifications.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkDefault;
|
||||||
|
dunst = "${pkgs.dunst}/bin/dunstctl";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
format = mkDefault "{icon}";
|
||||||
|
format-icons = {
|
||||||
|
unmuted = mkDefault "";
|
||||||
|
muted = mkDefault "";
|
||||||
|
};
|
||||||
|
return-type = mkDefault "json";
|
||||||
|
exec = mkDefault (
|
||||||
|
pkgs.writeShellScript "notifications" ''
|
||||||
|
is_paused=$(${dunst} is-paused)
|
||||||
|
if [ "$is_paused" = "true" ]; then
|
||||||
|
echo '{"alt": "muted", "class": "muted"}'
|
||||||
|
else
|
||||||
|
echo '{"alt": "unmuted", "class": "unmuted"}'
|
||||||
|
fi
|
||||||
|
''
|
||||||
|
);
|
||||||
|
on-click = mkDefault "dunst-toggle";
|
||||||
|
interval = mkDefault "once";
|
||||||
|
signal = mkDefault 12;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue