This commit is contained in:
2025-08-30 00:16:25 +03:00
parent ce487380f5
commit 5debf9d8fa
3 changed files with 32 additions and 5 deletions

View File

@@ -94,6 +94,7 @@ in {
libnotify
playerctl
wl-clipboard-rs # wl-clipboard in rust
xfce.xfconf
];
xdg = {
@@ -161,6 +162,9 @@ in {
Service.TimeoutStopSec = mkForce "1";
Service.Restart = mkForce "always";
};
xfce4-notifyd = mkGraphicalService {
Service.ExecStart = pkgs.xfce.xfce4-notifyd + "/lib/xfce4/notifyd/xfce4-notifyd";
};
# xwayland-satellite = mkGraphicalService {
# Service = {
# Type = "simple";

View File

@@ -173,11 +173,34 @@ in {
dnd-none = "󰂛";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "swaync-client -t -sw";
on-click-right = "swaync-client -d -sw";
exec =
pkgs.writeShellApplication {
name = "xfce-notifyd-waybar";
runtimeInputs = with pkgs; [sqlite xfce.xfconf coreutils];
text =
# bash
''
is_dnd=$(xfconf-query -c xfce4-notifyd -p /do-not-disturb)
notifications_count=$(sqlite3 ~/.cache/xfce4/notifyd/log.sqlite "SELECT count(*) FROM notifications WHERE NOT is_read")
if [[ "$notifications_count" -ne 0 ]]; then
icon="notification"
else
icon="none"
fi
if [[ "$is_dnd" == "true" ]]; then
icon="dnd-$icon"
fi
printf '{"text": "%s", "alt": "%s"}' "$notifications_count" "$icon"
'';
}
+ "/bin/xfce-notifyd-waybar";
on-click = "xfconf-query -c xfce4-notifyd -p /do-not-disturb -T";
on-click-right = lib.getExe pkgs.xfce.xfce4-notifyd;
escape = true;
signal = 1;
};
"privacy" = {
icon-spacing = 0;

View File

@@ -14,7 +14,7 @@ lib.attrsets.recursiveUpdate {
kanshi = import ./kanshi;
network-manager-applet.enable = true;
playerctld.enable = true;
swaync = import ./swaync;
# swaync = import ./swaync;
swayosd.enable = true;
udiskie.enable = true;
wpaperd.enable = true;