#!/usr/bin/env sh # Sends a \ key to all mpv instances pausing with the pause_toggle.lua script TERMINAL="st" #hotfix for now pstree -p | grep "$TERMINAL.*{mpv}" | sed "s/.*$TERMINAL(\([0-9]*\)).*/\1/" | xargs -I @ xdotool search --pid @ | xargs -I % xdotool key --window % backslash pgrep mpv | xargs -I @ xdotool search --pid @ | xargs -I % xdotool key --window % backslash