refine hyprland configuration

This commit is contained in:
insects 2024-08-10 14:15:25 +02:00
parent 548c1be854
commit 5e82b5487f
3 changed files with 88 additions and 3 deletions
home
common/desktop
desktop/hyprland

View file

@ -0,0 +1,12 @@
{ pkgs, ... }: {
imports = [
./kitty.nix
];
home.packages = with pkgs; [
# programs
firefox # you need a web browser
];
fonts.fontconfig.enable = true;
}

View file

@ -0,0 +1,14 @@
{ config, inputs, pkgs, ... }: {
programs.kitty = {
enable = true;
font = {
name = "JetBrains Mono Nerd Font";
package = pkgs.nerdfonts.override { fonts = ["JetBrainsMono"]; };
size = 11;
};
settings = {
editor = config.home.sessionVariables.EDITOR;
window_padding_width = 10;
};
};
}

View file

@ -1,5 +1,9 @@
{ lib, config, inputs, pkgs, ... }:
{
imports = [
../../common/desktop
];
wayland.windowManager.hyprland = {
enable = true;
systemd = {
@ -10,18 +14,73 @@
general = {
gaps_in = 15;
gaps_out = 20;
border_size = 2.7;
cursor_inactive_timeout = 4;
border_size = 2;
};
cursor.inactive_timeout = 4;
animations = {
enabled = true;
};
bind = let
terminal = "${pkgs.kitty}/bin/kitty";
workspaces = [
"1"
"2"
"3"
"4"
"5"
];
directions = rec {
left = "l";
right = "r";
up = "u";
down = "d";
h = left;
l = right;
k = up;
j = down;
};
in [
"SUPER,Return,exec,${terminal}"
];
"SUPERSHIFT,q,killactive" # exit program
"SUPERSHIFT,e,exit" # exit hyprland
"SUPER,s,togglesplit" # horizontal split
"SUPER,f,fullscreen,1" # borderless window
"SUPERSHIFT,f,fullscreen,0" # proper fullscreen
"SUPERSHIFT,space,togglefloating" # floating window
"SUPER,minus,splitratio,-0.25" # split gets slightly smaller
"SUPERSHIFT,minus,splitratio,-0.3333333" # split gets smaller
"SUPER,equal,splitratio,0.25" # split gets slightly larger
"SUPERSHIFT,equal,splitratio,0.3333333" # split gets larger
"SUPER,g,togglegroup" # make a window group
"SUPER,t,lockactivegroup,toggle" # lock/unlock the current group
"SUPER,tab,changegroupactive,f" # switch to next window in group
"SUPERSHIFT,tab,changegroupactive,p" # switch to prev window in group
"SUPER,dead_grave,workspace,previous" # prev workspace
"SUPER,dead_grave,workspace,next" # next workspace
"SUPER,u,togglespecialworkspace" # toggle special workspace
"SUPERSHIFT,u,movetoworkspacesilent,special" # move to special workspace
]
++
# change workspace
(map (n: "SUPER,${n},workspace,name:${n}") workspaces)
++
# move window to workspace
(map (n: "SUPERSHIFT,${n},movetoworkspacesilent,name:${n}") workspaces)
++
# move focus
(lib.mapAttrsToList (key: direction: "SUPER,${key},movefocus,${direction}") directions)
++
# swap windows
(lib.mapAttrsToList (key: direction: "SUPERSHIFT,${key},swapwindow,${direction}") directions)
++
# move windows
(lib.mapAttrsToList (key: direction: "SUPERCONTROL,${key},movewindoworgroup,${direction}") directions);
};
};
}