contextual-copy.sh 319 B

1234567891011121314151617
  1. #!/bin/bash
  2. # Get focused app_id
  3. app_id=$(swaymsg -t get_tree | jq -r '
  4. ..
  5. | ((.nodes? + .floating_nodes?) // empty)
  6. | .[] | select(.focused and .pid).app_id
  7. ' -r)
  8. echo $app_id
  9. if [[ "$app_id" == "Alacritty" ]]; then
  10. wtype -M ctrl -M shift -k c -m shift -m ctrl
  11. else
  12. wtype -M ctrl -k c -m ctrl
  13. fi