How to close all windows of a given program at once

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
TwoPuppies
Posts: 77
Joined: Wed 29 Dec 2010, 05:13
Location: Melbourne, Australia

#41 Post by TwoPuppies »

MochiMoppel wrote:For closing all windows on all desktops you can use something like this:

Code: Select all

WIN_ID=$(wmctrl -l | awk '{print $1}')
for i in $WIN_ID; do
	wmctrl -ic $i
done
Excellent. Thank you.
[color=#006699]What you really need is two puppies:
Puppy Linux, and the sort with four legs and a tail.[/color]

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#42 Post by MochiMoppel »

User gychang requested here to close all minimized windows at once.

One way to do this:

Code: Select all

WIN_ID=$(wmctrl -l | awk '{print $1}') 
for i in $WIN_ID; do 
[[ $(xprop -id $i WM_STATE) = *Iconic* ]] && wmctrl -ic $i
done

User avatar
gychang
Posts: 414
Joined: Sat 29 Nov 2008, 20:30
Location: San Diego, CA

#43 Post by gychang »

MochiMoppel wrote:User gychang requested here to close all minimized windows at once.

One way to do this:

Code: Select all

WIN_ID=$(wmctrl -l | awk '{print $1}') 
for i in $WIN_ID; do 
[[ $(xprop -id $i WM_STATE) = *Iconic* ]] && wmctrl -ic $i
done
this script works well!
---
trying to learn puppylinux... :D
---

Post Reply