LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


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

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


Hi,

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"
done


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
zghh
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"
done

sleep 1

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



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..
 
  


Reply



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 window.open() 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:26 PM.

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