From f655e5223d95f1e29f7ce2e3a4f9fc8af53216c2 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sun, 26 Oct 2025 21:19:00 +0100 Subject: [PATCH] [hypr] Add hy3 addon --- nixos/modules/desktop/hyprland/default.nix | 2 + stow/hyprland/.config/hypr/hy3.conf | 164 +++++++++++++++++++++ stow/hyprland/.config/hypr/hyprland.conf | 13 +- stow/hyprland/.config/hypr/keybinds.conf | 8 +- 4 files changed, 175 insertions(+), 12 deletions(-) create mode 100644 stow/hyprland/.config/hypr/hy3.conf diff --git a/nixos/modules/desktop/hyprland/default.nix b/nixos/modules/desktop/hyprland/default.nix index 3049fbe..6d7d25b 100644 --- a/nixos/modules/desktop/hyprland/default.nix +++ b/nixos/modules/desktop/hyprland/default.nix @@ -27,6 +27,8 @@ in { wl-mirror # Mirror an output wdisplays # Tool to configure displays + hyprlandPlugins.hy3 # i3/sway layout plugin + swaylock glib diff --git a/stow/hyprland/.config/hypr/hy3.conf b/stow/hyprland/.config/hypr/hy3.conf new file mode 100644 index 0000000..7d3e999 --- /dev/null +++ b/stow/hyprland/.config/hypr/hy3.conf @@ -0,0 +1,164 @@ + +# TODO Do not hardcode this path +plugin = /nix/store/afivj8v5kfdsadxs4pa45vh0y65s3ajm-hy3-hl0.49.0/lib/libhy3.so + +general:layout = hy3 + +plugin { + hy3 { + # disable gaps when only one window is onscreen + # 0 - always show gaps + # 1 - hide gaps with a single window onscreen + # 2 - 1 but also show the window border + no_gaps_when_only = 1 # default: 0 + + # policy controlling what happens when a node is removed from a group, + # leaving only a group + # 0 = remove the nested group + # 1 = keep the nested group + # 2 = keep the nested group only if its parent is a tab group + node_collapse_policy = 2 # default: 2 + + # offset from group split direction when only one window is in a group + group_inset = 10 # default: 10 + + # if a tab group will automatically be created for the first window spawned in a workspace + tab_first_window = false + + # tab group settings + tabs { + # height of the tab bar + height = 10 # default: 22 + + # padding between the tab bar and its focused node + padding = 0 # default: 6 + + # the tab bar should animate in/out from the top instead of below the window + from_top = false # default: false + + # radius of tab bar corners + radius = 0 # default: 6 + + # tab bar border width + border_width = 2 # default: 2 + + # render the window title on the bar + render_text = false # default: true + + # center the window title + text_center = true # default: true + + # font to render the window title with + text_font = Sans # default: Sans + + # height of the window title + text_height = 8 # default: 8 + + # left padding of the window title + text_padding = 3 # default: 3 + + # active tab bar segment colors + #col.active = # default: rgba(33ccff40) + #col.active.border = # default: rgba(33ccffee) + #col.active.text = # default: rgba(ffffffff) + + # active tab bar segment colors for bars on an unfocused monitor + #col.active_alt_monitor = # default: rgba(60606040) + #col.active_alt_monitor.border = # default: rgba(808080ee) + #col.active_alt_monitor.text = # default: rgba(ffffffff) + + # focused tab bar segment colors (focused node in unfocused container) + #col.focused = # default: rgba(60606040) + #col.focused.border = # default: rgba(808080ee) + #col.focused.text = # default: rgba(ffffffff) + + # inactive tab bar segment colors + col.inactive = rgba(a6a6a620) # default: rgba(30303020) + col.inactive.border = rgba(a6a6a6aa) # default: rgba(606060aa) + #col.inactive.text = # default: rgba(ffffffff) + + # urgent tab bar segment colors + #col.urgent = # default: rgba(ff223340) + #col.urgent.border = # default: rgba(ff2233ee) + #col.urgent.text = # default: rgba(ffffffff) + + # urgent tab bar segment colors + #col.locked = # default: rgba(90903340) + #col.locked.border = # default: rgba(909033ee) + #col.locked.text = # default: rgba(ffffffff) + + # if tab backgrounds should be blurred + # Blur is only visible when the above colors are not opaque. + blur = true # default: true + + # opacity multiplier for tabs + # Applies to blur as well as the given colors. + opacity = 1.0 # default: 1.0 + } + + # autotiling settings + autotile { + # enable autotile + enable = true # default: false + + # make autotile-created groups ephemeral + ephemeral_groups = true # default: true + + # if a window would be squished smaller than this width, a vertical split will be created + # -1 = never automatically split vertically + # 0 = always automatically split vertically + # = pixel width to split at + trigger_width = -1 # default: 0 + + # if a window would be squished smaller than this height, a horizontal split will be created + # -1 = never automatically split horizontally + # 0 = always automatically split horizontally + # = pixel height to split at + trigger_height = 0 # default: 0 + + # a space or comma separated list of workspace ids where autotile should be enabled + # it's possible to create an exception rule by prefixing the definition with "not:" + # workspaces = 1,2 # autotiling will only be enabled on workspaces 1 and 2 + # workspaces = not:1,2 # autotiling will be enabled on all workspaces except 1 and 2 + workspaces = all # default: all + } + } +} + +# Keybinds + +# Navigation + +# Focus + +# First, unbind default +unbind = $flag, $up +unbind = $flag, $right +unbind = $flag, $down +unbind = $flag, $left + +unbind = $flag, up +unbind = $flag, right +unbind = $flag, down +unbind = $flag, left + +bind = $flag, $up, hy3:movefocus, u +bind = $flag, $right, hy3:movefocus, r +bind = $flag, $down, hy3:movefocus, d +bind = $flag, $left, hy3:movefocus, l + +bind = $flag, up, hy3:movefocus, u +bind = $flag, right, hy3:movefocus, r +bind = $flag, down, hy3:movefocus, d +bind = $flag, left, hy3:movefocus, l + +# Layout +bind = $flag, z, hy3:changegroup, opposite +bind = $flag, x, hy3:changegroup, toggletab +bind = $flag, c, hy3:changegroup, h +bind = $flag, v, hy3:changegroup, v + +bind = $flag, p, hy3:changefocus, raise +bind = $flag+Shift, p, hy3:changefocus, lower +bind = $flag, space, hy3:togglefocuslayer + diff --git a/stow/hyprland/.config/hypr/hyprland.conf b/stow/hyprland/.config/hypr/hyprland.conf index cdcf89e..84fb8cb 100644 --- a/stow/hyprland/.config/hypr/hyprland.conf +++ b/stow/hyprland/.config/hypr/hyprland.conf @@ -201,7 +201,6 @@ xwayland { opengl { nvidia_anti_flicker = false - force_introspection = 2 } render { @@ -250,7 +249,7 @@ exec-once = wlsunset -t 2500 -l 50.51 -L 4.21 exec-once = nextcloud --background # Turn volume off at boot -exec-once = pactl set-sink-mute @DEFAULT_SINK@ 1 +exec-once = wpctl set-mute @DEFAULT_SINK@ 1 # STYLING exec-once = swaybg -i "${HOME}/.local/state/sisyphus/bg" --mode=fill @@ -268,11 +267,13 @@ $term = foot $menu = j4-dmenu-desktop --dmenu="rofi -dmenu -i" --no-generic --usage-log="/home/tdpeuter/.local/state/dmenu.log" --term=$term $lock = swaylock --daemonize -source = /home/tdpeuter/.config/hypr/input-output.conf -source = /home/tdpeuter/.config/hypr/keybinds.conf -source = /home/tdpeuter/.config/hypr/modes.conf - # https://wiki.hyprland.org/Nvidia/#environment-variables env = __GLX_VENDOR_LIBRARY_NAME,nvidia env = LIBVA_DRIVER_NAME,nvidia env = NVD_BACKEND,direct + +source = /home/tdpeuter/.config/hypr/input-output.conf +source = /home/tdpeuter/.config/hypr/keybinds.conf +source = /home/tdpeuter/.config/hypr/modes.conf +source = /home/tdpeuter/.config/hypr/hy3.conf # Sway tiling plugin + diff --git a/stow/hyprland/.config/hypr/keybinds.conf b/stow/hyprland/.config/hypr/keybinds.conf index 26385f3..1a4f1e1 100644 --- a/stow/hyprland/.config/hypr/keybinds.conf +++ b/stow/hyprland/.config/hypr/keybinds.conf @@ -45,11 +45,6 @@ bind = $flag, Prior, togglespecialworkspace, special:scratchpad # bind = $flag, KP_Next, togglespecialworkspace, magic # Layouts -# bind = $flag, z, layout toggle split -# bind = $flag, x, layout tabbed -# bind = $flag, c, split horizontal -# bind = $flag, v, split vertical - bind = $flag, f, togglefloating bind = $flag+Shift, f, settiled @@ -171,7 +166,8 @@ bind = CTRL&ALT, T, exec, $term bind = Alt, Space, exec, $menu bind = Alt, Tab, focuscurrentorlast -bind = $flag, e, exec, $term -e vifm +bind = $flag, e, exec, $term -e vifm +bind = Ctrl+Shift, Escape, exec, $term -e zenith bind = Ctrl+Shift, a, exec, notify-send "hole!" && hyprctl setcursor _ 87 && sleep 5 && hyprctl setcursor _ 24