To maximise all windows from the command line, it would be great if wmctrl
could be used as easily in minimizing all windows.
How do I can use it to do the reverse?
1 Answer
... the right answer for "command (line) minimize all" action is that of
wmctrl -k on
;
sadly to say it, there isn't the equivalent "countermesure" for wmctrl
to maximize all simply, but it can be used in a bash script as suggested here.
The code is
#!/bin/bash
# create a list of all open windows by ID
window_ids=$(wmctrl -l | cut -f1 -d " ")
# process every window by ID
for window_id in $window_ids
do
wmctrl -i -r "$window_id" -b add,fullscreen
done
exit 0
Don't forget to save your file under whatever name you want, and make it eXecutable:
chmod +x [myfile_bash]
Then you can also assign its link to a keyboard shortcut ;-)
I hope I've been helpful.