2024-05-11 13:55:23 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
fonts,
|
2024-06-16 11:28:05 +01:00
|
|
|
accentColourName,
|
|
|
|
altAccentColourName,
|
2024-05-11 13:55:23 +01:00
|
|
|
...
|
|
|
|
}: {
|
2024-06-15 09:57:26 +01:00
|
|
|
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";
|
2024-05-11 13:55:23 +01:00
|
|
|
wayland.windowManager.sway = {
|
|
|
|
enable = true;
|
2024-05-17 16:14:50 +01:00
|
|
|
package =
|
|
|
|
pkgs.swayfx.overrideAttrs
|
|
|
|
(old: {passthru.providedSessions = ["sway"];});
|
2024-05-11 13:55:23 +01:00
|
|
|
swaynag.enable = true;
|
|
|
|
systemd.enable = true;
|
|
|
|
xwayland = true;
|
2024-06-03 05:26:43 +01:00
|
|
|
checkConfig = false;
|
2024-05-11 13:55:23 +01:00
|
|
|
config = {
|
|
|
|
input = {
|
|
|
|
"*" = {
|
|
|
|
xkb_layout = "gb";
|
|
|
|
xkb_options = "ctrl:nocaps";
|
|
|
|
};
|
|
|
|
"type:touchpad" = {
|
|
|
|
tap = "enabled";
|
|
|
|
natural_scroll = "enabled";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
seat = {
|
|
|
|
"seat0" = {
|
|
|
|
xcursor_theme = with config.gtk.cursorTheme; "${name} ${toString size}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
modifier = "Mod4";
|
2024-06-07 20:44:55 +01:00
|
|
|
terminal = "${config.programs.alacritty.package}/bin/alacritty";
|
2024-05-27 14:41:34 +01:00
|
|
|
menu = "${config.programs.fuzzel.package}/bin/fuzzel";
|
2024-05-11 13:55:23 +01:00
|
|
|
workspaceAutoBackAndForth = true;
|
|
|
|
bars = [];
|
|
|
|
gaps = {
|
|
|
|
inner = 5;
|
|
|
|
outer = 0;
|
|
|
|
};
|
|
|
|
fonts = {
|
|
|
|
names = [fonts.monospace.name];
|
|
|
|
style = "regular";
|
|
|
|
size = fonts.sizes.desktop * 1.0;
|
|
|
|
};
|
2024-06-16 11:28:05 +01:00
|
|
|
colors = let
|
|
|
|
sc = config.scheme.withHashtag;
|
|
|
|
text = toString sc.base05;
|
|
|
|
indicator = toString sc.${altAccentColourName};
|
|
|
|
background = toString sc.base00;
|
2024-06-09 06:51:10 +01:00
|
|
|
in {
|
|
|
|
inherit background;
|
|
|
|
focused = let
|
2024-06-16 11:28:05 +01:00
|
|
|
border = toString sc.${accentColourName};
|
2024-06-09 06:51:10 +01:00
|
|
|
in {
|
|
|
|
inherit background text indicator border;
|
2024-05-11 13:55:23 +01:00
|
|
|
childBorder = border;
|
|
|
|
};
|
2024-06-09 06:51:10 +01:00
|
|
|
focusedInactive = let
|
2024-06-16 11:28:05 +01:00
|
|
|
border = toString sc.base04;
|
2024-06-09 06:51:10 +01:00
|
|
|
in {
|
|
|
|
inherit background text indicator border;
|
2024-05-11 13:55:23 +01:00
|
|
|
childBorder = border;
|
|
|
|
};
|
2024-06-09 06:51:10 +01:00
|
|
|
unfocused = let
|
2024-06-16 11:28:05 +01:00
|
|
|
border = toString sc.base03;
|
2024-06-09 06:51:10 +01:00
|
|
|
in {
|
|
|
|
inherit background text indicator border;
|
2024-05-11 13:55:23 +01:00
|
|
|
childBorder = border;
|
|
|
|
};
|
2024-06-09 06:51:10 +01:00
|
|
|
urgent = let
|
2024-06-16 11:28:05 +01:00
|
|
|
border = toString sc.red;
|
2024-06-09 06:51:10 +01:00
|
|
|
in {
|
|
|
|
inherit background text indicator border;
|
2024-05-11 13:55:23 +01:00
|
|
|
childBorder = border;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
startup = [
|
|
|
|
{command = "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";}
|
|
|
|
{command = "${pkgs.protonmail-bridge}/bin/protonmail-bridge -n";}
|
2024-05-27 20:12:30 +01:00
|
|
|
{command = "set-background";}
|
2024-05-11 13:55:23 +01:00
|
|
|
];
|
|
|
|
window = {
|
|
|
|
border = 1;
|
2024-05-28 07:47:00 +01:00
|
|
|
titlebar = false;
|
2024-06-09 06:51:10 +01:00
|
|
|
commands = [
|
|
|
|
{
|
|
|
|
criteria.window_role = "(?:pop-up|bubble|dialog)";
|
|
|
|
command = "floating enable";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
criteria.app_id = "(?:org\.kde\.polkit-kde-authentication-agent-1|Pinentry|pavucontrol|\.blueman-manager-wrapped|nm-connection-editor)";
|
|
|
|
command = "floating enable";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
criteria.class = "(?:[Mm]atplotlib|.*\.py|Idl)";
|
|
|
|
command = "floating enable";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
# Catch-all for file dialog windows
|
|
|
|
criteria.title = "(?:Open|Save) (?:File|Folder|As)";
|
|
|
|
command = "floating enable, resize set width 1030 height 710";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
# Inhibit idle when watching vidoes
|
|
|
|
criteria.app_id = "(?:firefox|mpv)";
|
|
|
|
command = "inhibit_idle fullscreen";
|
|
|
|
}
|
|
|
|
{
|
2024-06-09 06:54:34 +01:00
|
|
|
# Window rules for game sessions.
|
|
|
|
# Note: controllers don't reset idle timer
|
2024-06-09 06:51:10 +01:00
|
|
|
criteria.class = "(?:steam_app|Minecraft).*";
|
2024-06-09 06:54:34 +01:00
|
|
|
command = "floating enable, fullscreen enable, inhibit_idle focus";
|
2024-06-09 06:51:10 +01:00
|
|
|
}
|
|
|
|
];
|
2024-05-11 13:55:23 +01:00
|
|
|
};
|
|
|
|
floating.border = 1;
|
|
|
|
keybindings = with config; let
|
|
|
|
modifier = wayland.windowManager.sway.config.modifier;
|
|
|
|
in
|
|
|
|
lib.mkOptionDefault {
|
|
|
|
# Movement
|
|
|
|
"${modifier}+comma" = "workspace prev";
|
|
|
|
"${modifier}+period" = "workspace next";
|
|
|
|
"${modifier}+shift+comma" = "move workspace prev";
|
|
|
|
"${modifier}+shift+period" = "move workspace next";
|
|
|
|
"${modifier}+bracketleft" = "move workspace to output left";
|
|
|
|
"${modifier}+bracketright" = "move workspace to output right";
|
|
|
|
|
|
|
|
# Function keys
|
|
|
|
## Sound
|
|
|
|
"XF86AudioMute" = "exec ${services.avizo.package}/bin/volumectl %";
|
|
|
|
"XF86AudioMicMute" = "exec ${services.avizo.package}/bin/volumectl -m %";
|
|
|
|
"XF86AudioRaiseVolume" = "exec ${services.avizo.package}/bin/volumectl -u + 5";
|
|
|
|
"XF86AudioLowerVolume" = "exec ${services.avizo.package}/bin/volumectl -u - 5";
|
|
|
|
|
|
|
|
## Playback
|
|
|
|
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
|
|
|
"XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
|
|
|
|
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
|
|
|
|
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
|
|
|
|
|
|
|
|
## Brightness
|
|
|
|
"XF86MonBrightnessUp" = "exec ${services.avizo.package}/bin/lightctl + 5";
|
|
|
|
"XF86MonBrightnessDown" = "exec ${services.avizo.package}/bin/lightctl - 5";
|
|
|
|
|
|
|
|
# System utilities
|
2024-05-29 09:08:12 +01:00
|
|
|
"Mod4+Mod1+l" = "exec swaylockfx";
|
2024-05-29 13:17:35 +01:00
|
|
|
"${modifier}+z" = "exec ${pkgs.mako}/bin/makoctl dismiss -a";
|
|
|
|
"${modifier}+Shift+z" = "exec ${pkgs.mako}/bin/makoctl restore";
|
2024-05-29 09:08:12 +01:00
|
|
|
"${modifier}+Shift+p" = "exec ${programs.wlogout.package}/bin/wlogout";
|
2024-05-11 13:55:23 +01:00
|
|
|
"${modifier}+Shift+Return" = "exec ${programs.emacs.finalPackage}/bin/emacsclient -c";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
extraConfig = ''
|
|
|
|
bindgesture swipe:right workspace prev
|
|
|
|
bindgesture swipe:left workspace next
|
|
|
|
corner_radius 10
|
|
|
|
blur enable
|
|
|
|
blur_xray disable
|
|
|
|
blur_passes 3
|
|
|
|
blur_radius 5
|
|
|
|
corner_radius 10
|
2024-05-27 14:41:34 +01:00
|
|
|
shadows disable
|
|
|
|
shadow_blur_radius 0
|
2024-05-28 07:47:00 +01:00
|
|
|
layer_effects "system-menu" blur enable; shadows disable
|
|
|
|
layer_effects "gtk-layer-shell" blur enable; shadows disable
|
|
|
|
layer_effects "notifications" blur enable; shadows disable
|
|
|
|
layer_effects "launcher" blur enable; shadows disable
|
2024-06-03 06:42:58 +01:00
|
|
|
layer_effects "logout_dialog" blur enable; shadows disable
|
2024-05-28 07:47:00 +01:00
|
|
|
layer_effects "waybar" blur enable; shadows disable
|
|
|
|
layer_effects "avizo" blur enable; shadows disable
|
2024-05-11 13:55:23 +01:00
|
|
|
titlebar_separator enable
|
|
|
|
scratchpad_minimize enable
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|