waybar: move notifications to middle

This commit is contained in:
Vinzenz Schroeter 2025-11-14 02:05:29 +01:00
parent 3066bce807
commit de330e6334
2 changed files with 11 additions and 5 deletions

View file

@ -1,6 +1,8 @@
{ {
services.swaync = { services.swaync = {
enable = true; enable = true;
settings = { }; settings = {
positionX = "center";
};
}; };
} }

View file

@ -26,16 +26,17 @@
spacing = "8"; spacing = "8";
modules-left = [ modules-left = [
"niri/workspaces" "niri/workspaces"
"tray"
"niri/window" "niri/window"
]; ];
modules-center = [ modules-center = [
"privacy" "privacy"
"clock" "clock"
"custom/swaync"
]; ];
modules-right = [ modules-right = [
#"image" #"image"
"group/status-infos" "group/status-infos"
"tray"
"group/system-tray" "group/system-tray"
"group/group-power" "group/group-power"
]; ];
@ -49,7 +50,6 @@
"backlight" "backlight"
"network" "network"
"power-profiles-daemon" "power-profiles-daemon"
"custom/swaync"
"idle_inhibitor" "idle_inhibitor"
]; ];
}; };
@ -136,24 +136,28 @@
urgency ? null, urgency ? null,
body ? null, body ? null,
icon ? null, icon ? null,
category ? null,
}: }:
let let
body-part = if body != null then "'${body}'" else ""; body-part = if body != null then "'${body}'" else "";
urgency-part = if urgency != null then "--urgency ${urgency}" else ""; urgency-part = if urgency != null then "--urgency ${urgency}" else "";
icon-part = if icon != null then "--icon ${icon}" else ""; icon-part = if icon != null then "--icon ${icon}" else "";
category-part = if category != null then "--category ${category}" else "";
in in
"${lib.getBin pkgs.libnotify}/bin/notify-send ${urgency-part} ${icon-part} '${summary}' ${body-part}"; "${lib.getBin pkgs.libnotify}/bin/notify-send ${urgency-part} ${icon-part} ${category-part} '${summary}' ${body-part}";
in in
{ {
on-discharging-warning = mkNotifySendCommand { on-discharging-warning = mkNotifySendCommand {
summary = "Low Battery"; summary = "Low Battery";
icon = "battery-caution"; icon = "battery-caution";
category = "device";
}; };
on-discharging-critical = mkNotifySendCommand { on-discharging-critical = mkNotifySendCommand {
urgency = "critical"; urgency = "critical";
summary = "Very Low Battery"; summary = "Very Low Battery";
body = "Connect to power <i>now</i>!"; body = "Connect to power <i>now</i>!";
icon = "battery-low"; icon = "battery-low";
category = "device";
}; };
}; };
}; };
@ -287,7 +291,7 @@
in in
{ {
tooltip = true; tooltip = true;
format = "{0}{icon} "; format = "{icon} {0} ";
format-icons = { format-icons = {
notification = "󱅫"; notification = "󱅫";
none = "󰂜"; none = "󰂜";