How to xkill an application by its id?

Posted by Hanynowsky on Ask Ubuntu See other posts from Ask Ubuntu or by Hanynowsky
Published on 2012-11-11T16:51:55Z Indexed on 2012/11/11 17:14 UTC
Read the original article Hit count: 322

Filed under:
|

I need to simulate the behavior of the keyboard shortcut (ALT+F4) using Terminal for a given application.

If I open for example gedit and click ALT + F4 , then GEDIT will be xkilled. If I want to achieve same thing using Terminal, how should I proceed?

The command

export PIDTOKILL=pidof gedit | grep [^*]; xkill -id $PIDTOKILL

does not work and gives the following error:

xkill:  killing creator of resource 0x3f38
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  113 (X_KillClient)
  Value in failed request:  0x3f38
  Serial number of failed request:  8
  Current serial number in output stream:  9

I think I am confusing application id and process id here

© Ask Ubuntu or respective owner

Related posts about xorg

Related posts about bash