Compare commits

..

No commits in common. "16914a2fa7310d3f8b67f97805d4cac3c0380f11" and "e869e866f1910eac9f5f3c0016aa94533c21fc13" have entirely different histories.

6 changed files with 267 additions and 301 deletions

View file

@ -1,42 +1,8 @@
{...}: { {...}: {
imports = [./default.nix]; imports = [./default.nix];
wayland.windowManager.sway.config = let wayland.windowManager.sway.config.output = {
defaultOutput = "eDP-1"; "eDP-1" = {
in { scale = "1.25";
output.${defaultOutput}.scale = "1.25"; };
workspaceOutputAssign = [
{
output = defaultOutput;
workspace = "1";
}
];
};
services.kanshi = {
enable = true;
settings = let
laptopScreen = {
criteria = "eDP-1";
scale = 1.25;
position = "3000,636";
};
monitor1 = {
criteria = "Acer Technologies ED270R TJMEE0043W01";
mode = "1920x1080@165Hz";
position = "1080,420";
};
monitor2 = {
criteria = "Ancor Communications Inc VS278 FALMQS032358";
position = "0,0";
transform = "270";
};
in [
{output = laptopScreen;}
{
profile = {
name = "docked";
outputs = [laptopScreen monitor1 monitor2];
};
}
];
}; };
} }

View file

@ -1,6 +1,9 @@
{...}: { {...}: {
imports = [./work.nix]; imports = [./work.nix];
wayland.windowManager.sway.config = { wayland.windowManager.sway.config.output = {
output."Dell Inc. DELL P3223QE CCG8YN3".scale = "1.5"; "Dell Inc. DELL P3223QE CCG8YN3" = {
pos = "0 0";
scale = "1.5";
};
}; };
} }

View file

@ -1,37 +1,34 @@
{...}: { {...}: {
imports = [./work.nix]; imports = [./work.nix];
wayland.windowManager.sway.config = let wayland.windowManager.sway.config.output = {
defaultOutput = "eDP-1"; "eDP-1" = {
in { scale = "1.25";
output.${defaultOutput}.scale = "1.25"; position = "2560 576";
workspaceOutputAssign = [ };
{ "Dell Inc. DELL P3223QE CCG8YN3" = {
output = defaultOutput; scale = "1.5";
workspace = "1"; position = "0 0";
} };
];
}; };
services.kanshi = { services.kanshi = {
enable = true; enable = true;
settings = let systemdTarget = "sway-session.target";
profiles = let
laptopScreen = { laptopScreen = {
criteria = "eDP-1"; criteria = "eDP-1";
scale = 1.25; status = "enable";
position = "2560,576";
}; };
monitor = { monitor = {
criteria = "Dell Inc. DELL P3223QE CCG8YN3"; criteria = "Dell Inc. DELL P3223QE CCG8YN3";
scale = 1.5; status = "enable";
position = "0,0";
}; };
in [ in {
{output = laptopScreen;} undocked = {
{ outputs = [laptopScreen];
profile = { };
name = "docked"; docked = {
outputs = [laptopScreen monitor]; outputs = [monitor laptopScreen];
}; };
} };
];
}; };
} }

View file

@ -1,8 +1,4 @@
{ {pkgs, ...}: {
config,
pkgs,
...
}: {
imports = [ imports = [
./default.nix ./default.nix
../programs/games/default.nix ../programs/games/default.nix
@ -12,39 +8,30 @@
freecad freecad
prusa-slicer prusa-slicer
]; ];
wayland.windowManager.sway.config = let wayland.windowManager.sway.config = {
defaultOutput = "DP-2"; startup = [
in { {command = "${pkgs.xorg.xrandr}/bin/xrandr --output DP-2 --primary";}
];
output = { output = {
"Acer Technologies ED270R TJMEE0043W01" = { "Acer Technologies ED270R TJMEE0043W01" = {
mode = "1920x1080@165Hz"; mode = "1920x1080@165Hz";
position = "1080 420"; pos = "1080 420";
adaptive_sync = "off"; adaptive_sync = "off";
}; };
"Ancor Communications Inc VS278 FALMQS032358" = { "Ancor Communications Inc VS278 FALMQS032358" = {
position = "0 0"; pos = "0 0";
transform = "270"; transform = "270";
}; };
}; };
workspaceOutputAssign = [ workspaceOutputAssign = [
{ {
output = defaultOutput; output = "HDMI-A-1";
workspace = "1"; workspace = "1";
} }
]; ];
startup = [
{command = "${pkgs.xorg.xrandr}/bin/xrandr --output ${defaultOutput} --primary";}
];
}; };
programs.waybar.settings = { programs.waybar.settings = {
main.output = ["DP-2"]; main.output = ["DP-2"];
alt = { alt.output = ["HDMI-A-1"];
inherit (config.programs.waybar.settings.main) layer position "sway/workspaces";
name = "alt";
output = ["HDMI-A-1"];
"modules-left" = ["sway/workspaces"];
"modules-center" = [];
"modules-right" = ["clock"];
};
}; };
} }

View file

