A command to raise X Window, which is like a following shell script but faster.
```bash command="..."
while read line; do pid="$(echo "$line" | cut -d" " -f4)" if [ "x${command}" = "x$(cat "/proc/${pid}/cmdline")" ]; then windowid="$(echo "$line" | cut -d" " -f1)" exec wmctrl -i -R "$windowid" fi done <<< "$(wmctrl -l -p)"
exec "${command}" ```
bash
$ cargo install xraise
```bash $ xraise 24183 /opt/google/chrome/chrome: 'GitHub - Google Chrome' 24183 /opt/google/chrome/chrome: 'LINE' 22179 /usr/lib/slack/slack: 'Slack - k0kubun' 26781 /usr/share/nocturn/Nocturn: 'Nocturn' 27546 urxvt: 'urxvt'
$ xraise /usr/lib/slack/slack $ xraise urxvt
$ xraise /opt/google/chrome/chrome "Google Chrome" # tail match $ xraise /opt/google/chrome/chrome LINE ```
MIT License