How to get an X11 Window from a Process ID?

后端 未结 8 703
孤街浪徒
孤街浪徒 2020-11-27 11:30

Under Linux, my C++ application is using fork() and execv() to launch multiple instances of OpenOffice so as to view some powerpoint slide shows. This part works.

Ne

8条回答
  •  清酒与你
    2020-11-27 12:27

    Try installing xdotool, then:

    #!/bin/bash
    # --any and --name present only as a work-around, see: https://github.com/jordansissel/xdotool/issues/14
    ids=$(xdotool search --any --pid "$1" --name "dummy")
    

    I do get a lot of ids. I use this to set a terminal window as urgent when it is done with a long command, with the program seturgent. I just loop through all the ids I get from xdotool and run seturgent on them.

提交回复
热议问题