Compare commits

...

1 Commits

Author SHA1 Message Date
c0d1341448 niri: redo a lot
Signed-off-by: unexplrd <unexplrd@linerds.us>
2025-07-19 13:21:31 +03:00
4 changed files with 424 additions and 263 deletions

View File

@ -7,7 +7,7 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption mkDefault mkForce getExe; inherit (lib) mkIf mkEnableOption mkForce getExe;
inherit (osConfig.networking) hostName; inherit (osConfig.networking) hostName;
cfg = config.desktop.niri; cfg = config.desktop.niri;
@ -131,7 +131,7 @@ in {
}; };
targets.tray.Unit.Description = "Home Manager System Tray"; # workaround for udiskie targets.tray.Unit.Description = "Home Manager System Tray"; # workaround for udiskie
services = let services = let
mkGraphicalService = config: graphicalService // config; mkGraphicalService = config: lib.attrsets.recursiveUpdate graphicalService config;
graphicalService = { graphicalService = {
Install.WantedBy = ["niri.service"]; Install.WantedBy = ["niri.service"];
Unit = { Unit = {
@ -148,33 +148,25 @@ in {
in in
lib.mkMerge [ lib.mkMerge [
{ {
udiskie = mkGraphicalService {}; copyq = mkGraphicalService {Service.Environment = mkForce "QT_QPA_PLATFORM=wayland";};
waybar = mkGraphicalService {};
network-manager-applet = mkGraphicalService {}; network-manager-applet = mkGraphicalService {};
copyq = mkGraphicalService { udiskie = mkGraphicalService {};
Service = walker = mkGraphicalService {};
graphicalService.Service waybar = mkGraphicalService {};
wpaperd =
mkGraphicalService {}
// { // {
Environment = mkForce "QT_QPA_PLATFORM=wayland"; Service.TimeoutStopSec = mkForce "1";
}; Service.Restart = mkForce "always";
}; };
xwayland-satellite = mkGraphicalService { xwayland-satellite = mkGraphicalService {
Service = Service = {
graphicalService.Service
// {
Type = "simple"; Type = "simple";
ExecStart = getExe pkgs.xwayland-satellite + " :123"; ExecStart = getExe pkgs.xwayland-satellite + " :123";
}; };
}; };
wpaperd = mkGraphicalService {
Service =
mkDefault graphicalService.Service;
};
walker = mkGraphicalService {};
# gnome-polkit-agent = mkGraphicalService { # gnome-polkit-agent = mkGraphicalService {
# Service = # Service = {
# graphicalService.Service
# // {
# Type = "simple"; # Type = "simple";
# ExecStart = pkgs.polkit_gnome + "/libexec/polkit-gnome-authentication-agent-1"; # ExecStart = pkgs.polkit_gnome + "/libexec/polkit-gnome-authentication-agent-1";
# }; # };
@ -182,9 +174,7 @@ in {
} }
(lib.mkIf (hostName == "morphius") { (lib.mkIf (hostName == "morphius") {
lisgd = mkGraphicalService { lisgd = mkGraphicalService {
Service = Service = {
graphicalService.Service
// {
# Group = "input"; # Group = "input";
Type = "simple"; Type = "simple";
ExecStart = ExecStart =

View File

@ -6,44 +6,30 @@
launcher, launcher,
... ...
}: let }: let
inherit (lib) mkIf getExe;
inherit (config.lib.stylix) colors; inherit (config.lib.stylix) colors;
inherit (osConfig.networking) hostName;
ifLaptop = mkIf (hostName != "dunamis"); ifLaptop = lib.mkIf (osConfig.networking.hostName != "dunamis");
in { in {
enable = true; enable = true;
systemd = { systemd = {
enable = true; enable = true;
target = "graphical-session.target"; target = "graphical-session.target";
}; };
settings.bar-0 = { settings.bottom = {
# layer = "top";
position = "bottom"; position = "bottom";
height = 33; height = 33;
spacing = 0; spacing = 0;
# margin-left = 3; # margin-left = 36 + 3;
# margin-right = 3; # margin-right = 36 + 3;
margin-left = 36 + 3; # margin-bottom = 3;
margin-right = 36 + 3;
margin-bottom = 3;
modules-left = [ modules-left = [
"custom/launcher" "custom/launcher"
"clock"
"wlr/taskbar" "wlr/taskbar"
"privacy" # "privacy"
];
modules-center = [
# "clock"
"niri/language"
"niri/workspaces"
"idle_inhibitor"
]; ];
modules-right = [ modules-right = [
"wireplumber" "niri/workspaces"
(ifLaptop "group/laptop") "niri/language"
"tray"
"custom/notification"
]; ];
"niri/workspaces" = { "niri/workspaces" = {
format = "{index}"; format = "{index}";
@ -61,7 +47,7 @@ in {
"power-profiles-daemon" "power-profiles-daemon"
]; ];
}; };
"backlight" = { backlight = {
format = "{percent}% {icon}"; format = "{percent}% {icon}";
format-icons = [ format-icons = [
"󰃚" "󰃚"
@ -73,18 +59,18 @@ in {
"󰃠" "󰃠"
]; ];
}; };
"idle_inhibitor" = { idle_inhibitor = {
format = "{icon}"; format = "{icon}";
format-icons = { format-icons = {
activated = "󰅶"; activated = "󰅶";
deactivated = "󰾪"; deactivated = "󰾪";
}; };
}; };
"tray" = { tray = {
icon-size = 16; icon-size = 16;
spacing = 6; spacing = 6;
}; };
"clock" = { clock = {
interval = 1; interval = 1;
format = "{:%R}"; format = "{:%R}";
tooltip = true; tooltip = true;
@ -103,25 +89,29 @@ in {
format-alt = "{icon} {time}"; format-alt = "{icon} {time}";
format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
}; };
mpris = { memory = {
format = "{player_icon} {dynamic}"; format = "{used:0.1f}G ";
format-paused = "{status_icon} <i>{dynamic}</i>"; tooltip-format = ''
playing-len = 30; RAM: {used:0.1f}G/{total:0.1f}G ({percentage}%)
playing-paused = 30; Swap: {swapUsed:0.1f}G/{swapTotal:0.1f}G ({swapPercentage}%)'';
player-icons = {
default = "";
mpv = "🎵";
}; };
status-icons = {paused = "";}; network = {
format = "{bandwidthDownBits} 󰇚 | {bandwidthUpBits} 󰕒";
interval = 3;
tooltip = false;
}; };
"upower" = { cpu = {
format = "{usage}% 󰍛";
interval = 3;
};
upower = {
icon-size = 16; icon-size = 16;
format = "{percentage}"; format = "{percentage}";
hide-if-empty = true; hide-if-empty = true;
tooltip = true; tooltip = true;
tooltip-spacing = 20; tooltip-spacing = 20;
}; };
"power-profiles-daemon" = { power-profiles-daemon = {
format = "{icon}"; format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}"; tooltip-format = "Power profile: {profile}\nDriver: {driver}";
tooltip = true; tooltip = true;
@ -132,12 +122,12 @@ in {
power-saver = ""; power-saver = "";
}; };
}; };
"wireplumber" = { wireplumber = {
scroll-step = 3; scroll-step = 3;
format = "{volume}% {icon}"; format = "{volume}% {icon}";
format-muted = "󰖁"; format-muted = "󰖁";
format-icons = ["󰕿" "󰖀" "󰕾"]; format-icons = ["󰕿" "󰖀" "󰕾"];
on-click = getExe pkgs.pwvucontrol; on-click = lib.getExe pkgs.pwvucontrol;
on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle"; on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle";
}; };
"custom/launcher" = { "custom/launcher" = {
@ -177,7 +167,172 @@ in {
}; };
}; };
"wlr/taskbar" = { "wlr/taskbar" = {
format = "{icon} {name}";
icon-size = 16;
icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}";
tooltip-format = "{title}";
on-click = "activate";
};
};
settings.top = {
position = "top";
height = 33;
spacing = 0;
# margin-left = 36 + 3;
# margin-right = 36 + 3;
# margin-top = 3;
modules-left = [
"custom/notification"
"tray"
];
modules-center = ["clock"];
modules-right = [
"privacy"
"network"
"cpu"
"memory"
"wireplumber"
(ifLaptop "group/laptop")
# "tray"
"idle_inhibitor"
];
"niri/workspaces" = {
format = "{index}";
};
"niri/language" = {
format = "{}";
format-en = "🇺🇸";
format-uk = "🇺🇦";
};
"group/laptop" = {
orientation = "inherit";
modules = [
"backlight"
"battery"
"power-profiles-daemon"
];
};
backlight = {
format = "{percent}% {icon}";
format-icons = [
"󰃚"
"󰃛"
"󰃜"
"󰃝"
"󰃞"
"󰃟"
"󰃠"
];
};
idle_inhibitor = {
format = "{icon}"; format = "{icon}";
format-icons = {
activated = "󰅶";
deactivated = "󰾪";
};
};
tray = {
icon-size = 16;
spacing = 6;
};
clock = {
interval = 1;
format = "{:%R}";
tooltip = true;
tooltip-format = "{:%B %d, %A}";
};
battery = {
states = {
good = 95;
warning = 30;
critical = 15;
};
format = "{capacity}% {icon}";
format-full = "{capacity}% 󱟢";
format-charging = "{capacity}% 󰂄";
format-plugged = "{capacity}% 󰚥";
format-alt = "{icon} {time}";
format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
};
memory = {
format = "{used:0.1f}G ";
tooltip-format = ''
RAM: {used:0.1f}G/{total:0.1f}G ({percentage}%)
Swap: {swapUsed:0.1f}G/{swapTotal:0.1f}G ({swapPercentage}%)'';
};
network = {
format = "{bandwidthDownBits} 󰇚 | {bandwidthUpBits} 󰕒";
interval = 3;
tooltip = false;
};
cpu = {
format = "{usage}% 󰍛";
interval = 3;
};
upower = {
icon-size = 16;
format = "{percentage}";
hide-if-empty = true;
tooltip = true;
tooltip-spacing = 20;
};
power-profiles-daemon = {
format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
tooltip = true;
format-icons = {
default = "󱡮";
performance = "󱡮";
balanced = "";
power-saver = "";
};
};
wireplumber = {
scroll-step = 3;
format = "{volume}% {icon}";
format-muted = "󰖁";
format-icons = ["󰕿" "󰖀" "󰕾"];
on-click = lib.getExe pkgs.pwvucontrol;
on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle";
};
"custom/launcher" = {
format = "";
on-click = launcher;
tooltip = false;
};
"custom/notification" = {
tooltip = false;
format = "{icon}";
format-icons = {
notification = "󱅫";
none = "󰂚";
dnd-notification = "󰂛";
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";
escape = true;
};
"privacy" = {
icon-spacing = 0;
icon-size = 16;
transition-duration = 250;
screenshare = {
type = "screenshare";
tooltip = true;
tooltip-icon-size = 24;
};
audio-in = {
type = "audio-in";
tooltip = true;
tooltip-icon-size = 24;
};
};
"wlr/taskbar" = {
format = "{icon} {name}";
icon-size = 18; icon-size = 18;
icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}";
tooltip-format = "{title}"; tooltip-format = "{title}";
@ -185,8 +340,10 @@ in {
}; };
}; };
# TODO: broken padding on taskbar button # TODO: figure out magic waybar css styling (does it pick up `~/.config/gtk-3.0/gtk.css` ?)
style = '' style =
# css
''
@define-color base00 #${colors.base00}; @define-color base08 #${colors.base08}; @define-color base00 #${colors.base00}; @define-color base08 #${colors.base08};
@define-color base01 #${colors.base01}; @define-color base09 #${colors.base09}; @define-color base01 #${colors.base01}; @define-color base09 #${colors.base09};
@define-color base02 #${colors.base02}; @define-color base0A #${colors.base0A}; @define-color base02 #${colors.base02}; @define-color base0A #${colors.base0A};
@ -197,11 +354,10 @@ in {
@define-color base07 #${colors.base07}; @define-color base0F #${colors.base0F}; @define-color base07 #${colors.base07}; @define-color base0F #${colors.base0F};
* { * {
all: unset; /* all: unset; */
font-family: ${config.stylix.fonts.sansSerif.name}, Symbols Nerd Font, FontAwesome; font-family: Symbols Nerd Font, FontAwesome, ${config.stylix.fonts.sansSerif.name};
font-weight: 500; font-weight: 500;
font-size: 16px; font-size: 16px;
min-width: 1em;
} }
.modules-left, .modules-center, .modules-right, window#waybar { .modules-left, .modules-center, .modules-right, window#waybar {
@ -210,6 +366,19 @@ in {
border-radius: 12px; border-radius: 12px;
} }
window#waybar {
border-radius: 0;
}
/* for leftmost modules */
.modules-left, .modules-center, .modules-right {
padding-left: 3px;
background-color: @base00;
color: @base05;
}
window#bottom.modules-center {
background-color: transparent
}
tooltip { tooltip {
background: @base01; background: @base01;
border: 1px solid @base0D; border: 1px solid @base0D;
@ -234,29 +403,29 @@ in {
#backlight, #backlight,
#battery, #battery,
#clock, #clock,
#cpu,
#custom-launcher, #custom-launcher,
#custom-notification, #custom-notification,
#idle_inhibitor, #idle_inhibitor,
#language, #language,
#memory,
#network,
#power-profiles-daemon, #power-profiles-daemon,
#privacy, #privacy,
#privacy-item, #privacy-item,
#taskbar button,
#taskbar, #taskbar,
#tray button,
#tray, #tray,
#wireplumber, #wireplumber,
#workspaces button, #workspaces button,
#workspaces { #workspaces {
all: unset;
border-radius: 9px; border-radius: 9px;
background-color: @base01; background-color: @base01;
margin: 3px 3px 3px 0; margin: 3px 3px 3px 0;
padding: 0 0.42em; padding: 0 0.42em;
} min-width: 1em;
/* #clock, */
#custom-launcher,
#language,
#wireplumber {
margin: 3px;
} }
#backlight, #backlight,
@ -268,6 +437,10 @@ in {
#wireplumber { #wireplumber {
padding: 0 0.5em; padding: 0 0.5em;
} }
#custom-notification,
#power-profiles-daemon {
min-width: 1em;
}
#privacy, #privacy,
#taskbar, #taskbar,
@ -283,9 +456,14 @@ in {
padding: 0 0.3em; padding: 0 0.3em;
} }
#taskbar button {
padding-left: 0;
}
#taskbar button,
#tray button,
#workspaces button { #workspaces button {
border-radius: 6px; border-radius: 6px;
min-width: 0.4em; min-width: 0.8em;
} }
#battery.critical:not(.charging) { #battery.critical:not(.charging) {
@ -315,6 +493,12 @@ in {
margin: 3px 0 3px 3px; margin: 3px 0 3px 3px;
} }
#taskbar button,
#tray button {
padding: 0 0.4em;
margin: 3px;
}
#workspaces button.active, #workspaces button.active,
#taskbar button.active { #taskbar button.active {
background-color: @base02; background-color: @base02;
@ -332,12 +516,6 @@ in {
background-color: transparent; background-color: transparent;
} }
#taskbar button,
#tray button {
min-width: 0.4em;
margin: 3px;
}
#tray > .needs-attention { #tray > .needs-attention {
-gtk-icon-effect: highlight; -gtk-icon-effect: highlight;
background-color: @base08; background-color: @base08;

