Convert first block of hyprland settings into nix

This commit is contained in:
Evie Litherland-Smith 2024-01-27 06:52:09 +00:00
parent 9936ea2e48
commit 138ad088ea
2 changed files with 91 additions and 97 deletions

View file

@ -1,94 +1,4 @@
{ config, pkgs, ... }:
let
themeName = config.gtk.theme.name;
cursorName = config.gtk.cursorTheme.name;
cursorSize = toString config.gtk.cursorTheme.size;
in ''
monitor=,preferred,auto,auto
env = XDG_CURRENT_DESKTOP=Hyprland
env = XDG_SESSION_TYPE=wayland
env = XDG_SESSION_DESKTOP=Hyprland
env = GDK_BACKEND=wayland,x11
env = GTK_THEME,${themeName}
env = XCURSOR_THEME,${cursorName}
env = XCURSOR_SIZE,${cursorSize}
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_QPA_PLATFORM,wayland
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = MOZ_ENABLE_WAYLAND,1
env = GRIM_DEFAULT_DIR=${config.xdg.userDirs.pictures}/Grim
exec-once = hyprctl setcursor ${cursorName} ${cursorSize}
gestures:workspace_swipe = true
input {
kb_layout = gb
kb_options = ctrl:nocaps
follow_mouse = 1
touchpad:natural_scroll = yes
}
master {
allow_small_split = true
special_scale_factor = 0.95
mfact = 0.5
new_is_master = false
new_on_top = false
no_gaps_when_only = 0
orientation = left
inherit_fullscreen = false
smart_resizing = false
drop_at_cursor = true
}
general {
col.active_border = rgb(b4befe)
col.inactive_border = rgb(313244)
gaps_in = 5
gaps_out = 10
border_size = 1
cursor_inactive_timeout = 5
layout = master
}
decoration {
rounding = 10
col.shadow=rgba(0d0e1c99)
drop_shadow = yes
shadow_ignore_window = true
shadow_range = 4
shadow_render_power = 3
blur {
enabled = true
size = 5
passes = 3
new_optimizations = true
brightness = 1.0
noise = 0.02
}
}
animations {
enabled = yes
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
misc {
background_color=rgb(0d0e1c)
disable_autoreload = true
mouse_move_enables_dpms = true
key_press_enables_dpms = true
}
xwayland:force_zero_scaling = true
{ config, pkgs, ... }: ''
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
bind = SUPER, F1, exec, swaylock
bind = SUPER, Q, killactive,

View file

@ -11,12 +11,6 @@
tray = "never";
};
};
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd.enable = true;
extraConfig = import ./config.nix { inherit config pkgs; };
};
programs = {
foot = {
enable = true;
@ -108,4 +102,94 @@
"swaync/style.css".source = ./swaync/style.css;
};
};
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd.enable = true;
settings = {
monitor = [ ",preferred,auto,auto" ];
env = with config; [
"XDG_CURRENT_DESKTOP=Hyprland"
"XDG_SESSION_TYPE=wayland"
"XDG_SESSION_DESKTOP=Hyprland"
"GDK_BACKEND=wayland,x11"
"GTK_THEME,${gtk.theme.name}"
"XCURSOR_THEME,${gtk.cursorTheme.name}"
"XCURSOR_SIZE,${toString gtk.cursorTheme.size}"
"QT_AUTO_SCREEN_SCALE_FACTOR,1"
"QT_QPA_PLATFORM,wayland"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"MOZ_ENABLE_WAYLAND,1"
"GRIM_DEFAULT_DIR=${xdg.userDirs.pictures}/Grim"
];
exec-once = with config;
[
"hyprctl setcursor ${gtk.theme.name} ${toString gtk.cursorTheme.size}"
];
gestures.workspace_swipe = true;
input = {
kb_layout = "gb";
kb_options = "ctrl:nocaps";
follow_mouse = 1;
touchpad.natural_scroll = "yes";
};
master = {
allow_small_split = true;
special_scale_factor = 0.95;
mfact = 0.5;
new_is_master = false;
new_on_top = false;
no_gaps_when_only = 0;
orientation = "left";
inherit_fullscreen = false;
smart_resizing = false;
drop_at_cursor = true;
};
general = {
"col.active_border" = "rgb(b4befe)";
"col.inactive_border" = "rgb(313244)";
gaps_in = 5;
gaps_out = 10;
border_size = 1;
cursor_inactive_timeout = 5;
layout = "master";
};
decoration = {
rounding = 10;
"col.shadow" = "rgba(0d0e1c99)";
drop_shadow = "yes";
shadow_ignore_window = true;
shadow_range = 4;
shadow_render_power = 3;
blur = {
enabled = true;
size = 5;
passes = 3;
new_optimizations = true;
brightness = 1.0;
noise = 2.0e-2;
};
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
misc = {
background_color = "rgb(0d0e1c)";
disable_autoreload = true;
mouse_move_enables_dpms = true;
key_press_enables_dpms = true;
};
xwayland.force_zero_scaling = true;
};
extraConfig = import ./config.nix { inherit config pkgs; };
};
}