pinwheel: Extract dunst to module
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
./modules/hyprland
|
||||
./modules/waybar
|
||||
./modules/swaylock
|
||||
./modules/dunst
|
||||
./modules/bemenu
|
||||
./modules/syncthing
|
||||
./modules/firefox
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
home.username = "alex";
|
||||
home.homeDirectory = "/home/alex";
|
||||
|
||||
services.dunst.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
gnumake
|
||||
tig
|
||||
|
||||
42
hosts/pinwheel/modules/dunst/default.nix
Normal file
42
hosts/pinwheel/modules/dunst/default.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home-manager.users.alex = {
|
||||
services.dunst = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
global = {
|
||||
width = 300;
|
||||
height = 300;
|
||||
offset = "10x50";
|
||||
origin = "top-right";
|
||||
transparency = 10;
|
||||
frame_color = "#a57b06";
|
||||
font = "DejaVuSansM Nerd Font Mono 14";
|
||||
};
|
||||
|
||||
urgency_low = {
|
||||
background = "#222222";
|
||||
foreground = "#888888";
|
||||
timeout = 10;
|
||||
};
|
||||
|
||||
urgency_normal = {
|
||||
background = "#262626";
|
||||
foreground = "#f9c22b";
|
||||
timeout = 10;
|
||||
};
|
||||
|
||||
urgency_critical = {
|
||||
background = "#900000";
|
||||
foreground = "#ffffff";
|
||||
frame_color = "#ff0000";
|
||||
timeout = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [ pkgs.libnotify ];
|
||||
};
|
||||
}
|
||||
@@ -23,6 +23,17 @@ let
|
||||
fi
|
||||
'';
|
||||
|
||||
notifications-status = pkgs.writeShellScript "notifications-status" ''
|
||||
if ${pkgs.dunst}/bin/dunstctl is-paused | grep -q "false"; then
|
||||
echo ;
|
||||
else
|
||||
DISABLED=
|
||||
COUNT=$(${pkgs.dunst}/bin/dunstctl count waiting)
|
||||
[ $COUNT != 0 ] && DISABLED=" $COUNT"
|
||||
echo $DISABLED
|
||||
fi
|
||||
'';
|
||||
|
||||
toggle-bt-power = pkgs.writeShellScript "toggle-bt-power" ''
|
||||
POWERED_ON=$(bluetoothctl show | grep "Powered: yes")
|
||||
if [ -z "$POWERED_ON" ]; then
|
||||
@@ -49,7 +60,7 @@ in
|
||||
];
|
||||
|
||||
modules-left = [ "hyprland/workspaces" ];
|
||||
modules-right = [ "custom/spotify" "bluetooth" "wireplumber" "network" "battery" "clock" ];
|
||||
modules-right = [ "custom/spotify" "custom/dunst" "bluetooth" "wireplumber" "network" "battery" "clock" ];
|
||||
|
||||
"custom/spotify" = {
|
||||
exec = spotify-status;
|
||||
@@ -57,6 +68,13 @@ in
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
"custom/dunst" = {
|
||||
exec = notifications-status;
|
||||
on-click-right = "${pkgs.dunst}/bin/dunstctl set-paused toggle";
|
||||
interval = 1;
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
bluetooth = {
|
||||
"format-off" = "";
|
||||
"format-on" = "";
|
||||
@@ -117,7 +135,7 @@ in
|
||||
background-color: ${background};
|
||||
}
|
||||
|
||||
#custom-spotify, #bluetooth, #wireplumber, #network, #battery, #clock {
|
||||
#custom-spotify, #custom-dunst, #bluetooth, #wireplumber, #network, #battery, #clock {
|
||||
margin: 0 12px;
|
||||
}
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user