NixOS/KiCad/Scripts/kicad-swap.sh
2026-03-30 13:10:42 +07:00

23 lines
761 B
Bash

#!/usr/bin/env bash
# Swap KiCad workspaces between monitors
# Supports both Hyprland (Wayland) and dwm (X11)
# ==============================================================================
# Environment Detection
# ==============================================================================
if [[ -n "${HYPRLAND_INSTANCE_SIGNATURE:-}" ]]; then
WM="hyprland"
else
WM="dwm"
fi
# ==============================================================================
# Main
# ==============================================================================
if [[ "$WM" == "hyprland" ]]; then
hyprctl dispatch swapactiveworkspaces DP-3 eDP-1
else
# Ensure we're on kicad tag on both monitors first
kicad-show
echo "mon-swap" > /tmp/dwm.fifo
fi