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

49 lines
1.3 KiB
Nix

{config, ...}: {
wayland.windowManager.sway = {
enable = true;
config = rec {
modifier = "Mod4"; # Mod4 = Super/Meta
terminal = "kitty";
# disable sway bar
bars = [];
# set border colors
#colors = {
#focused =
startup = [
{command = "awww-daemon";}
{command = "waybar";}
];
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";
};
};
};
}