Announcement

Collapse
No announcement yet.

Terminate window

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Terminate window

    Is there a way to add force-quit button to the panel similar to the way it is done in ubuntu. It is nice way to terminate programs that hang all the time.


    #2
    Re: Terminate window

    Dinkoarun,

    right-click on the panel, select Add Application > Non-KDE Application and put in kdesu /usr/bin/xkill as Executable (obviously, there's no point in using this tool as ordinary user ...). That should do the trick.

    Remark: this won't work for processes without a visible interface (sometimes, even the child processes of "visible ones" stay alive). So, don't expect too much.

    HTH
    Birdy

    Comment


      #3
      Re: Terminate window

      Originally posted by penguin.ch
      Dinkoarun,

      right-click on the panel, select Add Application > Non-KDE Application and put in kdesu /usr/bin/xkill as Executable (obviously, there's no point in using this tool as ordinary user ...). That should do the trick.

      Remark: this won't work for processes without a visible interface (sometimes, even the child processes of "visible ones" stay alive). So, don't expect too much.

      HTH
      Birdy
      This works great. Just a small question. It asks for the root password everytime I click on it. Is there a way for it to stop asking that?

      Comment


        #4
        Re: Terminate window

        Originally posted by dinkoarun
        This works great. Just a small question. It asks for the root password everytime I click on it. Is there a way for it to stop asking that?
        Actually, you can 'kill' most windows as a user...so you don't need to 'kdesu' it. As a general rule only programs you've started 'as root' with sudo/kdesu need root privileges to terminate.

        There is also a keyboard shortcut you can set to 'terminate' a window, the default shortcut being Ctrl+Alt+Esc (you can change the shortcut in systemsettings)

        EDIT:
        And as mentioned, sometimes killing the window may leave processes running, you can get a process list (and kill processes) with Ctrl+Esc (also changeable)

        Comment


          #5
          Re: Terminate window

          Originally posted by kubicle
          Originally posted by dinkoarun
          This works great. Just a small question. It asks for the root password everytime I click on it. Is there a way for it to stop asking that?
          Actually, you can 'kill' most windows as a user...so you don't need to 'kdesu' it. As a general rule only programs you've started 'as root' with sudo/kdesu need root privileges to terminate.

          There is also a keyboard shortcut you can set to 'terminate' a window, the default shortcut being Ctrl+Alt+Esc (you can change the shortcut in systemsettings)

          EDIT:
          And as mentioned, sometimes killing the window may leave processes running, you can get a process list (and kill processes) with Ctrl+Esc (also changeable)
          This is perfect. Thanks

          Comment


            #6
            Re: Terminate window

            This is not original - I took it from:

            http://www.ubuntuforums.org/archive/.../t-129692.html

            As a new linux/Ubuntu user, I have had some difficulties understanding the "kill" command to end a process that has frozen or is just unwanted for some mysterious reason. I thought it was difficult to figure out, and I didn't find anything in the forum about it, so now I am writing this HOWTO to help others like myself. If you think I should add something, just reply below or send me a private message. (not sure where to post this, so moderators feel free to move)

            Before we begin I might say that there is a tool in Gnome for this, called the System monitor. You can find this in your main menu at Applications -> System Tools -> System monitor. However, this tool does not list all of your processes, so the kill command might still come in handy. (Oh, and if you just want to kill something running in a window, try adding the "Force quit" to one of your panels and you get a mouse operated kill tool)

            Syntax of the kill command is:
            kill [-s sigspec | -n signum | -sigspec] [pid | job]
            The sigspec is what kind of a signal you want to send to your process. This is a value between 1 to 64. If you want to know which one is which you can type "kill -l" in a terminal. The signals are usually a range from friendly to hostile ways of saying "I don't want you running no more". For example:
            kill -1 would mean something like "please save your data and exit"
            kill -15 (default) would mean something like "just quit, will you? I don't care if you save or not"
            kill -9 would mean something like "die you bastard, die!"

            So now we have to define which process we want to send this signal to. This is done by providing the PID (Process ID). So what if we don't know the PID, or maybe even don't know if the process is running or not. Well, then we have to use a different command: "ps"
            ps -A
            The above code will list all of the processes running on your computer. If you only run "ps" you will get a list of processes started from the terminal you are currently running. If you run "ps x" you will get a list of processes that are not connected to a terminal, like gnome components. However, "ps -A" will usually return a lengthy list of processes, and if you want to save a few seconds looking for "your" process there is an easy way of sorting out the essentials of the list: grep.
            ps -A | grep name_of_my_process_I_want_the_PID_of

            The PID is the number displayed to the left of each process in the list that comes up from your command. So just find the process you want to terminate and write down the PID on that row. If I for example run "ps" in a terminal right now, I find out that bash, the shell, has PID 11424 in this terminal. So if I want to ask bash to please exit from memory I will just type:
            kill -1 11424
            *POOF* My terminal window is gone, because I removed it's protective shell and my gnome ate the contents. :cool:

            Now, a warning might be in place here. Do not kill processes if you don't know what it is. The consequences might be dire. Killing sprees are for games only.

            EDIT: About killall command:
            There is another command that might be useful to know, if you know the name of a process but not the PID and think "ps -A | grep process" is difficult to use, you can use killall like so:
            killall bash
            Is supposed to do the same as "kill -1 11424" in the above example, only that the sigterm will be 15, so it's a lot more hostile and will not allow the process to save any data. Anyhow, when I do it, guess what, nothing happens. But it's supposed to work like that. :P
            I hope it helps...

            Comment


              #7
              Re: Terminate window

              I like to kill it from the ksysguard program. this will kill the process completely. as mentioned by kubicle the process can continue running in the background even though the windows is closed. using the ksysguard is the same thing as task manager in windows and allows you to kill programs without logging in as sudo.

              Comment

              Working...
              X