treewide: move swaync to a separate file

This commit is contained in:
Anthony Rodriguez 2024-11-18 12:07:10 +01:00
parent 56feb3e570
commit c214e2c40b
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
3 changed files with 85 additions and 60 deletions

View file

@ -1,46 +1,16 @@
{
config,
lib,
inputs,
pkgs,
...
}: let
inherit (lib) mkForce;
inherit (lib) mkIf;
icon_size = 28;
swayncStyle = pkgs.fetchurl {
url = "https://github.com/catppuccin/swaync/releases/download/v0.2.3/macchiato.css";
sha256 = "sha256-LMm6nWn1JPPgj5YpppwFG3lXTtXem5atlIvqrDxd0bM=";
};
in {
imports = [inputs.ironbar.homeManagerModules.default];
home.packages = [pkgs.procps];
services.swaync = {
enable = true;
style = swayncStyle;
settings = {
positionX = "right";
positionY = "top";
layer = "overlay";
control-center-layer = "top";
layer-shell = true;
cssPriority = "application";
control-center-margin-top = 0;
control-center-margin-bottom = 0;
control-center-margin-right = 0;
control-center-margin-left = 0;
notification-2fa-action = true;
notification-inline-replies = false;
notification-icon-size = 64;
notification-body-image-height = 100;
notification-body-image-width = 200;
};
};
systemd.user.services.swaync = {
Install.WantedBy = mkForce ["graphical-session.target"];
Unit.ConditionEnvironment = mkForce "";
Unit.PartOf = lib.mkForce ["graphical-session.target"];
};
imports = [
./swaync.nix
inputs.ironbar.homeManagerModules.default
];
programs.ironbar = {
enable = true;
systemd = true;
@ -111,22 +81,13 @@ in {
type = "upower";
format = "{percentage}%";
}
{
type = "volume";
format = "{icon} {percentage}%";
max_volume = 100;
icons = {
volume_high = "󰕾";
volume_medium = "󰖀";
volume_low = "󰕿";
muted = "󰝟";
};
}
{type = "clock";}
{
type = "tray";
inherit icon_size;
}
(mkIf
config.services.swaync.enable
{
type = "notifications";
"show_count" = true;
@ -138,7 +99,7 @@ in {
"open_some" = "󱥁";
"open_dnd" = "󱅮";
};
}
})
];
};
style = ''

64
home/programs/swaync.nix Normal file
View file

@ -0,0 +1,64 @@
{
pkgs,
lib,
...
}: let
inherit (lib) mkForce;
swayncStyle = pkgs.fetchurl {
url = "https://github.com/catppuccin/swaync/releases/download/v0.2.3/macchiato.css";
sha256 = "sha256-LMm6nWn1JPPgj5YpppwFG3lXTtXem5atlIvqrDxd0bM=";
};
in {
home.packages = [pkgs.procps];
services.swaync = {
enable = true;
style = swayncStyle;
settings = {
positionX = "right";
positionY = "top";
layer = "overlay";
control-center-layer = "top";
layer-shell = true;
cssPriority = "application";
control-center-margin-top = 0;
control-center-margin-bottom = 0;
control-center-margin-right = 0;
control-center-margin-left = 0;
notification-2fa-action = true;
notification-inline-replies = false;
notification-icon-size = 64;
notification-body-image-height = 100;
notification-body-image-width = 200;
widgets = [
"title"
"dnd"
"mpris"
"notifications"
"volume"
];
widget-config = {
title = {
text = "Notifications";
clear-all-button = true;
button-text = "󰩹";
};
dnd = {
text = "Do Not Disturb";
};
mpris = {
blur = true;
};
volume = {
label = "󰓃";
show-per-app = false;
};
};
};
};
systemd.user.services.swaync = {
Install.WantedBy = mkForce ["graphical-session.target"];
Unit.ConditionEnvironment = mkForce "";
Unit.PartOf = lib.mkForce ["graphical-session.target"];
};
}

View file

@ -34,7 +34,7 @@ in {
"${home}/services/udiskie.nix"
"${home}/programs/niri"
"${home}/programs/ironbar"
"${home}/programs/ironbar.nix"
"${home}/programs/fuzzel.nix"
"${home}/programs/swaybg.nix"
"${home}/programs/swaylock.nix"