Specialize display config against display names and not port names

This commit is contained in:
Bun 2025-05-06 04:20:03 -04:00
parent 4c6fecb530
commit 60e9924131
8 changed files with 33 additions and 61 deletions

View file

@ -5,9 +5,9 @@
}; };
config.displays = { config.displays = {
d1 = "DP-1"; tower1 = "Microstep MSI G24C 0000000000001";
d2 = "DP-2"; tower2 = "BNQ BenQ GW2270 6CH00781019";
d3 = "DP-3"; tower3 = "Eizo Nanao Corporation CG223W 23252050";
d4 = "HDMI-A-1"; tower4 = "Samsung Electric Company SAMSUNG Unknown";
}; };
} }

View file

@ -7,7 +7,6 @@
./swaylock ./swaylock
./waybar ./waybar
./wlpicker ./wlpicker
./wpaperd
]; ];
home.packages = with pkgs; lib.mkIf config.home.desktop.enable [ home.packages = with pkgs; lib.mkIf config.home.desktop.enable [

View file

@ -8,21 +8,21 @@
name = "primary"; name = "primary";
outputs = [ outputs = [
{ {
criteria = "Microstep MSI G24C 0000000000001"; criteria = config.displays.tower1;
position = "3840,405"; position = "3840,405";
mode = "1920x1080@143.979996Hz"; mode = "1920x1080@143.979996Hz";
} }
{ {
criteria = "BNQ BenQ GW2270 6CH00781019"; criteria = config.displays.tower2;
position = "1920,405"; position = "1920,405";
} }
{ {
criteria = "Eizo Nanao Corporation CG223W 23252050"; criteria = config.displays.tower3;
position = "5760,0"; position = "5760,0";
transform = "90"; transform = "90";
} }
{ {
criteria = "Samsung Electric Company SAMSUNG Unknown"; criteria = config.displays.tower4;
position = "0,405"; position = "0,405";
} }
]; ];

View file

@ -8,7 +8,6 @@
enable = config.home.desktop.enable; enable = config.home.desktop.enable;
borderColor = "#${config.look.colors.accent}"; borderColor = "#${config.look.colors.accent}";
backgroundColor = "#${config.look.colors.dark}D9"; backgroundColor = "#${config.look.colors.dark}D9";
output = "${config.displays.d1}";
sort = "+time"; sort = "+time";
layer = "overlay"; layer = "overlay";
padding = "8"; padding = "8";

View file

@ -88,22 +88,10 @@
}; };
# Clocks # Clocks
longClockModule = { clockModule = {
exec = pkgs.writeScript "longClock" ''
time=$(date +'%a %b %-d %-I:%M:%S%p')
date=$(date "+%Y-%m-%d")
echo "{\"text\":\" $time\",\"tooltip\":\"$date\"}"
'';
format = "{}";
return-type = "json";
interval = 1; interval = 1;
tooltip = true; format = "{:%a %b %d %I:%M:%S%p}";
}; tooltip-format = "<tt><small>{calendar}</small></tt>";
shortClockModule = {
exec = "echo ' '$(date +'%l:%M%p' | sed 's/^ //')";
interval = 60;
tooltip = false;
}; };
# Misc # Misc
@ -232,11 +220,10 @@
position = "top"; position = "top";
layer = "top"; layer = "top";
output = [ output = [
"DSI-1" "!DP-2"
"HDMI-A-1" "!DP-3"
"LVDS-1" "!HDMI-A-2"
"eDP-1" "*"
"DP-1"
]; ];
modules-left = [ modules-left = [
"sway/workspaces" "sway/workspaces"
@ -256,7 +243,7 @@
"custom/vram" "custom/vram"
"backlight" "backlight"
"battery" "battery"
"custom/clock-long" "clock"
"gamemode" "gamemode"
"sway/scratchpad" "sway/scratchpad"
"privacy" "privacy"
@ -277,7 +264,7 @@
"custom/vram" = vramModule; "custom/vram" = vramModule;
"backlight" = backlightModule; "backlight" = backlightModule;
"battery" = batteryModule; "battery" = batteryModule;
"custom/clock-long" = longClockModule; "clock" = clockModule;
"sway/scratchpad" = scratchpadModule; "sway/scratchpad" = scratchpadModule;
"privacy" = privacyModule; "privacy" = privacyModule;
"tray" = trayModule; "tray" = trayModule;
@ -290,12 +277,9 @@
position = "top"; position = "top";
layer = "top"; layer = "top";
output = [ output = [
"!DSI-1" "DP-2"
"!HDMI-A-1" "DP-3"
"!LVDS-1" "HDMI-A-2"
"!eDP-1"
"!DP-1"
"*"
]; ];
modules-left = [ modules-left = [
"sway/workspaces" "sway/workspaces"
@ -310,7 +294,7 @@
"cpu" "cpu"
"memory" "memory"
"custom/vram" "custom/vram"
"custom/clock-long" "clock"
]; ];
"sway/workspaces" = swayWorkspaceModule; "sway/workspaces" = swayWorkspaceModule;
"sway/window" = windowModule; "sway/window" = windowModule;
@ -322,7 +306,7 @@
"cpu" = cpuModule; "cpu" = cpuModule;
"memory" = ramModule; "memory" = ramModule;
"custom/vram" = vramModule; "custom/vram" = vramModule;
"custom/clock-long" = longClockModule; "clock" = clockModule;
}; };
}; };
@ -380,7 +364,7 @@
#cpu, #memory, #custom-vram, #mpd, #backlight, #battery, #custom-weather, #custom-weather2, #custom-notifs { #cpu, #memory, #custom-vram, #mpd, #backlight, #battery, #custom-weather, #custom-weather2, #custom-notifs {
margin: 0 5px 0 2px; margin: 0 5px 0 2px;
} }
#custom-clock-long, #custom-clock-short { #clock {
margin: 0 2px 0 2px; margin: 0 2px 0 2px;
} }
#cpu { #cpu {
@ -398,10 +382,7 @@
#mpd.paused { #mpd.paused {
color: #888; color: #888;
} }
#custom-clock-long { #clock {
border-bottom: 3px solid #0a6cf5;
}
#custom-clock-short {
border-bottom: 3px solid #0a6cf5; border-bottom: 3px solid #0a6cf5;
} }
#backlight { #backlight {

View file

@ -1,12 +0,0 @@
{ config, ... }:
{
programs.wpaperd = {
enable = config.home.desktop.enable;
settings = {
default.mode = "center";
any.path = "~/.assets/wallpapers/1.png";
"${config.displays.d2}".path = "~/.assets/wallpapers/2.png";
"${config.displays.d3}".path = "~/.assets/wallpapers/3.png";
};
};
}

View file

@ -37,9 +37,9 @@
}) })
workspaces; workspaces;
in in
(assign "${config.displays.d1}" workspaces1) ++ (assign "${config.displays.tower1}" workspaces1) ++
(assign "${config.displays.d2}" workspaces2) ++ (assign "${config.displays.tower2}" workspaces2) ++
(assign "${config.displays.d3}" workspaces3) ++ (assign "${config.displays.tower3}" workspaces3) ++
(assign "${config.displays.d4}" workspaces4); (assign "${config.displays.tower4}" workspaces4);
}; };
} }

View file

@ -39,5 +39,10 @@
inner = 5; inner = 5;
smartGaps = true; smartGaps = true;
}; };
output = {
"*".bg = "~/.assets/wallpapers/1.png fill";
"${config.displays.tower2}".bg = "~/.assets/wallpapers/2.png fill";
"${config.displays.tower3}".bg = "~/.assets/wallpapers/3.png fill";
};
}; };
} }