Skip to content

Instantly share code, notes, and snippets.

@misebox
Created May 26, 2020 07:18
Show Gist options
  • Save misebox/cfe99d8c94c6ac1a950a44a5eb95a23a to your computer and use it in GitHub Desktop.
Save misebox/cfe99d8c94c6ac1a950a44a5eb95a23a to your computer and use it in GitHub Desktop.
Shellscript getting Window ID from command name with pgrep and xdotool.
#!/bin/bash
pid=`pgrep $1`
[ "$pid" != "" ] && xdotool search --onlyvisible --pid $pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment