22 lines
717 B
Bash
Executable File
22 lines
717 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Define your targets
|
|
TARGET_CLASS="kitty"
|
|
TARGET_TAG="compiler"
|
|
|
|
WINDOW_ADDR=$(hyprctl clients -j | jq -r '.[] | select(.tags[]? == "compiler" and .class == "kitty") | .address')
|
|
|
|
if [ -z "$WINDOW_ADDR" ] || [ "$WINDOW_ADDR" == "null" ]; then
|
|
notify-send "Target Error" "No window found with tag $TARGET_TAG"
|
|
exit 1
|
|
fi
|
|
|
|
# Focus the window
|
|
# hyprctl dispatch focuswindow address:$WINDOW_ADDR
|
|
echo $WINDOW_ADDR
|
|
hyprctl dispatch sendshortcut CTRL ,UP, address:"$WINDOW_ADDR"
|
|
# hyprctl dispatch sendshortcut ,Return, address:"$WINDOW_ADDR"
|
|
# Send the command using wtype (Wayland's xdotool alternative)
|
|
# This types the command and presses Enter
|
|
sleep 0.1 # Small delay to ensure focus has shifted
|