@ -7,8 +7,6 @@
accentColour2, accentColour2,
... ...
}: { }: {
programs.waybar.systemd.target = lib.mkIf config.wayland.windowManager.sway.systemd.enable "sway-session.target";
services.kanshi.systemdTarget = lib.mkIf config.wayland.windowManager.sway.systemd.enable "sway-session.target";
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
package = package =

View file

@ -1,6 +1,8 @@
{ {
config, config,
lib,
pkgs, pkgs,
hostname,
fonts, fonts,
accentColour, accentColour,
... ...
@ -11,224 +13,237 @@
}; };
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true; systemd = {
settings.main = { enable = true;
name = "main"; target = "sway-session.target";
layer = "top"; };
position = "bottom"; settings = rec {
# Layout main = {
"modules-left" = [ name = "main";
"sway/workspaces" layer = "top";
"sway/window" position = "bottom";
]; # Layout
"modules-center" = []; "modules-left" = [
"modules-right" = [ "sway/workspaces"
"mpris" "sway/window"
"custom/notification"
"pulseaudio"
"network"
"bluetooth"
"clock#calendar"
"clock"
"backlight"
"battery"
"custom/weather"
"tray"
];
# Module config
"sway/workspaces" = {
format = "{icon}";
format-icons = {
"1" = "󰫃 ";
"2" = "󰫄 ";
"3" = "󰫅 ";
"4" = "󰫆 ";
"5" = "󰫇 ";
"6" = "󰫈 ";
default = "󰋙 ";
urgent = "󰁡 ";
};
# show-special = false;
# sort-by-number = true;
all-outputs = false;
persistent-workspaces = {
"1" = [];
"2" = [];
"3" = [];
"4" = [];
"5" = [];
"6" = [];
};
};
"sway/window" = {
"format" = "{title}";
"max-length" = 50;
"rewrite" = {
"(.*) - GNU Emacs at (.*)" = " $1 [$2]";
"(alacritty.*)" = " $1";
"(foot.*)" = " $1";
"(.*) - mpv" = "󰦟 $1";
"swayimg: (.*)" = "󰋩 $1";
"(btm)" = " Resource Usage [$1]";
"(cava)" = "󰝚 Music Visualiser [$1]";
"(.*) - Thunar" = "󰝰 $1";
"Mozilla Firefox" = "󰈹 $1";
"(.*) Mozilla Firefox" = "󰈹 $1";
"Nyxt - (.*)" = "󰀹 $1";
"(.*) - Chromium" = "󰊯 $1";
"(Signal.*)" = "󰭹 $1";
"((?:.*)WebCord.*)" = "󰙯 $1";
"(Cartridges.*)" = "󰊗 $1";
"([Ss]team.*)" = "󰓓 $1";
"(Prism Launcher.*)" = "󰍳 Minecraft ($1)";
"(X2Go Client)" = "󰢹 $1";
"(NoMachine|Nxplayer.bin) (.*)" = "󰢹 $1 $2";
};
};
mpris = {
"format" = "{status_icon} {player_icon} {artist} - {title}";
"tooltip-format" = "{player_icon} ({player}) {dynamic}";
"title-len" = 64;
"interval" = 1;
"dynamic-order" = [
"album"
"artist"
"title"
"position"
"length"
]; ];
"player-icons" = { "modules-center" = [];
"default" = "󰲸 "; "modules-right" = [
"emms" = " "; "mpris"
"firefox" = "󰈹 "; "custom/notification"
"mpv" = "󰦟 "; "pulseaudio"
}; "network"
"status-icons" = { "bluetooth"
"playing" = "󰐊"; "clock#calendar"
"paused" = "󰏤"; "clock"
"stopped" = "󰓛"; "backlight"
}; "battery"
"ignored-players" = []; "custom/weather"
}; "tray"
pulseaudio = { ];
scroll-step = 5; # Module config
format = "{format_source}{icon}{volume}%"; "sway/workspaces" = {
format-muted = "{format_source} 󰝟 "; format = "{icon}";
format-source = "󰍬 "; format-icons = {
format-source-muted = "󰍭 "; "1" = "󰫃 ";
format-icons = { "2" = "󰫄 ";
car = "󰄍 "; "3" = "󰫅 ";
default = ["󰕿 " "󰖀 " "󰕾 "]; "4" = "󰫆 ";
hands-free = "󰥰 "; "5" = "󰫇 ";
headset = "󰋎 "; "6" = "󰫈 ";
phone = "󰏲 "; default = "󰋙 ";
portable = "󰏳 "; urgent = "󰁡 ";
headphone = "󰋋 "; };
}; # show-special = false;
on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; # sort-by-number = true;
on-click-right = "${pkgs.pamixer}/bin/pamixer -t"; all-outputs = false;
on-scroll-up = "${pkgs.pamixer}/bin/pamixer -i 5"; persistent-workspaces = {
on-scroll-down = "${pkgs.pamixer}/bin/pamixer -d 5"; "1" = [];
}; "2" = [];
disk = { "3" = [];
format = "󰋊 {percentage_used}%"; "4" = [];
path = config.home.homeDirectory; "5" = [];
}; "6" = [];
cpu = {
format = "󰻠 {usage}%";
tooltip = false;
};
memory = {format = "󰍛 {}%";};
temperature = {
critical-threshold = 80;
format = "{icon} {temperatureC}°C";
format-icons = ["󱃃" "󰔏" "󱃂"];
};
network = {
format-icons = ["󰤟 " "󰤢 " "󰤥 " "󰤨 "];
format-wifi = "{icon}";
format-ethernet = "󰈁 ";
tooltip-format = "{essid} ({signalStrength}%)";
format-linked = "󰈂 ";
format-disconnected = "󰈂 ";
};
bluetooth = {
format = "󰂯";
format-disabled = "󰂲";
format-off = "󰂲";
format-on = "󰂯";
format-connected = "󰂱";
tooltip-format = "{status} | {device_alias}";
on-click = "${pkgs.bluez}/bin/bluetoothctl power on";
on-click-right = "${pkgs.bluez}/bin/bluetoothctl power off";
};
"clock#calendar" = {
# format = "{:󰃭 %Y-%m-%d}";
format = "{:%Y-%m-%d}"; # TEMP, see https://github.com/Alexays/Waybar/issues/3021
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "month";
mode-mon-col = 3;
weeks-pos = "left";
on-scroll = 1;
on-click-right = "mode";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
}; };
}; };
actions = { "sway/window" = {
on-click-right = "mode"; "format" = "{title}";
on-scroll-up = "shift_up"; "max-length" = 50;
on-scroll-down = "shift_down"; "rewrite" = {
"(.*) - GNU Emacs at (.*)" = " $1 [$2]";
"(alacritty.*)" = " $1";
"(foot.*)" = " $1";
"(.*) - mpv" = "󰦟 $1";
"swayimg: (.*)" = "󰋩 $1";
"(btm)" = " Resource Usage [$1]";
"(cava)" = "󰝚 Music Visualiser [$1]";
"(.*) - Thunar" = "󰝰 $1";
"Mozilla Firefox" = "󰈹 $1";
"(.*) Mozilla Firefox" = "󰈹 $1";
"Nyxt - (.*)" = "󰀹 $1";
"(.*) - Chromium" = "󰊯 $1";
"(Signal.*)" = "󰭹 $1";
"((?:.*)WebCord.*)" = "󰙯 $1";
"(Cartridges.*)" = "󰊗 $1";
"([Ss]team.*)" = "󰓓 $1";
"(Prism Launcher.*)" = "󰍳 Minecraft ($1)";
"(X2Go Client)" = "󰢹 $1";
"(NoMachine|Nxplayer.bin) (.*)" = "󰢹 $1 $2";
};
};
mpris = {
"format" = "{status_icon} {player_icon} {artist} - {title}";
"tooltip-format" = "{player_icon} ({player}) {dynamic}";
"title-len" = 64;
"interval" = 1;
"dynamic-order" = [
"album"
"artist"
"title"
"position"
"length"
];
"player-icons" = {
"default" = "󰲸 ";
"emms" = " ";
"firefox" = "󰈹 ";
"mpv" = "󰦟 ";
};
"status-icons" = {
"playing" = "󰐊";
"paused" = "󰏤";
"stopped" = "󰓛";
};
"ignored-players" = [];
};
pulseaudio = {
scroll-step = 5;
format = "{format_source}{icon}{volume}%";
format-muted = "{format_source} 󰝟 ";
format-source = "󰍬 ";
format-source-muted = "󰍭 ";
format-icons = {
car = "󰄍 ";
default = ["󰕿 " "󰖀 " "󰕾 "];
hands-free = "󰥰 ";
headset = "󰋎 ";
phone = "󰏲 ";
portable = "󰏳 ";
headphone = "󰋋 ";
};
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
on-click-right = "${pkgs.pamixer}/bin/pamixer -t";
on-scroll-up = "${pkgs.pamixer}/bin/pamixer -i 5";
on-scroll-down = "${pkgs.pamixer}/bin/pamixer -d 5";
};
disk = {
format = "󰋊 {percentage_used}%";
path = config.home.homeDirectory;
};
cpu = {
format = "󰻠 {usage}%";
tooltip = false;
};
memory = {format = "󰍛 {}%";};
temperature = {
critical-threshold = 80;
format = "{icon} {temperatureC}°C";
format-icons = ["󱃃" "󰔏" "󱃂"];
};
network = {
format-icons = ["󰤟 " "󰤢 " "󰤥 " "󰤨 "];
format-wifi = "{icon}";
format-ethernet = "󰈁 ";
tooltip-format = "{essid} ({signalStrength}%)";
format-linked = "󰈂 ";
format-disconnected = "󰈂 ";
};
bluetooth = {
format = "󰂯";
format-disabled = "󰂲";
format-off = "󰂲";
format-on = "󰂯";
format-connected = "󰂱";
tooltip-format = "{status} | {device_alias}";
on-click = "${pkgs.bluez}/bin/bluetoothctl power on";
on-click-right = "${pkgs.bluez}/bin/bluetoothctl power off";
};
"clock#calendar" = {
# format = "{:󰃭 %Y-%m-%d}";
format = "{:%Y-%m-%d}"; # TEMP, see https://github.com/Alexays/Waybar/issues/3021
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "month";
mode-mon-col = 3;
weeks-pos = "left";
on-scroll = 1;
on-click-right = "mode";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
};
actions = {
on-click-right = "mode";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
};
clock = {
# format = "{:󰥔 %R}";
format = "{:%R}"; # TEMP, see https://github.com/Alexays/Waybar/issues/3021
};
backlight = {
format = "{icon}";
tooltip-format = "{percent}%";
format-icons = [" " " " " " " " " " " " " " " " " "];
};
battery = {
states = {
warning = 30;
critical = 20;
};
format = "{icon}";
format-charging = "󰂄 ";
format-plugged = "󰚥 ";
tooltip-format = "{capacity}% {time}";
format-icons = ["󱃍 " "󰁺 " "󰁻 " "󰁼 " "󰁽 " "󰁾 " "󰁿 " "󰂀 " "󰂁 " "󰂂 " "󰁹 "];
};
"custom/notification" = let
makoctl = "${pkgs.mako}/bin/makoctl";
jq = "${pkgs.jq}/bin/jq";
in {
exec = "( ${makoctl} list | ${jq} -e '.data[] | length > 0' >/dev/null && echo '󱅫 ' ) || echo '󰂚 ' ";
format = "{}";
on-click = "${makoctl} dismiss -a";
interval = 3;
};
"custom/weather" = let
date-format = "%Y-%m-%d";
custom-indicator = "{ICON}{temp_C}({FeelsLikeC})";
in {
format = "{}°";
tooltip = true;
interval = 900; # Every 15 minutes
exec = ''${pkgs.wttrbar}/bin/wttrbar --location Didcot --date-format "${date-format}" --custom-indicator "${custom-indicator}"'';
return-type = "json";
};
tray = {
icon-size = builtins.floor fonts.sizes.popups;
show-passive-items = true;
spacing = 5;
}; };
}; };
clock = { # TEMP FIX
# format = "{:󰥔 %R}"; alt = lib.mkIf (hostname == "Vanguard") {
format = "{:%R}"; # TEMP, see https://github.com/Alexays/Waybar/issues/3021 inherit (main) layer position "sway/workspaces";
}; name = "alt";
backlight = { "modules-left" = [];
format = "{icon}"; "modules-center" = ["sway/workspaces"];
tooltip-format = "{percent}%"; "modules-right" = [];
format-icons = [" " " " " " " " " " " " " " " " " "];
};
battery = {
states = {
warning = 30;
critical = 20;
};
format = "{icon}";
format-charging = "󰂄 ";
format-plugged = "󰚥 ";
tooltip-format = "{capacity}% {time}";
format-icons = ["󱃍 " "󰁺 " "󰁻 " "󰁼 " "󰁽 " "󰁾 " "󰁿 " "󰂀 " "󰂁 " "󰂂 " "󰁹 "];
};
"custom/notification" = let
makoctl = "${pkgs.mako}/bin/makoctl";
jq = "${pkgs.jq}/bin/jq";
in {
exec = "( ${makoctl} list | ${jq} -e '.data[] | length > 0' >/dev/null && echo '󱅫 ' ) || echo '󰂚 ' ";
format = "{}";
on-click = "${makoctl} dismiss -a";
interval = 3;
};
"custom/weather" = let
date-format = "%Y-%m-%d";
custom-indicator = "{ICON}{temp_C}({FeelsLikeC})";
in {
format = "{}°";
tooltip = true;
interval = 900; # Every 15 minutes
exec = ''${pkgs.wttrbar}/bin/wttrbar --location Didcot --date-format "${date-format}" --custom-indicator "${custom-indicator}"'';
return-type = "json";
};
tray = {
icon-size = builtins.floor fonts.sizes.popups;
show-passive-items = true;
spacing = 5;
}; };
}; };
style = with config.scheme.withHashtag; let style = with config.scheme.withHashtag; let