Compare commits

..

2 commits

4 changed files with 157 additions and 123 deletions

View file

@ -1,152 +1,173 @@
{ {
osConfig,
pkgs, pkgs,
lib, lib,
osConfig,
config,
... ...
}: let }: let
inherit (lib) getExe; inherit (lib) getExe mkMerge mkIf;
in { in {
imports = [./style.nix]; imports = [./style.nix];
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
settings = { settings = {
mainBar = { mainBar = mkMerge [
layer = "top"; {
position = "top"; layer = "top";
height = 30; position = "top";
height = 30;
margin-top = 6; margin-top = 6;
margin-left = 6; margin-left = 6;
margin-right = 6; margin-right = 6;
margin-bottom = 0; margin-bottom = 0;
modules-left = ["niri/workspaces" "niri/window"]; modules-left = ["niri/workspaces" "niri/window"];
modules-center = ["group/clock"]; modules-center = ["group/clock"];
modules-right = ["tray" "group/status" "group/power"]; modules-right =
["tray" "group/status" "group/power"]
++ lib.optional config.services.swaync.enable "custom/notification";
battery = { battery = {
interval = 10; interval = 10;
states = { states = {
warning = 30; warning = 30;
critical = 15; critical = 15;
};
format = "{icon} {capacity}%";
format-charging = " {capacity}% - {time}";
format-full = " {capacity}% - Full";
format-icons = [
""
""
""
""
""
];
max-length = 25;
}; };
format = "{icon} {capacity}%";
format-charging = " {capacity}% - {time}";
format-full = " {capacity}% - Full";
format-icons = [
""
""
""
""
""
];
max-length = 25;
};
"niri/window" = { "pulseaudio" = {
icon = true; format = "{icon} {volume}%";
}; format-bluetooth = "{icon} {volume}%";
format-muted = " ";
"pulseaudio" = { format-icons = {
format = "{icon} {volume}%"; "alsa_output.pci-0000_00_1f.3.analog-stereo" = "";
format-bluetooth = "{icon} {volume}%"; "alsa_output.pci-0000_00_1f.3.analog-stereo-muted" = "";
format-muted = " "; headphone = "";
format-icons = { hands-free = "";
"alsa_output.pci-0000_00_1f.3.analog-stereo" = ""; headset = "";
"alsa_output.pci-0000_00_1f.3.analog-stereo-muted" = ""; phone = "";
headphone = ""; phone-muted = "";
hands-free = ""; portable = "";
headset = ""; car = "";
phone = ""; default = [
phone-muted = ""; ""
portable = ""; ""
car = ""; ];
default = [ };
"" scroll-step = 1;
"" on-click = "pavucontrol";
ignored-sinks = [
"Easy Effects Sink"
]; ];
}; };
scroll-step = 1;
on-click = "pavucontrol";
ignored-sinks = [
"Easy Effects Sink"
];
};
"power-profiles-daemon" = { "power-profiles-daemon" = {
format-icons = { format-icons = {
default = ""; default = "";
performance = ""; performance = "";
balanced = ""; balanced = "";
power-saver = ""; power-saver = "";
};
}; };
};
"group/status" = { "group/status" = {
orientation = "inherit"; orientation = "inherit";
modules = [ modules = [
"pulseaudio" "pulseaudio"
"power-profiles-daemon" "power-profiles-daemon"
"network" "network"
"battery" "battery"
]; ];
}; };
"group/power" = { "group/power" = {
orientation = "inherit"; orientation = "inherit";
modules = [ modules = [
"custom/power" "custom/power"
]; ];
}; };
"group/clock" = { "group/clock" = {
orientation = "inherit"; orientation = "inherit";
modules = [ modules = [
"clock#time" "clock#time"
"clock#date" "clock#date"
]; ];
}; };
"custom/power" = { "custom/power" = {
format = ""; format = "";
tooltip = false; tooltip = false;
on-click = getExe pkgs.wlogout; on-click = getExe pkgs.wlogout;
}; };
"clock#date" = { "clock#date" = {
format = "{:%D}"; format = "{:%D}";
tooltip-format = "<tt><big>{calendar}</big></tt>"; tooltip-format = "<tt><big>{calendar}</big></tt>";
}; };
"clock#time" = { "clock#time" = {
format = "{:%H:%M}"; format = "{:%H:%M}";
tooltip-format = "{tz_list}"; tooltip-format = "{tz_list}";
timezones = [ timezones = [
osConfig.time.timeZone osConfig.time.timeZone
"US/Eastern" "US/Eastern"
]; ];
}; };
network = { network = {
interface = "wlp1s0"; interface = "wlp1s0";
format = "{ifname}"; format = "{ifname}";
format-wifi = "{icon}"; format-wifi = "{icon}";
format-ethernet = "{ipaddr}/{cidr} 󰊗"; format-ethernet = "{ipaddr}/{cidr} 󰊗";
format-disconnected = ""; format-disconnected = "";
tooltip-format = "{ifname} via {gwaddr} 󰊗"; tooltip-format = "{ifname} via {gwaddr} 󰊗";
tooltip-format-wifi = "{essid} ({signalStrength}%)"; tooltip-format-wifi = "{essid} ({signalStrength}%)";
tooltip-format-ethernet = "{ifname} "; tooltip-format-ethernet = "{ifname} ";
tooltip-format-disconnected = "Disconnected"; tooltip-format-disconnected = "Disconnected";
max-length = 50; max-length = 50;
format-icons = [ format-icons = [
"󰤟" "󰤟"
"󰤢" "󰤢"
"󰤥" "󰤥"
"󰤨" "󰤨"
]; ];
}; };
}; }
(mkIf osConfig.programs.niri.enable {
"niri/window" = {
icon = true;
};
})
(mkIf config.services.swaync.enable {
"custom/notification" = {
tooltip = false;
format = "{icon}";
format-icons = {
notification = "󱅫";
none = "󰂚";
dnd-notification = "󱏧";
dnd-none = "󱏧";
};
return-type = "json";
exec = "swaync-client -swb";
on-click = "swaync-client -t -sw";
};
})
];
}; };
}; };

View file

@ -88,7 +88,8 @@ in {
#network, #network,
#pulseaudio, #pulseaudio,
#tray, #tray,
#power-profiles-daemon { #power-profiles-daemon
{
padding: 0 0.5em; padding: 0 0.5em;
} }
@ -102,5 +103,9 @@ in {
padding: 0 1.2em; padding: 0 1.2em;
color: @base08; color: @base08;
} }
#custom-notification {
padding: 0 1.2em;
}
''; '';
} }

7
home/services/swaync.nix Normal file
View file

@ -0,0 +1,7 @@
{lib, ...}: {
services.swaync = {
enable = true;
};
# systemd.user.services.swaync.Service.Environment = "WAYLAND_DISPLAY=wayland-1";
systemd.user.services.swaync.Unit.ConditionEnvironment = lib.mkForce "";
}

View file

@ -35,6 +35,7 @@ in {
"${home}/programs/niri" "${home}/programs/niri"
"${home}/programs/waybar" "${home}/programs/waybar"
"${home}/services/swaync.nix"
"${home}/programs/fuzzel.nix" "${home}/programs/fuzzel.nix"
"${home}/programs/swaybg.nix" "${home}/programs/swaybg.nix"
"${home}/programs/swaylock.nix" "${home}/programs/swaylock.nix"