Files
m3ta-home/profiles/contexts/desktop/wm/hyprland.nix
T

318 lines
11 KiB
Nix
Raw Normal View History

2026-05-02 09:08:40 +02:00
# Hyprland window manager with keybindings, window rules, idle/lock, and hyprpaper.
{
config,
lib,
...
}:
with lib; let
cfg = config.desktop.wm.hyprland;
in {
options.desktop.wm.hyprland.enable = mkEnableOption "Hyprland window manager";
config = mkIf cfg.enable {
wayland.windowManager.hyprland = {
2026-05-18 20:09:28 +02:00
configType = "hyprlang";
2026-05-02 09:08:40 +02:00
settings = {
xwayland = {
force_zero_scaling = true;
};
2026-06-01 19:34:00 +02:00
source = [
"~/.config/hypr/dms/colors.conf"
"~/.config/hypr/dms/layout.conf"
"~/.config/hypr/dms/outputs.conf"
2026-06-01 19:34:00 +02:00
];
2026-05-02 09:08:40 +02:00
exec-once = [
"vibetyper"
];
env = [
"XCURSOR_SIZE,32"
"HYPRCURSOR_THEME,Bibata-Modern-Ice"
"WLR_NO_HARDWARE_CURSORS,1"
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"XKB_DEFAULT_LAYOUT,de"
"NIXOS_OZONE_WL,1"
2026-06-01 19:34:00 +02:00
"QT_QPA_PLATFORM,wayland;xcb"
"QT_QPA_PLATFORMTHEME,gtk3"
"QT_QPA_PLATFORMTHEME_QT6,gtk3"
2026-05-02 09:08:40 +02:00
];
input = {
kb_layout = "de,us";
kb_variant = "";
kb_model = "";
kb_rules = "";
kb_options = "ctrl:nocaps";
follow_mouse = 1;
};
general = {
gaps_in = 5;
gaps_out = 5;
border_size = 1;
layout = "dwindle";
};
decoration = {
shadow = {
enabled = true;
range = 60;
render_power = 3;
2026-06-01 19:34:00 +02:00
# color = "rgba(${config.colorScheme.palette.base00}66)";
2026-05-02 09:08:40 +02:00
offset = "1 2";
scale = 0.97;
};
rounding = 8;
blur = {
enabled = true;
size = 3;
passes = 3;
};
active_opacity = 0.9;
inactive_opacity = 0.5;
};
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"
];
};
dwindle = {
# pseudotile = true; # TODO
2026-05-02 09:08:40 +02:00
preserve_split = true;
};
master = {
new_status = "master";
};
device = [
{
name = "zsa-technology-labs-moonlander-mark-i";
kb_layout = "us";
}
2026-06-11 07:14:21 +02:00
{
2026-06-11 07:14:35 +02:00
name = "vibe-typer-virtual-keyboard";
kb_layout = "de";
2026-06-11 07:14:21 +02:00
}
2026-05-02 09:08:40 +02:00
{
name = "keychron-keychron-k7";
kb_layout = "us";
}
];
windowrule = [
"match:class file_progress, float on"
"match:class confirm, float on"
"match:class dialog, float on"
"match:class download, float on"
"match:class notification, float on"
"match:class error, float on"
"match:class splash, float on"
"match:class confirmreset, float on"
"match:title Open File, float on"
"match:title branchdialog, float on"
"match:class pavucontrol-qt, float on"
"match:class pavucontrol, float on"
"match:class class:^(espanso)$, float on"
"match:class wlogout, fullscreen on"
"match:title wlogout, float on"
"match:title wlogout, fullscreen on"
"match:class mpv, float on"
"match:class mpv, idle_inhibit focus"
"match:class mpv, opacity 1.0 override"
"match:title ^(Media viewer)$, float on"
"match:title ^(Volume Control)$, float on"
"match:title ^(Picture-in-Picture)$, float on"
"match:title ^(floating-pomodoro)$, float on"
"match:title ^(floating-pomodoro)$, size 250 50"
"match:title ^(floating-pomodoro)$, move 12 (monitor_h-150)"
"match:title ^(floating-pomodoro)$, pin on"
"match:initial_title .*streamlabs.com.*, float on"
"match:initial_title .*streamlabs.com.*, pin on"
"match:initial_title .*streamlabs.com.*, size 800 400"
"match:initial_title .*alert-box.*, move 100%-820 102"
"match:initial_title .*chat-box.*, move 100%-820 512"
"match:initial_title .*streamlabs.com.*, opacity 0.5 override"
"match:initial_title .*streamlabs.com.*, idle_inhibit focus"
"match:initial_title .*streamlabs.com.*, no_anim on"
"match:initial_title .*streamlabs.com.*, decorate off"
"match:initial_title .*streamlabs.com.*, no_shadow on"
"match:initial_title .*streamlabs.com.*, no_blur on"
"match:class ^vibe-typer$, match:title ^Recording Indicator$, no_blur on"
"border_color rgb(ffffff), match:xwayland 1"
];
"$mainMod" = "SUPER";
"$terminal" = "ghostty";
bind = [
"$mainMod, return, exec, $terminal nu -c zellij-ps"
"$mainMod, t, exec, $terminal -e nu -c 'nitch; exec nu'"
"$mainMod SHIFT, t, exec, launch-timer"
"$mainMod, n, exec, $terminal -e nvim"
"$mainMod, z, exec, uwsm app -- zeditor"
"$mainMod, o, exec, hyprctl dispatch setprop activewindow opaque toggle"
"$mainMod, r, exec, hyprctl dispatch focuswindow \"initialtitle:.*alert-box.*\" && hyprctl dispatch moveactive exact 4300 102 && hyprctl dispatch focuswindow \"initialtitle:.*chat-box.*\" && hyprctl dispatch moveactive exact 4300 512"
"$mainMod, b, exec, uwsm app -- thunar"
"$mainMod SHIFT, B, exec, uwsm app -- vivaldi"
2026-06-01 19:34:00 +02:00
"$mainMod, Escape, exec, uwsm app -- dms ipc call powermenu toggle"
# "$mainMod, Space, togglefloating"
2026-05-02 09:08:40 +02:00
"$mainMod, q, killactive"
"$mainMod, M, exit"
"$mainMod, F, fullscreen"
"$mainMod SHIFT, V, togglefloating"
2026-06-01 19:34:00 +02:00
"$mainMod, D, exec, uwsm app -- dms ipc call spotlight toggle"
"$mainMod, V, exec, uwsm app -- dms ipc call clipboard toggle"
2026-05-02 09:08:40 +02:00
"$mainMod, C, exec, bash -c 'FILE=/tmp/screenshot_$(date +%s).png; grim -g \"$(slurp)\" \"$FILE\" && ksnip \"$FILE\"'"
"$mainMod SHIFT, S, exec, uwsm app -- rofi -show emoji"
"$mainMod, P, exec, uwsm app -- rofi-pass"
"$mainMod SHIFT, P, pseudo"
"$mainMod, R, exec, stt-ptt start"
"$mainMod, S, exec, stt-ptt start"
# "$mainMod, J, togglesplit" # TODO
2026-05-02 09:08:40 +02:00
"$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, mouse_down, workspace, e+1"
"$mainMod, mouse_up, workspace, e-1"
];
bindr = [
];
bindm = [
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
};
};
2026-06-01 19:34:00 +02:00
# services.hypridle = {
# enable = true;
# settings = {
# general = {
# before_sleep_cmd = "hyprlock";
# after_sleep_cmd = "hyprctl dispatch dpms on";
# inhibit_sleep = 3;
# };
# listener = [
# {
# timeout = 300;
# on-timeout = "hyprlock";
# }
# {
# timeout = 420;
# on-timeout = "hyprctl dispatch dpms off";
# on-resume = "hyprctl dispatch dpms on";
# }
# ];
# };
# };
2026-05-02 09:08:40 +02:00
2026-06-01 19:34:00 +02:00
# services.hyprpaper.enable = true;
2026-05-02 09:08:40 +02:00
2026-06-01 19:34:00 +02:00
# programs.hyprlock = {
# enable = true;
# settings = {
# "$font" = "JetBrainsMono Nerd Font";
# "$base" = "rgb(${config.colorScheme.palette.base00})";
# "$text" = "rgb(${config.colorScheme.palette.base05})";
# "$textAlpha" = "${config.colorScheme.palette.base05}";
# "$accentAlpha" = "${config.colorScheme.palette.base0D}";
# "$red" = "rgb(${config.colorScheme.palette.base08})";
# "$yellow" = "rgb(${config.colorScheme.palette.base0A})";
2026-05-02 09:08:40 +02:00
2026-06-01 19:34:00 +02:00
# general = {
# hide_cursor = true;
# };
2026-05-02 09:08:40 +02:00
2026-06-01 19:34:00 +02:00
# background = {
# monitor = "";
# path = "${config.home.homeDirectory}/.config/hypr/wallpapers/wallhaven-lmmo8r.jpg";
# blur_passes = 0;
# color = "rgb(${config.colorScheme.palette.base00})";
# };
2026-05-02 09:08:40 +02:00
2026-06-01 19:34:00 +02:00
# label = [
# {
# monitor = "";
# text = "$TIME";
# color = "$text";
# font_size = 90;
# font_family = "$font";
# position = "30, 0";
# halign = "left";
# valign = "top";
# }
# {
# monitor = "";
# text = ''cmd[update:43200000] echo "$(date +"%A, %d %B %Y")"'';
# color = "$text";
# font_size = 25;
# font_family = "$font";
# position = "30, -150";
# halign = "left";
# valign = "top";
# }
# ];
2026-05-02 09:08:40 +02:00
2026-06-01 19:34:00 +02:00
# input-field = [
# {
# monitor = "";
# size = "300, 60";
# outline_thickness = 4;
# dots_size = 0.2;
# dots_spacing = 0.2;
# dots_center = true;
# outer_color = "rgb(${config.colorScheme.palette.base0D})";
# inner_color = "rgb(${config.colorScheme.palette.base00})";
# font_color = "rgb(${config.colorScheme.palette.base05})";
# fade_on_empty = false;
# placeholder_text = ''<span foreground="##${config.colorScheme.palette.base05}">󰌾 Logged in as <span foreground="##${config.colorScheme.palette.base0D}">$USER</span></span>'';
# hide_input = false;
# check_color = "rgb(${config.colorScheme.palette.base0D})";
# fail_color = "rgb(${config.colorScheme.palette.base08})";
# fail_text = ''<i>$FAIL <b>($ATTEMPTS)</b></i>'';
# capslock_color = "rgb(${config.colorScheme.palette.base0A})";
# position = "0, -35";
# halign = "center";
# valign = "center";
# }
# ];
# };
# };
2026-05-02 09:08:40 +02:00
};
}