Files
nix-config/hosts/desktop/hyprland/config/hypr/default.nix
2024-08-15 15:28:18 -05:00

216 lines
6.6 KiB
Nix

{
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd.enable = true;
settings = {
"$mainMod" = "SUPER";
# l -> locked, will also work when an input inhibitor (e.g. a lockscreen) is active.
# r -> release, will trigger on release of a key.
# e -> repeat, will repeat when held.
# n -> non-consuming, key/mouse events will be passed to the active window in addition to triggering the dispatcher.
# m -> mouse, see below.
# t -> transparent, cannot be shadowed by other binds.
# i -> ignore mods, will ignore modifiers.
# s -> separate, will arbitrarily combine keys between each mod/key, see [Keysym combos](#keysym-combos) above.
# d -> has description, will allow you to write a description for your bind.
# p -> bypasses the app's requests to inhibit keybinds.
bind = [
"$mainMod, Return, exec, kitty"
"$mainMod, Q, killactive, "
"$mainMod, M, exec, wlogout --protocol layer-shell"
"$mainMod, E, exec, nautilus"
"$mainMod, V, togglefloating, "
"$mainMod, D, exec, wofi --show drun"
"$mainMod, P, pseudo, "# dwindle
"$mainMod, S, togglesplit, "# dwindle
"$mainMod SHIFT, Q, exec, hyprlock"
", PRINT, exec, hyprshot -m region --clipboard-only"
"$mainMod, h, movefocus, l"
"$mainMod, l, movefocus, r"
"$mainMod, k, movefocus, u"
"$mainMod, j, movefocus, d"
"$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2"
"$mainMod, 3, workspace, 3"
"$mainMod, 4, workspace, 4"
"$mainMod, 5, workspace, 5"
"$mainMod, 6, workspace, 6"
"$mainMod, 7, workspace, 7"
"$mainMod, 8, workspace, 8"
"$mainMod, 9, workspace, 9"
"$mainMod, 0, workspace, 10"
"$mainMod SHIFT, 1, movetoworkspace, 1"
"$mainMod SHIFT, 2, movetoworkspace, 2"
"$mainMod SHIFT, 3, movetoworkspace, 3"
"$mainMod SHIFT, 4, movetoworkspace, 4"
"$mainMod SHIFT, 5, movetoworkspace, 5"
"$mainMod SHIFT, 6, movetoworkspace, 6"
"$mainMod SHIFT, 7, movetoworkspace, 7"
"$mainMod SHIFT, 8, movetoworkspace, 8"
"$mainMod SHIFT, 9, movetoworkspace, 9"
"$mainMod SHIFT, 0, movetoworkspace, 10"
"$mainMod CTRL, l, resizeactive, 10 0"
"$mainMod CTRL, h, resizeactive, -10 0"
"$mainMod CTRL, k, resizeactive, 0 -10"
"$mainMod CTRL, j, resizeactive, 0 10"
"$mainMod SHIFT, l, movewindow, r"
"$mainMod SHIFT, h, movewindow, l"
"$mainMod SHIFT, k, movewindow, u"
"$mainMod SHIFT, j, movewindow, d"
"$mainMod, b, exec, firefox"
];
bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
bindel =[
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
bindl = [
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
", XF86AudioNext, exec, playerctl next"
];
monitor = [
"DP-1,3840x2160@240.00000,0x0,1"
"DP-2,3840x2160@59.99700,3840x0,1"
];
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 1;
"col.active_border" = "rgb(8aadf4) rgb(24273A) rgb(24273A) rgb(8aadf4) 45deg";
"col.inactive_border" = "rgb(24273A) rgb(24273A) rgb(24273A) rgb(24273A) 45deg";
layout = "dwindle";
allow_tearing = false;
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 2;
passes = 2;
new_optimizations = true;
xray = false;
};
drop_shadow = "yes";
shadow_range = 4;
shadow_render_power = "3";
"col.shadow" = "rgba(1a1a1aee)";
};
animations = {
enabled = "yes";
bezier = [
"overshot, 0.05, 0.9, 0.1, 1.05"
"smoothOut, 0.36, 0, 0.66, -0.56"
"smoothIn, 0.25, 1, 0.5, 1"
];
animation = [
"windows, 1, 5, overshot, slide"
"windowsOut, 1, 4, smoothOut, slide"
"windowsMove, 1, 4, default"
"border, 1, 10, default"
"fade, 1, 10, smoothIn"
"fadeDim, 1, 10, smoothIn"
"workspaces, 1, 6, default"
];
};
dwindle = {
pseudotile = "yes";
preserve_split = "yes";
};
gestures = {
workspace_swipe = "off";
};
misc = {
force_default_wallpaper = 0;
};
windowrule = [
"float, file_progress"
"float, confirm"
"float, dialog"
"float, download"
"float, notification"
"float, error"
"float, splash"
"float, confirmreset"
"float, title:Open File"
"float, title:branchdialog"
"float,viewnior"
"float, pavucontrol-qt"
"float, pavucontrol"
"float, file-roller"
"fullscreen, wlogout"
"float, title:wlogout"
"fullscreen, title:wlogout"
"idleinhibit stayfocused, mpv"
];
windowrulev2 = [
"float, title:^(Media viewer)$"
# Picture in picture windows
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
"float, class:^(vesktop)$,title:^(Discord Popout)$"
"pin, class:^(vesktop)$,title:^(Discord Popout)$"
"float, class:^(steam)$,title:^(Friends List)$"
# Workspace assign
"workspace: 1, class:^(kitty)$"
"workspace: 2, class:^(firefox)$"
"workspace: 5, class:^(steam)$"
"workspace: 10, class:^(vesktop)$"
];
input = {
kb_layout = "us";
kb_variant = "";
kb_model = "";
kb_options = "";
kb_rules = "";
follow_mouse = 1;
touchpad = {
natural_scroll = "no";
};
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
};
};
extraConfig = ''
exec-once = dbus-update-activation-environment --systemd --all
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = nwg-look -a
exec-once = [workspace 2 silent] firefox
exec-once = [workspace 10 silent] vesktop
exec-once = [workspace 5 silent] steam
'';
};
}