nixos-configs/nixosModules/ags/hyprland.nix

200 lines
4.3 KiB
Nix
Raw Normal View History

self: {lib, ...}: let
inherit (lib) map;
inherit (self.lib.hypr) mkAnimation mkBezier mkBind mkLayerRule;
in {
config.wayland.windowManager.hyprland = {
2024-10-30 23:43:37 -04:00
settings = {
general = {
gaps_in = 5;
gaps_out = 5;
border_size = 0;
};
decoration = {
rounding = 12;
blur = {
enabled = true;
size = 3;
passes = 1;
};
shadow.enabled = false;
};
2024-10-30 23:43:37 -04:00
animations = {
enabled = true;
bezier = map mkBezier [
{
name = "easeInQuart";
p0 = [0.895 0.030];
p1 = [0.685 0.220];
}
{
name = "easeOutQuart";
p0 = [0.165 0.840];
p1 = [0.440 1.000];
}
{
name = "easeInOutQuart";
p0 = [0.770 0.000];
p1 = [0.175 1.000];
}
# fade out
{
name = "easeInExpo";
p0 = [0.950 0.050];
p1 = [0.795 0.035];
}
2024-10-30 23:43:37 -04:00
];
animation = map mkAnimation [
{
name = "workspaces";
duration = 6;
bezier = "easeOutQuart";
style = "slide";
}
{
name = "windows";
duration = 4;
bezier = "easeOutQuart";
style = "slide";
}
{
name = "fadeIn";
enable = false;
}
{
name = "fadeOut";
duration = 4;
bezier = "easeInExpo";
}
{
name = "fadeLayersIn";
enable = false;
}
{
name = "fadeLayersOut";
duration = 4;
bezier = "easeInExpo";
}
{
name = "layers";
duration = 4;
bezier = "easeInOutQuart";
style = "fade";
}
2024-10-30 23:43:37 -04:00
];
};
layerrule = map mkLayerRule [
{
rule = "animation popin";
namespace = "^(hyprpaper.*)";
}
{
rule = "animation fade";
namespace = "^(bg-layer.*)";
}
{
rule = "noanim";
namespace = "^(noanim-.*)";
}
2024-10-30 23:43:37 -04:00
{
rule = "blur";
namespace = "^(blur-bg.*)";
}
{
rule = "ignorealpha 0.19";
namespace = "^(blur-bg.*)";
}
2024-10-30 23:43:37 -04:00
];
exec-once = [
"ags"
"sleep 3; ags request 'open win-applauncher'"
];
2024-10-30 23:43:37 -04:00
bind = map mkBind [
{
modifier = "$mainMod SHIFT";
key = "E";
command = "ags toggle win-powermenu";
}
{
modifier = "$mainMod";
key = "D";
command = "ags toggle win-applauncher";
}
{
modifier = "$mainMod";
key = "V";
command = "ags toggle win-clipboard";
}
{
key = "Print";
command = "ags toggle win-screenshot";
}
{
key = "XF86AudioMute";
command = "pactl set-sink-mute @DEFAULT_SINK@ toggle";
}
{
key = "XF86AudioMicMute";
command = "pactl set-source-mute @DEFAULT_SOURCE@ toggle";
}
{
modifier = "$mainMod";
key = "Print";
command = "bash -c \"grim -g \\\"$(slurp)\\\" - | satty -f -\"";
}
];
binde = map mkBind [
{
key = "XF86MonBrightnessUp";
command = "ags request 'Brightness.screen +0.05'";
}
{
key = "XF86MonBrightnessDown";
command = "ags request 'Brightness.screen -0.05'";
}
{
key = "XF86AudioRaiseVolume";
command = "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ & ags request 'popup speaker' &";
}
{
key = "XF86AudioLowerVolume";
command = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- & ags request 'popup speaker' &";
}
2024-10-30 23:43:37 -04:00
];
bindn = map mkBind [
{
key = "Escape";
command = "ags request closeAll";
}
];
bindr = map mkBind [
{
modifier = "CAPS";
key = "Caps_Lock";
command = "ags request fetchCapsState";
}
2024-10-30 23:43:37 -04:00
];
};
};
# For accurate stack trace
_file = ./default.nix;
2024-10-30 23:43:37 -04:00
}