This commit is contained in:
Hadi
2024-08-24 17:09:12 +02:00
parent 109f31151d
commit 1255919f41
5 changed files with 152 additions and 66 deletions

View File

@@ -0,0 +1,119 @@
{ pkgs, config, ... }: {
home.packages = with pkgs; [ libnotify ];
services.swaync = {
enable = true;
settings = {
positionX = "right";
positionY = "top";
control-center-margin-top = 15;
control-center-margin-bottom = 15;
control-center-margin-right = 15;
control-center-margin-left = 15;
notification-icon-size = 32;
notification-body-image-height = 50;
notification-body-image-width = 50;
timeout-low = 5;
timeout = 10;
timeout-critical = 0;
fit-to-screen = true;
control-center-width = 500;
notification-window-width = 400;
keyboard-shortcuts = true;
image-visibility = "when-available";
transition-time = 200;
hide-on-clear = false;
hide-on-action = true;
script-fail-notify = true;
widgets = [
"inhibitors"
"title"
"buttons-grid"
"mpris"
"volume"
"backlight"
"dnd"
"notifications"
];
widget-config = {
title = {
text = "Notification Center";
clear-all-button = true;
button-text = "󰆴 Clear All";
};
dnd = { text = "Do Not Disturb"; };
# label = {
# max-lines = 1;
# text = "Notification Center";
# };
mpris = {
image-size = 96;
image-radius = 7;
};
volume = { label = "󰕾"; };
backlight = { label = "󰃟"; };
"buttons-grid" = {
"actions" = [
{
"label" = "󰐥";
"command" = "systemctl poweroff";
}
{
"label" = "󰜉";
"command" = "systemctl reboot";
}
{
"label" = "󰒲";
"command" = "systemctl suspend";
}
{
"label" = "󰌾";
"command" = "${pkgs.hyprlock}/bin/hyprlock";
}
{
"label" = "󰍃";
"command" = "${pkgs.hyprland}/bin/hyprctl dispatch exit";
}
{
"label" = "󰕾";
"command" =
"${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
}
{
"label" = "󰍬";
"command" =
"${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
}
{
"label" = "󰂯";
"command" = "${pkgs.blueman}/bin/blueman-manager";
}
{
"label" = "󰹑";
"command" =
"${pkgs.grimblast}/bin/grimblast --notify --freeze --wait 1 copysave area ~/Pictures/$(date +%Y-%m-%dT%H%M%S).png";
}
{
"label" = "";
"command" = "${pkgs.kooha}/bin/kooha";
}
];
};
};
};
style = ''
* {
font-family: ${config.var.theme.font};
}
'';
};
}

View File

@@ -34,12 +34,13 @@
modules-center = [ "hyprland/workspaces" ];
modules-right = [
"tray"
"backlight"
"pulseaudio"
# "backlight"
# "pulseaudio"
"custom/caffeine"
"custom/night-shift"
"battery"
"clock"
"custom/notification"
"custom/power"
];
@@ -117,6 +118,27 @@
on-click = "menu";
};
"custom/notification" = {
tooltip = false;
format = "{} {icon}";
"format-icons" = {
notification = "󱅫";
none = "";
"dnd-notification" = " ";
"dnd-none" = "󰂛";
"inhibited-notification" = " ";
"inhibited-none" = "";
"dnd-inhibited-notification" = " ";
"dnd-inhibited-none" = " ";
};
"return-type" = "json";
"exec-if" = "which swaync-client";
exec = "swaync-client -swb";
"on-click" = "sleep 0.1 && swaync-client -t -sw";
"on-click-right" = "sleep 0.1 && swaync-client -d -sw";
escape = true;
};
battery = {
format = "{capacity}% {icon}";
"format-icons" = {
@@ -239,6 +261,7 @@
#memory,
#custom-power,
#custom-notification,
#custom-caffeine,
#custom-night-shift,
#battery,