Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-20-2006, 03:06 PM   #1
LQ Newbie
Registered: Dec 2006
Posts: 19

Rep: Reputation: 0
Close all window in a window manager


I'm looking for a script that close all the windows running in a window manager (icewm in my case). I found the following code in this forum:

for app in `wmctrl `; do
wmctrl -c "$app"

It closes some windows but not all (firefox with mutliple tabs open for instance asks for a confirmation).

How to kill all the other windows once this firts script has been run ?

Thanks for any help
Old 12-20-2006, 03:18 PM   #2
LQ Newbie
Registered: Dec 2006
Posts: 19

Original Poster
Rep: Reputation: 0
Just found an answer:

for app in `wmctrl -l `; do
wmctrl -c "$app"

sleep 1

for app in ` wmctrl -l | cut -d' ' -f 1 `; do
xkill -id "$app"

Howether, for the second part (killing the windows that did not closed in the first loop), I would prefer sending a SIGKILL signal, if someone has a soution how to do that..


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the best X-Window System window manager in your opinion? t3gah Linux - Software 9 12-16-2006 10:10 PM
Javascript - what to use rather than window.close() then davee Programming 2 04-11-2005 08:28 AM
close a window with script box_l Programming 0 07-27-2004 07:57 AM
close window causes reboot aarean Linux - Software 4 03-22-2004 08:10 PM
Close Mozilla window taoweijia Programming 1 12-17-2003 12:09 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration