feat(hyprland): hy3, split up, clean up

This commit is contained in:
Kat Inskip 2025-12-17 15:06:33 -08:00
parent e7e33f90b1
commit 5b37548c2c
10 changed files with 758 additions and 146 deletions

View file

@ -0,0 +1,128 @@
{ config, lib, std, parent, pkgs, ... }:
{
wayland.windowManager.hyprland.settings = let
inherit (std) list;
inherit (lib.meta) getExe' getExe;
noctalia = "${getExe parent.services.noctalia-shell.package} ipc call";
vol = "${noctalia} volume";
bl = "${noctalia} brightness";
term = getExe config.programs.alacritty.package;
in {
"$mod" = "SUPER";
binds.workspace_back_and_forth = true;
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
bindl = [
", XF86AudioPlay, exec, ${getExe pkgs.playerctl} play-pause"
", XF86AudioMute, exec, ${vol} muteOutput"
", XF86AudioMicMute, exec, ${vol} muteInput"
];
binde = [
", XF86AudioRaiseVolume, exec, ${vol} increase"
", XF86AudioLowerVolume, exec, ${vol} decrease"
", XF86MonBrightnessUp, exec, ${bl} increase"
", XF86MonBrightnessDown, exec, ${bl} decrease"
];
bind = let
uwsmCmd = lib.optionalString parent.programs.uwsm.enable "uwsm app -- ";
uwsmApp = cmd: uwsmCmd + cmd;
uwsmSingleApp = cmd: "pgrep ${cmd} || ${uwsmCmd + cmd}";
in
[
", XF86AudioPlay, exec, ${getExe pkgs.playerctl} play-pause"
", XF86AudioNext, exec, ${getExe pkgs.playerctl} next"
", XF86AudioPrev, exec, ${getExe pkgs.playerctl} prev"
"$mod, RETURN, exec, ${getExe config.programs.vicinae.package} toggle"
"$mod, grave, exec, ${uwsmApp term}"
"$mod SHIFT, grave, exec, ${uwsmApp term} --class AlacrittyFloating"
", Print, exec, ${uwsmSingleApp "grimblast"} copy area"
"CTRL ALT, DELETE, exec, ${uwsmApp "hyprctl kill"}"
"CTRL ALT SHIFT, DELETE, exec, loginctl terminate-user \"\""
"$mod SHIFT, Q, hy3:killactive,"
"$mod, F, fullscreenstate, 2 -1" # dont inform
"$mod SHIFT, F, fullscreenstate, -1 2" # do inform
"$mod, T, togglefloating,"
"$mod, tab, hy3:togglefocuslayer"
"$mod SHIFT, T, togglesplit,"
"$mod SHIFT, X, pseudo,"
"$mod ALT, ,resizeactive,"
"$mod, Escape, exec, ${noctalia} sessionMenu toggle"
"$mod SHIFT, Escape, exec, ${noctalia} controlCenter toggle"
"$mod, L, exec, ${uwsmSingleApp "${noctalia} lockScreen toggle"}"
"$mod, d, hy3:makegroup, h"
"$mod, s, hy3:makegroup, v"
"$mod, z, hy3:makegroup, tab"
"$mod, x, hy3:locktab, tab"
"$mod, a, hy3:changefocus, raise"
"$mod SHIFT, a, hy3:changefocus, lower"
"$mod, e, hy3:expand, expand"
"$mod SHIFT, e, hy3:expand, base"
"$mod, r, hy3:changegroup, opposite"
"$mod, left, hy3:movefocus, l"
"$mod, right, hy3:movefocus, r"
"$mod, up, hy3:movefocus, u"
"$mod, down, hy3:movefocus, d"
"$mod SHIFT, left, hy3:movewindow, l, once"
"$mod SHIFT, right, hy3:movewindow, r, once"
"$mod SHIFT, up, hy3:movewindow, u, once"
"$mod SHIFT, down, hy3:movewindow, d, once"
"$mod CTRL, left, hy3:movefocus, l, visible, nowarp"
"$mod CTRL, right, hy3:movefocus, r, visible, nowarp"
"$mod CTRL, up, hy3:movefocus, u, visible, nowarp"
"$mod CTRL, down, hy3:movefocus, d, visible, nowarp"
"$mod CTRL SHIFT, left, hy3:movewindow, l, once, visible"
"$mod CTRL SHIFT, right, hy3:movewindow, r, once, visible"
"$mod CTRL SHIFT, up, hy3:movewindow, u, once, visible"
"$mod CTRL SHIFT, down, hy3:movewindow, d, once, visible"
"$mod, P, exec, ${getExe pkgs.hyprpicker} -na"
"CTRL, Print, exec, ${uwsmSingleApp "grimblast"} --notify --cursor copysave output"
"$mod SHIFT CTRL, R, exec, ${uwsmSingleApp "grimblast"} --notify --cursor copysave output"
"ALT, Print, exec, ${uwsmSingleApp "grimblast"} --notify --cursor copysave screen"
"$mod SHIFT ALT, R, exec, ${uwsmSingleApp "grimblast"} --notify --cursor copysave screen"
"$mod, page_down, workspace, e-1"
"$mod, page_up, workspace, e+1"
"$mod, bracketleft, focusmonitor, l"
"$mod, bracketright, focusmonitor, r"
"$mod SHIFT, bracketleft, movewindow, mon:-1"
"$mod SHIFT, bracketright, movewindow, mon:+1"
"$mod CTRL SHIFT, bracketleft, movecurrentworkspacetomonitor, l"
"$mod CTRL SHIFT, bracketright, movecurrentworkspacetomonitor, r"
]
++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
list.concat (list.generate (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in [
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, hy3:movetoworkspace, ${toString (x + 1)}"
"$mod, F${ws}, workspace, ${toString (x + 11)}"
"$mod SHIFT, F${ws}, hy3:movetoworkspace, ${toString (x + 11)}"
]
)
10)
);
};
}

