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 = {
d1 = "DP-1";
d2 = "DP-2";
d3 = "DP-3";
d4 = "HDMI-A-1";
tower1 = "Microstep MSI G24C 0000000000001";
tower2 = "BNQ BenQ GW2270 6CH00781019";
tower3 = "Eizo Nanao Corporation CG223W 23252050";
tower4 = "Samsung Electric Company SAMSUNG Unknown";
};
}

View file

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

View file

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

View file

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

View file

@ -88,22 +88,10 @@
};
# Clocks
longClockModule = {
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";
clockModule = {
interval = 1;
tooltip = true;
};
shortClockModule = {
exec = "echo ' '$(date +'%l:%M%p' | sed 's/^ //')";
interval = 60;
tooltip = false;
format = "{:%a %b %d %I:%M:%S%p}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
};
# Misc
@ -232,11 +220,10 @@
position = "top";
layer = "top";
output = [
"DSI-1"
"HDMI-A-1"
"LVDS-1"
"eDP-1"
"DP-1"
"!DP-2"
"!DP-3"
"!HDMI-A-2"
"*"
];
modules-left = [
"sway/workspaces"
@ -256,7 +243,7 @@
"custom/vram"
"backlight"
"battery"
"custom/clock-long"
"clock"
"gamemode"
"sway/scratchpad"
"privacy"
@ -277,7 +264,7 @@
"custom/vram" = vramModule;
"backlight" = backlightModule;
"battery" = batteryModule;
"custom/clock-long" = longClockModule;
"clock" = clockModule;
"sway/scratchpad" = scratchpadModule;
"privacy" = privacyModule;
"tray" = trayModule;
@ -290,12 +277,9 @@
position = "top";
layer = "top";
output = [
"!DSI-1"
"!HDMI-A-1"
"!LVDS-1"
"!eDP-1"
"!DP-1"
"*"
"DP-2"
"DP-3"
"HDMI-A-2"
];
modules-left = [
"sway/workspaces"
@ -310,7 +294,7 @@
"cpu"
"memory"
"custom/vram"
"custom/clock-long"
"clock"
];
"sway/workspaces" = swayWorkspaceModule;
"sway/window" = windowModule;
@ -322,7 +306,7 @@
"cpu" = cpuModule;
"memory" = ramModule;
"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 {
margin: 0 5px 0 2px;
}
#custom-clock-long, #custom-clock-short {
#clock {
margin: 0 2px 0 2px;
}
#cpu {
@ -398,10 +382,7 @@
#mpd.paused {
color: #888;
}
#custom-clock-long {
border-bottom: 3px solid #0a6cf5;
}
#custom-clock-short {
#clock {
border-bottom: 3px solid #0a6cf5;
}
#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;
in
(assign "${config.displays.d1}" workspaces1) ++
(assign "${config.displays.d2}" workspaces2) ++
(assign "${config.displays.d3}" workspaces3) ++
(assign "${config.displays.d4}" workspaces4);
(assign "${config.displays.tower1}" workspaces1) ++
(assign "${config.displays.tower2}" workspaces2) ++
(assign "${config.displays.tower3}" workspaces3) ++
(assign "${config.displays.tower4}" workspaces4);
};
}

View file

@ -39,5 +39,10 @@
inner = 5;
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";
};
};
}