Add sway keybinds

This commit is contained in:
Riley Apeldoorn 2023-05-22 15:38:39 +00:00
parent bb131992d6
commit e4a14d6c24
2 changed files with 56 additions and 5 deletions

View file

@ -18,9 +18,7 @@
config = { config = {
home-manager.users."riley" = a: lib.pipe a [ home-manager.users."riley" = a: lib.pipe a [
(import path) (import path)
(x: x // { (x: x // { imports = [ ./shared/home ]; })
imports = [ ./shared/home ];
})
]; ];
}; };
}; in { }; in {

View file

@ -10,7 +10,19 @@ in with lib; {
config = mkIf (cfg.enable) { config = mkIf (cfg.enable) {
home.packages = []; home.packages = with pkgs; [
wl-clipboard
(writeScriptBin "c" ''
${wl-clipboard}/bin/wl-copy
'')
(writeScriptBin "p" ''
${wl-clipboard}/bin/wl-paste
'')
];
programs.swaylock.enable = true;
programs.waybar.enable = true;
services.swayidle.enable = true;
wayland.windowManager.sway = { wayland.windowManager.sway = {
# This is all required to get it to not die. # This is all required to get it to not die.
@ -18,9 +30,50 @@ in with lib; {
extraSessionCommands = "export WLR_NO_HARDWARE_CURSORS=1"; extraSessionCommands = "export WLR_NO_HARDWARE_CURSORS=1";
extraOptions = [ "--unsupported-gpu" ]; extraOptions = [ "--unsupported-gpu" ];
config = { config = rec {
output."*".bg = "${../../data/wallpaper.jpg} fill"; output."*".bg = "${../../data/wallpaper.jpg} fill";
input."type:keyboard".xkb_options = "caps:escape";
terminal = "${pkgs.kitty}/bin/kitty"; terminal = "${pkgs.kitty}/bin/kitty";
# Directional keys
modifier = "Mod4";
fonts = {
names = [ "Fira Code" ];
size = 8.0;
};
keybindings = let mod = modifier; in {
"${mod}+h" = "focus left";
"${mod}+j" = "focus down";
"${mod}+k" = "focus up";
"${mod}+l" = "focus right";
"${mod}+Shift+h" = "move left";
"${mod}+Shift+j" = "move down";
"${mod}+Shift+k" = "move up";
"${mod}+Shift+l" = "move right";
"${mod}+a" = "split v";
"${mod}+s" = "split h";
"${mod}+f" = "fullscreen toggle";
"${mod}+Alt+a" = "layout toggle stacking splitv";
"${mod}+Alt+s" = "layout toggle tabbed splith";
"${mod}+Return" = "exec ${terminal}";
"${mod}+Escape" = "exec ${pkgs.swaylock}/bin/swaylock";
"${mod}+Tab" = "exec ${pkgs.firefox}/bin/firefox";
"${mod}+Backspace" = "mode kill";
};
modes."kill" = {
Backspace = "kill; mode default";
Escape = "mode default";
};
window.titlebar = true;
}; };
}; };