1
0
Fork 0
forked from foxora/nix
flake-foxora/homes/modules/wm/sway.nix

53 lines
1.4 KiB
Nix
Raw Normal View History

{ config, ... }:
{
2026-02-12 18:53:24 +00:00
wayland.windowManager.sway = {
enable = true;
config = rec {
modifier = "Mod4"; # Mod4 = Super/Meta
terminal = "alacritty";
2026-02-12 18:53:24 +00:00
# disable sway bar
bars = [ ];
2026-02-12 18:53:24 +00:00
# set border colors
#colors = {
2026-02-13 23:27:35 +10:00
#focused =
2026-02-12 18:53:24 +00:00
startup = [
{ command = "awww-daemon"; }
{ command = "waybar"; }
2026-02-12 18:53:24 +00:00
];
keybindings =
let
main = config.wayland.windowManager.sway.config.modifier;
terminal = config.wayland.windowManager.sway.config.terminal;
browser = "firefox";
in
{
"${main}+c" = "kill"; # close focused window
"${main}+Alt+Delete" = "exit"; # exit sway
# open launcher
"${main}+d" = "exec pkill -x rofi || rofi -show drun -show-icons";
"Alt+Tab" = "exec pkill -x rofi || rofi -modi window -show window -show-icons";
"${main}+t" = "exec ${terminal}"; # open terminal
"${main}+r" = "exec ${browser}"; # open browser
# move focus
"${main}+h" = "focus left";
"${main}+j" = "focus down";
"${main}+k" = "focus up";
"${main}+l" = "focus right";
# move focused window
"${main}+Alt+h" = "move left";
"${main}+Alt+j" = "move down";
"${main}+Alt+k" = "move up";
"${main}+Alt+l" = "move right";
};
2026-02-12 18:53:24 +00:00
};
};
}