View File

@ -1,27 +1,26 @@
{ {
# perSystem,
lib, lib,
osConfig, osConfig,
pkgs, pkgs,
lockscreen, lockscreen,
... ...
}: { }:
lib.attrsets.recursiveUpdate {
blueman-applet.enable = osConfig.services.blueman.enable; blueman-applet.enable = osConfig.services.blueman.enable;
swaync = import ./swaync; copyq.enable = true;
gammastep.enable = true;
gnome-keyring.enable = true;
hypridle.enable = true;
kanshi = import ./kanshi; kanshi = import ./kanshi;
network-manager-applet.enable = true; network-manager-applet.enable = true;
playerctld.enable = true; playerctld.enable = true;
swaync = import ./swaync;
swayosd.enable = true;
udiskie.enable = true;
wpaperd.enable = true; wpaperd.enable = true;
copyq = { }
enable = true; {
# package = perSystem.nixpkgs-stable.copyq;
};
gnome-keyring = {
enable = true;
components = ["secrets"];
};
gammastep = { gammastep = {
enable = true;
provider = "manual"; provider = "manual";
latitude = 49.6; latitude = 49.6;
longitude = 36.1; longitude = 36.1;
@ -31,19 +30,8 @@
night = 3000; night = 3000;
}; };
}; };
swayosd = { gnome-keyring.components = ["secrets"];
enable = true; hypridle.settings = {
topMargin = 0.8;
};
udiskie = {
enable = true;
automount = false;
notify = true;
tray = "auto";
};
hypridle = {
enable = true;
settings = {
general = { general = {
before_sleep_cmd = "loginctl lock-session"; before_sleep_cmd = "loginctl lock-session";
lock_cmd = "pidof ${lockscreen} || ${lockscreen}"; lock_cmd = "pidof ${lockscreen} || ${lockscreen}";
@ -60,5 +48,10 @@
} }
]; ];
}; };
swayosd.topMargin = 0.8;
udiskie = {
automount = false;
notify = true;
tray = "auto";
}; };
} }

View File

@ -17,7 +17,7 @@
control-center-layer = "overlay"; control-center-layer = "overlay";
# Notification settings # Notification settings
positionX = "right"; positionX = "left";
positionY = "top"; positionY = "top";
notification-2fa-action = true; notification-2fa-action = true;
notification-inline-replies = false; notification-inline-replies = false;
@ -27,7 +27,7 @@
notification-window-width = 400; notification-window-width = 400;
# Control center settings # Control center settings
control-center-positionX = "right"; control-center-positionX = "left";
control-center-positionY = "top"; control-center-positionY = "top";
control-center-width = 500; control-center-width = 500;
control-center-exclusive-zone = true; control-center-exclusive-zone = true;