#!/bin/bash # Get focused app_id app_id=$(swaymsg -t get_tree | jq -r ' .. | ((.nodes? + .floating_nodes?) // empty) | .[] | select(.focused and .pid).app_id ' -r) echo $app_id if [[ "$app_id" == "Alacritty" ]]; then wtype -M ctrl -M shift -k v -m shift -m ctrl else wtype -M ctrl -k v -m ctrl fi