Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

does anyone know how to kill all Programs on a specific X display?

In example, I need to kill all Programs on Display :1. How is this possible?

share|improve this question
    
In what programming language? –  0xA3 Jul 31 '10 at 18:32
    
Bash Script - would be nice if this could be solved with built in commands ;) –  Anonymous Jul 31 '10 at 18:34
add comment

migrated from stackoverflow.com Aug 2 '10 at 16:02

This question came from our site for professional and enthusiast programmers.

2 Answers

xlsclients lists all clients with windows on the screen, and xkill kills them.

Why do you need this?

share|improve this answer
    
Im trying to build a screenshot factory for browsershots.org and i want to optimize the screenshooting process –  Anonymous Jul 31 '10 at 18:48
add comment
xkill -displayname :1 -all

quoth the manual:

This option indicates that all clients with top-level windows on the screen should be killed. Xkill will ask you to select the root window with each of the currently defined buttons to give you several chances to abort. Use of this option is highly discouraged.

and:

This command does not provide any warranty that the application whose connection to the X server is closed will abort nicely, or even abort at all. All this command does is to close the connection to the X server. Many existing applications do indeed abort when their connection to the X server is closed, but some can choose to continue.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.