Files
dotfiles/dotfiles/config/hypr/scripts/gather-class.sh
Ivan Malison cc05a1d790 Add Hyprland with hy3 plugin for XMonad-like tiling
Configure Hyprland to use the hy3 plugin for dynamic tiling similar to
XMonad. Uses official Hyprland and hy3 flakes pinned to v0.53.0 for
proper plugin compatibility (nixpkgs packaging had header issues).

Key changes:
- Add hyprland and hy3 flake inputs with version pinning
- Rewrite hyprland.conf with hy3 layout and XMonad-like keybindings
- Add helper scripts for window management (bring, replace, gather, etc.)
- WASD directional navigation using hy3:movefocus/movewindow
- Tab groups, horizontal/vertical splits via hy3:makegroup
- Scratchpads via Hyprland special workspaces

Also removes org-agenda-api flake integration (moved elsewhere).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:34:45 -05:00

31 lines
965 B
Bash
Executable File

#!/usr/bin/env bash
# Gather all windows of the same class as focused window (like XMonad's gatherThisClass)
set -euo pipefail
# Get focused window class
FOCUSED_CLASS=$(hyprctl activewindow -j | jq -r '.class')
CURRENT_WS=$(hyprctl activeworkspace -j | jq -r '.id')
if [ "$FOCUSED_CLASS" = "null" ] || [ -z "$FOCUSED_CLASS" ]; then
notify-send "Gather Class" "No focused window"
exit 0
fi
# Find all windows with same class on other workspaces
WINDOWS=$(hyprctl clients -j | jq -r ".[] | select(.class == \"$FOCUSED_CLASS\" and .workspace.id != $CURRENT_WS and .workspace.id >= 0) | .address")
if [ -z "$WINDOWS" ]; then
notify-send "Gather Class" "No other windows of class '$FOCUSED_CLASS'"
exit 0
fi
# Move each window to current workspace
COUNT=0
for ADDR in $WINDOWS; do
hyprctl dispatch movetoworkspace "$CURRENT_WS,address:$ADDR"
((COUNT++))
done
notify-send "Gather Class" "Gathered $COUNT windows of class '$FOCUSED_CLASS'"