NixOS-Config/home/sway/rules.nix

133 lines
3.8 KiB
Nix
Raw Normal View History

2024-09-23 16:22:01 -04:00
{config, pkgs, outputs, ...}: {
2024-08-24 22:16:51 -04:00
# Enable Sway and write some scripts
wayland.windowManager.sway = {
2024-09-23 16:22:01 -04:00
config = {
2024-08-24 22:16:51 -04:00
# Assign workspaces to outputs
workspaceOutputAssign = let
2024-09-23 16:22:01 -04:00
workspaces1 = [
"${outputs.ws.w0}"
"${outputs.ws.w1}"
"${outputs.ws.w2}"
"${outputs.ws.w3}"
"${outputs.ws.w1a}"
"${outputs.ws.w2a}"
"${outputs.ws.w3a}"
];
workspaces2 = [
"${outputs.ws.w4}"
"${outputs.ws.w5}"
"${outputs.ws.w6}"
"${outputs.ws.w4a}"
"${outputs.ws.w5a}"
"${outputs.ws.w6a}"
];
workspaces3 = [
"${outputs.ws.w7}"
"${outputs.ws.w8}"
"${outputs.ws.w9}"
"${outputs.ws.w7a}"
"${outputs.ws.w8a}"
"${outputs.ws.w9a}"
];
2024-08-24 22:16:51 -04:00
assign = output: workspaces:
map (workspace: {
inherit workspace;
inherit output;
})
workspaces;
in
2024-09-23 16:22:01 -04:00
(assign "${outputs.displays.d1}" workspaces1) ++
(assign "${outputs.displays.d2}" workspaces2) ++
(assign "${outputs.displays.d3}" workspaces3);
2024-08-24 22:16:51 -04:00
# Rules
window = {
2024-09-23 16:22:01 -04:00
border = outputs.look.border.int;
2024-08-24 22:16:51 -04:00
titlebar = false;
commands = [
# Scratchpads
{
criteria = {con_mark = "scratchpad";};
command = ''floating enable, sticky enable, move scratchpad, mark borderless'';
}
{
criteria = {app_id = "gotop";};
command = ''mark scratchpad'';
}
{
criteria = {app_id = "music";};
command = ''mark scratchpad'';
}
{
criteria = {app_id = "sound";};
command = ''mark scratchpad'';
}
{
criteria = {app_id = "com.github.wwmm.easyeffects";};
command = ''mark scratchpad, opacity 0.9'';
}
# Create a "Scratchpad" for apps I don't want to be seen when launched
{
criteria = {con_mark = "hiddenaway";};
command = ''move scratchpad'';
}
# Give apps that don't have them borders
{
criteria = {con_mark = "borderless";};
2024-09-23 16:22:01 -04:00
command = ''border pixel ${outputs.look.border.string}'';
2024-08-24 22:16:51 -04:00
}
{
criteria = {app_id = "com.github.wwmm.easyeffects";};
command = ''mark borderless'';
}
{
criteria = {class = "steam";};
command = ''mark borderless'';
}
{
criteria = {app_id = "swappy";};
command = ''mark borderless'';
}
{
criteria = {app_id = "virt-manager";};
command = ''mark borderless'';
}
{
criteria = {window_role = "pop-up";};
command = ''mark borderless'';
}
# Floating or fullscreen rules
{
criteria = {app_id = "float";};
command = ''floating enable'';
}
{
criteria = {title = "^GlobalShot";};
command = ''floating enable, fullscreen enable global'';
}
];
};
assigns = {
2024-09-23 16:22:01 -04:00
# Brooutputs.wsers
"${outputs.ws.w1}" = [{app_id = "JimBrooutputs.wser";}];
"${outputs.ws.w1a}" = [{app_id = "AltBrooutputs.wser";}];
2024-08-24 22:16:51 -04:00
# Communication
2024-09-23 16:22:01 -04:00
"${outputs.ws.w3a}" = [{class = "zoom";}];
2024-09-24 15:44:45 -04:00
"${outputs.ws.w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";} {class = "vesktop";}];
2024-10-01 18:18:26 -04:00
"${outputs.ws.w8}" = [{app_id = "org.gnome.Fractal";}];
2024-09-23 16:22:01 -04:00
"${outputs.ws.w9}" = [{app_id = "thunderbird";}];
2024-08-24 22:16:51 -04:00
# Else
2024-09-23 16:22:01 -04:00
"${outputs.ws.w2}" = [{class = "steam";} {app_id = "heroic";}];
"${outputs.ws.w2a}" = [{app_id = "looking-glass-client";}];
"${outputs.ws.w4a}" = [{app_id = "com.obsproject.Studio";}];
2024-08-24 22:16:51 -04:00
};
focus.newWindow = "focus";
};
};
}