From ae1c933dc246b7b8a459b469fb605ec4cd1a98b1 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Fri, 16 Jun 2023 23:05:53 -0400 Subject: [PATCH] Setup swaynotificationcenter --- configs/hyprland.conf | 3 ++ home-manager/linux/programs/hyprland.nix | 40 ++++++------------------ 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/configs/hyprland.conf b/configs/hyprland.conf index 64afebd..6424f73 100644 --- a/configs/hyprland.conf +++ b/configs/hyprland.conf @@ -119,6 +119,9 @@ bind = SHIFT, print, exec, grimblast copysave output ~/Pictures/Screenshots/$(da # Caps lock indicator bindr = CAPS, caps_lock, exec, swayosd --caps-lock +# Notif bind +bind = $mainMod, T, exec, swaync-client -t -sw + # systemd integration exec-once=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && sleep 2 && systemctl --user start hyprland-session.target diff --git a/home-manager/linux/programs/hyprland.nix b/home-manager/linux/programs/hyprland.nix index 4405d14..a204e77 100644 --- a/home-manager/linux/programs/hyprland.nix +++ b/home-manager/linux/programs/hyprland.nix @@ -8,7 +8,8 @@ in with lib; { ${swaylock-package}/bin/swaylock --screenshots --grace 30 --indicator --clock --timestr "%-I:%M:%S %p" --datestr "%A %Y-%M-%d" --effect-blur 20x3''; fuzzel-command = '' fuzzel -f "Iosevka Sans Quasi" -b "181818dd" -S "b9b9b9ff" -s "252525dd" -t "777777ff" -B 5 -r 5 -C "70b433dd"''; - wob-package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.wob; + notif-package = + inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.swaynotificationcenter; in { home.packages = with pkgs; [ # Locking and display management @@ -19,7 +20,7 @@ in with lib; { wl-clipboard cliphist # Notifications - mako + notif-package # Terminal alacritty # glib for sound stuff @@ -115,41 +116,17 @@ in with lib; { Install = { WantedBy = [ "graphical-session.target" ]; }; }; ######################### - ## Mako (notifications) + ## SwayNotificationCenter (notifications) ######################### - services.mako = { - enable = true; - # Selenized color scheme - borderColor = "#f275be"; - backgroundColor = "#184956"; - textColor = "#adbcbc"; - # Border configuration - borderSize = 3; - # Use Iosevka for font - font = "Iosevka Sans Quasi 10"; - # Group by application - groupBy = "app-name"; - # Bottom right corner - anchor = "bottom-right"; - # Maximum visible notifications - maxVisible = 10; - # Sort by time in descending order (newest first) - sort = "-time"; - # Don't time out notifications , I want to have to dismiss them - defaultTimeout = 0; - ignoreTimeout = true; - }; - systemd.user.services.mako = { + systemd.user.services.swaync = { Unit = { - Description = "mako notification daemon"; + Description = "SwayNotificationCenter"; After = [ "graphical-session.target" ]; }; Service = { Type = "simple"; - ExecStart = '' - ${pkgs.mako}/bin/mako - ''; - Restart = "always"; + ExecStart = "${notif-package}/bin/swaync"; + Restart = "on-failure"; }; Install = { WantedBy = [ "graphical-session.target" ]; }; }; @@ -178,6 +155,7 @@ in with lib; { ######################### ## Waybar ######################### + # https://github.com/DN-debug/waybar-examples/tree/main/waybar-examples/sway programs.waybar = { enable = true; package =