pinwheel: Extract dunst to module
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
./modules/hyprland
|
./modules/hyprland
|
||||||
./modules/waybar
|
./modules/waybar
|
||||||
./modules/swaylock
|
./modules/swaylock
|
||||||
|
./modules/dunst
|
||||||
./modules/bemenu
|
./modules/bemenu
|
||||||
./modules/syncthing
|
./modules/syncthing
|
||||||
./modules/firefox
|
./modules/firefox
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
home.username = "alex";
|
home.username = "alex";
|
||||||
home.homeDirectory = "/home/alex";
|
home.homeDirectory = "/home/alex";
|
||||||
|
|
||||||
services.dunst.enable = true;
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
gnumake
|
gnumake
|
||||||
tig
|
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
|
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" ''
|
toggle-bt-power = pkgs.writeShellScript "toggle-bt-power" ''
|
||||||
POWERED_ON=$(bluetoothctl show | grep "Powered: yes")
|
POWERED_ON=$(bluetoothctl show | grep "Powered: yes")
|
||||||
if [ -z "$POWERED_ON" ]; then
|
if [ -z "$POWERED_ON" ]; then
|
||||||
@@ -49,7 +60,7 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
modules-left = [ "hyprland/workspaces" ];
|
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" = {
|
"custom/spotify" = {
|
||||||
exec = spotify-status;
|
exec = spotify-status;
|
||||||
@@ -57,6 +68,13 @@ in
|
|||||||
tooltip = false;
|
tooltip = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"custom/dunst" = {
|
||||||
|
exec = notifications-status;
|
||||||
|
on-click-right = "${pkgs.dunst}/bin/dunstctl set-paused toggle";
|
||||||
|
interval = 1;
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
|
||||||
bluetooth = {
|
bluetooth = {
|
||||||
"format-off" = "";
|
"format-off" = "";
|
||||||
"format-on" = "";
|
"format-on" = "";
|
||||||
@@ -117,7 +135,7 @@ in
|
|||||||
background-color: ${background};
|
background-color: ${background};
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-spotify, #bluetooth, #wireplumber, #network, #battery, #clock {
|
#custom-spotify, #custom-dunst, #bluetooth, #wireplumber, #network, #battery, #clock {
|
||||||
margin: 0 12px;
|
margin: 0 12px;
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user