I'm working on a program that can query running X apps, save all the commands of running apps and them reopen them latter.
I encounter an issue. wmctctl can query the pid of Onlyoffice, for example the pid is 123. Then run ps -ef -q 123
, I see that the CMD is ./DesktopEditors
which should be a invalid command, because ./one_command
only can work in special folder include file one_command.
I can get a complete command by running ps -ef -q $(pgrep -P 123)
.
Is there a straight way to get the complete command of Onlyoffice just via wmctl
and ps
?
If there is a better way to get all commands of X apps, please let me know. Thanks.