refactor(hyprland): decentralize window rules and binds

This commit is contained in:
kenji
2026-01-05 12:42:53 -06:00
parent daa3ed6eef
commit 2ed2e28ba2
9 changed files with 92 additions and 57 deletions
+14
View File
@@ -8,6 +8,20 @@
exec-once = [
"uwsm app -- pywalfox start"
];
bindd = [
"SUPER, W, Open Browser, exec, uwsm app -- firefox"
"SUPER, Y, Toggle YouTube, togglespecialworkspace, youtube"
"SUPER SHIFT, Y, Move to YouTube Special Workspace, movetoworkspace, special:youtube"
];
workspace = [
"special:youtube, on-created-empty:uwsm app -- firefox -P YouTube --name youtube"
];
windowrulev2 = [
"workspace special:youtube, class:^(youtube)$"
];
};
imports = [
inputs.textfox.homeManagerModules.default
+5
View File
@@ -62,6 +62,11 @@
};
};
wayland.windowManager.hyprland.settings.bindd = [
"SUPER, P, Toggle Preload, togglespecialworkspace, preload"
"SUPER SHIFT, P, Move to Preload Special Workspace, movetoworkspace, special:preload"
];
wayland.windowManager.hyprland.settings.exec-once = [
"[workspace special:preload silent] uwsm app -- xdg-terminal-exec"
"[workspace 1] uwsm app -- ghostty -e bash -c 'fastfetch; exec $SHELL'" # TODO: must be xdg-terminal-exec, or default user terminal
-20
View File
@@ -15,7 +15,6 @@
# essential
"SUPER, Return, Open Terminal, exec, uwsm app -- xdg-terminal-exec"
"SUPER, Q, Kill active, killactive"
"SUPER, SPACE, Open Vicinae, exec, vicinae toggle"
# resize
"SUPER CTRL, H, Resize Left, resizeactive, -40 0"
@@ -43,29 +42,10 @@
"SUPER, O, Toggle Split, layoutmsg, togglesplit"
# apps
"SUPER, W, Open Browser, exec, uwsm app -- firefox" # TODO: must be modular
# "SUPER, SPACE, Open App Launcher, exec, nc -U $XDG_RUNTIME_DIR/walker/walker.sock"
"SUPER, T, Toggle Steam, togglespecialworkspace, steam"
"SUPER SHIFT, T, Move to Steam Special Workspace, movetoworkspace, special:steam"
"SUPER, M, Toggle Music, togglespecialworkspace, music"
"SUPER SHIFT, M, Move to Music Special Workspace, movetoworkspace, special:music"
"SUPER, Y, Toggle YouTube, togglespecialworkspace, youtube"
"SUPER SHIFT, Y, Move to YouTube Special Workspace, movetoworkspace, special:youtube"
"SUPER, P, Toggle Preload, togglespecialworkspace, preload"
"SUPER SHIFT, P, Move to Preload Special Workspace, movetoworkspace, special:preload"
"SUPER SHIFT, T, Move to Steam Special Workspace, movetoworkspace, special:steam"
"SUPER CTRL, I, Switch Wallpaper, exec, hakase-wallpaper-switch"
# Screenshots
"SUPER, S, Screenshot Region (with edit), exec, screenshot region"
"SUPER SHIFT, S, Screenshot Active Window, exec, screenshot window"
"SUPER ALT, S, Quick Screenshot (no edit), exec, screenshot region-save"
"SUPER ALT SHIFT, S, Screenshot Current Monitor, exec, screenshot screen"
# TODO:
# add text clipping from pictures
# add screen recording
-31
View File
@@ -1,8 +1,6 @@
{
wayland.windowManager.hyprland.settings = {
workspace = [
"special:youtube, on-created-empty:uwsm app -- firefox -P YouTube --name youtube"
"special:music, on-created-empty:hakase-music-launch"
];
windowrulev2 = [
@@ -20,38 +18,9 @@
"dimaround, class:^(org\.hakase\.switch-wallpaper)$"
"dimaround, initialTitle:^(Wallpaper Selector)$"
# --- STEAM RULES ---
"workspace special:steam silent, class:^(steam)$"
"noinitialfocus, class:^(steam)$"
"suppressevent activate, class:^(steam)$"
# --- MUSIC RULES (Jellyfin-TUI) ---
"workspace special:music silent, title:^(jellyfin-tui)$"
"workspace special:music silent, initialTitle:^(jellyfin-tui)$"
# --- CAVA RULES ---
"workspace special:music silent, title:^(cava)$"
"workspace special:music silent, initialTitle:^(cava)$"
# --- YOUTUBE RULES ---
"workspace special:youtube, class:^(youtube)$"
# --- GAMING RULES ---
# Steam Apps, Gamescope, Lutris, Heroic, and Wine/Proton apps
"fullscreen, class:^steam_app_\d+$"
"monitor 0, class:^steam_app_\d+$"
"workspace 1, class:^steam_app_\d+$"
"fullscreen, class:^(gamescope)$"
"fullscreen, class:^(lutris)$"
"fullscreen, class:^(heroic)$"
"fullscreen, class:^wine-.*$"
"fullscreen, title:^Wine .*$"
# --- IMAGE VIEWER (Loupe) ---
"float, class:^(org\.gnome\.Loupe)$"
"center, class:^(org\.gnome\.Loupe)$"
"size 70% 70%, class:^(org\.gnome\.Loupe)$"
];
};
}
+7
View File
@@ -13,4 +13,11 @@
"image/tiff" = "org.gnome.Loupe.desktop";
};
};
wayland.windowManager.hyprland.settings.windowrulev2 = [
# --- IMAGE VIEWER (Loupe) ---
"float, class:^(org\.gnome\.Loupe)$"
"center, class:^(org\.gnome\.Loupe)$"
"size 70% 70%, class:^(org\.gnome\.Loupe)$"
];
}
+8
View File
@@ -59,4 +59,12 @@ in {
early_exit=false
fill_shape=false
'';
wayland.windowManager.hyprland.settings.bindd = [
# Screenshots
"SUPER, S, Screenshot Region (with edit), exec, screenshot region"
"SUPER SHIFT, S, Screenshot Active Window, exec, screenshot window"
"SUPER ALT, S, Quick Screenshot (no edit), exec, screenshot region-save"
"SUPER ALT SHIFT, S, Screenshot Current Monitor, exec, screenshot screen"
];
}
+9 -3
View File
@@ -42,7 +42,13 @@
# Ensure vicinae themes directory exists for matugen output
home.file.".local/share/vicinae/themes/.keep".text = "";
wayland.windowManager.hyprland.settings.exec-once = [
"vicinae server"
];
wayland.windowManager.hyprland.settings = {
exec-once = [
"vicinae server"
];
bindd = [
"SUPER, SPACE, Open Vicinae, exec, vicinae toggle"
];
};
}