Files
nixos-config/programs/hyprland.nix
T

151 lines
4.4 KiB
Nix

{ pkgs, ... }:
let
mainMod = "SUPER";
in
{
# 启用 Noctalia
programs.noctalia-shell = {
enable = true;
# 可以在这里添加具体的 Noctalia 配置,暂时先用默认的
settings = {
# 可以在这里覆盖默认设置,例如:
# colors.accent = "#88c0d0";
};
};
# 启用 Hyprland (Lua 模式)
wayland.windowManager.hyprland = {
enable = true;
configType = "lua";
settings = {
# ── 基础设置 ──────────────────────────────────────────
monitor = ",preferred,auto,1";
env = [
"XCURSOR_SIZE,24"
"HYPRCURSOR_SIZE,24"
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
];
input = {
kb_layout = "us";
follow_mouse = 1;
touchpad = {
natural_scroll = true;
};
sensitivity = 0;
};
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
layout = "dwindle";
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 3;
passes = 1;
};
shadow = {
enabled = true;
range = 4;
render_power = 3;
color = "rgba(1a1a1aee)";
};
};
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"
];
};
# ── 快捷键 (Keybindings) ──────────────────────────────
bind = [
"${mainMod}, Return, exec, ghostty"
"${mainMod}, Q, killactive,"
"${mainMod}, B, exec, google-chrome"
"${mainMod}, M, exit,"
"${mainMod}, E, exec, dolphin"
"${mainMod}, V, togglefloating,"
# 使用 Noctalia 的快捷键
"${mainMod}, R, exec, noctalia-shell ipc call launcher toggle"
"${mainMod}, N, exec, noctalia-shell ipc call notifications toggle"
"${mainMod}, D, exec, noctalia-shell ipc call dashboard toggle"
# 聚焦移动
"${mainMod}, left, movefocus, l"
"${mainMod}, right, movefocus, r"
"${mainMod}, up, movefocus, u"
"${mainMod}, down, 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}, mouse_down, workspace, e+1"
"${mainMod}, mouse_up, workspace, e-1"
];
bindm = [
"${mainMod}, mouse:272, movewindow"
"${mainMod}, mouse:273, resizewindow"
];
# ── 启动项 ────────────────────────────────────────────
exec_once = [
"noctalia-shell"
"${pkgs.kdePackages.polkit-kde-agent-1}/libexec/polkit-kde-authentication-agent-1"
];
};
};
# ── 必备终端 ──────────────────────────────────────────────
programs.ghostty = {
enable = true;
};
home.packages = with pkgs; [
libnotify
wl-clipboard
];
}