Sunday, April 28, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 7531  / 2 Years ago, thu, april 28, 2022, 7:07:05

I need to maximize the window of an application when it's minimized using the command line only..



So how to do that knowing the process ID.



When working on the wmctrl command i got the following error:



X Error of failed request:  BadWindow (invalid Window parameter)
Major opcode of failed request: 20 (X_GetProperty)
Resource id in failed request: 0x6718
Serial number of failed request: 11
Current serial number in output stream: 11

More From » command-line

 Answers
3

This should work:



xdotool windowactivate `xdotool search --pid YOUR_PID_HERE | tail -1`


xdootool reports a quite a few window id-s when looking up by pid, so I "tailed" the output to only get the last window id from the output. For me it worked well with both Firefox and gnome-calculator. If xdotool only reports one window id for your pid then the tail pipe is of course unnecessary.


[#28161] Thursday, April 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
splenueak

Total Points: 448
Total Questions: 118
Total Answers: 110

Location: Vanuatu
Member since Mon, Oct 3, 2022
2 Years ago
;