View file

@ -0,0 +1,11 @@
{ lib, pkgs, ... }: {
wayland.windowManager.hyprland.settings.exec-once = let
inherit (lib.meta) getExe getExe';
in [
"${getExe pkgs.swww} init"
"${getExe' pkgs.dbus "dbus-update-activation-environment"} --all"
(getExe' pkgs.networkmanagerapplet "nm-applet")
(getExe pkgs.udiskie)
"${getExe' pkgs.systemd "systemctl"} restart konawall-py --user"
];
}

View file

@ -0,0 +1,29 @@
{ config, ... }:
{
wayland.windowManager.hyprland.settings = {
general.layout = "hy3";
plugin.hy3 = with config.stylix.generated.palette; {
tabs = {
height = 30;
text_font = config.stylix.fonts.sansSerif.name;
text_height = config.stylix.fonts.sizes.desktop;
border_width = 1;
"col.urgent" = "rgb(${base08})";
"col.urgent.border" = "rgb(${base08})";
"col.urgent.text" = "rgb(${base05})";
"col.inactive" = "rgb(${base03})";
"col.inactive.border" = "rgb(${base03})";
"col.inactive.text" = "rgb(${base01})";
"col.active" = "rgb(${base0D})";
"col.active.border" = "rgb(${base0D})";
"col.active.text" = "rgb(${base05})";
};
autotitle = {
trigger_width = 800;
trigger_height = 500;
};
};
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, std, lib, config, parent, ... }: let
{ pkgs, std, lib, config, parent, inputs, ... }: let
inherit (std) list;
inherit (lib.meta) getExe' getExe;
in {
@ -25,27 +25,9 @@ in {
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
plugins = [ inputs.hy3.packages.x86_64-linux.hy3 ];
settings = let
noctalia = "${getExe parent.services.noctalia-shell.package} ipc call";
vol = "${noctalia} volume";
bl = "${noctalia} brightness";
term = getExe config.programs.alacritty.package;
in {
# TODO: break it up
windowrule = [
"suppressevent fullscreen, class:steam_app_default"
"workspace 2, class:steam_app_default"
"suppressevent maximize, class:.*"
"tile, class:battle\.net\.exe"
"renderunfocused, class:discord, initialTitle:Discord"
"unset, title:Wine System Tray"
"workspace special:hidden silent, title:Wine System Tray"
"noinitialfocus, title:Wine System Tray"
];
"$mod" = "SUPER";
input = {
kb_options = "ctrl:nocaps";
accel_profile = "flat";
@ -55,21 +37,16 @@ in {
cursor = {
use_cpu_buffer = true;
};
workspace = let
commonOptions = "gapsin:0,gapsout:0,rounding:false";
in
["1,${commonOptions}"]
++ (list.map (
workspace: "${toString workspace},${commonOptions}"
) (list.range 2 10));
env = [
"MOZ_ENABLE_WAYLAND,1"
"XDG_CURRENT_DESKTOP,Hyprland"
"GDK_BACKEND,wayland,x11"
"CLUTTER_BACKEND,wayland"
];
render.direct_scanout = false;
render = {
direct_scanout = true;
new_render_scheduling = true;
};
#debug.disable_logs = false;
exec-once = [
"${pkgs.swww}/bin/swww init"
@ -78,107 +55,9 @@ in {
"${pkgs.udiskie}/bin/udiskie &"
"${getExe' pkgs.systemd "systemctl"} restart konawall-py --user"
];
group.groupbar = {
# TODO: see if font necessary
};
xwayland = {
force_zero_scaling = true;
};
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
bindl = [
", XF86AudioPlay, exec, ${getExe pkgs.playerctl} play-pause"
", XF86AudioMute, exec, ${vol} muteOutput"
", XF86AudioMicMute, exec, ${vol} muteInput"
];
binde = [
", XF86AudioRaiseVolume, exec, ${vol} increase"
", XF86AudioLowerVolume, exec, ${vol} decrease"
", XF86MonBrightnessUp, exec, ${bl} increase"
", XF86MonBrightnessDown, exec, ${bl} decrease"
];
bind = let
uwsmCmd = lib.optionalString parent.programs.uwsm.enable "uwsm app -- ";
uwsmApp = cmd: uwsmCmd + cmd;
uwsmSingleApp = cmd: "pgrep ${cmd} || ${uwsmCmd + cmd}";
in
[
", XF86AudioPlay, exec, ${getExe pkgs.playerctl} play-pause"
", XF86AudioNext, exec, ${getExe pkgs.playerctl} next"
", XF86AudioPrev, exec, ${getExe pkgs.playerctl} prev"
"$mod, D, exec, ${getExe config.programs.vicinae.package} toggle"
"$mod, RETURN, exec, ${uwsmApp term}"
"$mod, W, exec, ${uwsmApp "librewolf"}"
"$mod, E, exec, ${uwsmApp "pcmanfm"}"
", Print, exec, ${uwsmSingleApp "grimblast"} copy area"
"CTRL ALT, DELETE, exec, ${uwsmApp "hyprctl kill"}"
"CTRL ALT SHIFT, DELETE, exec, loginctl terminate-user \"\""
"$mod SHIFT, E, exec, pkill Hyprland"
"$mod SHIFT, Q, killactive,"
"$mod, F, fullscreenstate, 2 -1" # dont inform
"$mod SHIFT, F, fullscreenstate, -1 2" # do inform
"$mod, G, togglegroup,"
"$mod SHIFT, N, changegroupactive, f"
"$mod SHIFT, P, changegroupactive, b"
"$mod, T, togglefloating,"
"$mod SHIFT, T, togglesplit,"
"$mod SHIFT, X, pseudo,"
"$mod ALT, ,resizeactive,"
"$mod, Escape, exec, ${noctalia} sessionMenu toggle"
"$mod SHIFT, Escape, exec, ${noctalia} controlCenter toggle"
"$mod, L, exec, ${uwsmSingleApp "${noctalia} lockScreen toggle"}"
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
"$mod SHIFT, left, movewindow, l"
"$mod SHIFT, right, movewindow, r"
"$mod SHIFT, up, movewindow, u"
"$mod SHIFT, down, movewindow, d"
"$mod ALT, left, movewindoworgroup, l"
"$mod ALT, right, movewindoworgroup, r"
"$mod ALT, up, movewindoworgroup, u"
"$mod ALT, down, movewindoworgroup, d"
"$mod, P, exec, ${pkgs.hyprpicker}/bin/hyprpicker -na"
"CTRL, Print, exec, ${uwsmSingleApp "grimblast"} --notify --cursor copysave output"
"$mod SHIFT CTRL, R, exec, ${uwsmSingleApp "grimblast"} --notify --cursor copysave output"
"ALT, Print, exec, ${uwsmSingleApp "grimblast"} --notify --cursor copysave screen"
"$mod SHIFT ALT, R, exec, ${uwsmSingleApp "grimblast"} --notify --cursor copysave screen"
"$mod, bracketleft, workspace, e-1"
"$mod, bracketright, workspace, e+1"
"$mod SHIFT, bracketleft, focusmonitor, l"
"$mod SHIFT, bracketright, focusmonitor, r"
"$mod SHIFT ALT, bracketleft, movecurrentworkspacetomonitor, l"
"$mod SHIFT ALT, bracketright, movecurrentworkspacetomonitor, r"
]
++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
list.concat (list.generate (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in [
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}"
]
)
10)
);
};
};
}

View file

@ -0,0 +1,17 @@
_: {
wayland.windowManager.hyprland.settings.windowrulev2 = [
"suppressevent fullscreen, class:steam_app_default"
"workspace 2, class:steam_app_default"
"suppressevent maximize, class:.*"
"tile, class:battle\.net\.exe"
"renderunfocused, class:discord, initialTitle:Discord"
"unset, title:Wine System Tray"
"workspace special:hidden silent, title:Wine System Tray"
"noinitialfocus, title:Wine System Tray"
"float, class:^(AlacrittyFloating)$"
];
}

View file

@ -0,0 +1,15 @@
{ std, ... }: let
inherit (std) list;
in {
wayland.windowManager.hyprland.settings.workspace = let
commonOptions = "gapsin:0,gapsout:0,rounding:false";
in
["1,monitor:DP-1,default:true,${commonOptions}"]
++ (list.map (
workspace: "${toString workspace},monitor:DP-1${commonOptions}"
) (list.range 2 10))
++ ["11,monitor:HDMI-A-1,default:true"]
++ (list.map (
workspace: "${toString workspace},monitor:HDMI-A-1${commonOptions}"
) (list.range 12 20));
}