feat: Add i3 config

master
Chan Wen Xu 2021-09-11 21:28:18 +07:00
parent a24798c225
commit 6caf23c6b7
2 changed files with 36 additions and 4 deletions

@ -1,4 +1,4 @@
{ self, pkgs, ... }:
{ self, pkgs, ... }@inputs:
{
programs.kitty = {
@ -8,13 +8,13 @@
size = 12;
};
};
services.flameshot.enable = true;
services.polybar = {
enable = true;
script = "polybar bar &";
};
xsession.windowManager.i3 = {
enable = true;
config = import ./i3.nix;
config = import ./i3.nix inputs;
};
}

@ -1,8 +1,40 @@
{ lib, pkgs, ...} :
let
modifier = "Mod4";
lockText = "(e)xit, (r)estart, (s)hutdown";
in
{
fonts = {
names = [ "JetBrains Mono" ];
size = 12.0;
};
modifier = "Mod4";
focus.mouseWarping = false;
modifier = modifier;
keybindings = lib.mkOptionDefault {
"${modifier}+d" = "kill";
"${modifier}+t" = "exec ${pkgs.kitty}/bin/kitty";
"${modifier}+o" = "exec ${pkgs.flameshot}/bin/flameshot gui";
"${modifier}+p" = "exec ${pkgs.dmenu}/bin/dmenu_run";
"${modifier}+Shift+q" = ''mode "${lockText}"'';
"${modifier}+h" = "focus left";
"${modifier}+j" = "focus down";
"${modifier}+k" = "focus up";
"${modifier}+l" = "focus right";
"${modifier}+Shift+h" = "move left";
"${modifier}+Shift+j" = "move down";
"${modifier}+Shift+k" = "move up";
"${modifier}+Shift+l" = "move right";
};
modes = lib.mkOptionDefault {
"(e)xit, (r)estart, (s)hutdown" = {
"e" = "exec ${pkgs.i3}/bin/i3-msg exit";
"r" = "exec systemctl reboot";
"s" = "exec systemctl poweroff -i";
"Escape" = "mode default";
"Return" = "mode default";
};
};
}