pid of manually selecting window

xprop | awk '/PID/ {print $3}'

By: totti
2013-01-25 08:04:07

These Might Interest You

  • When recording screencast some people like to have the image from their webcam, so the can show something, that can't be seen on the desktop. So starting mplayer with these parameters you will have a window with no frames, borders whatsoever, and selecting the window a hitting the "F" key you will bring it in fullscreen. if you want to position the frame somewhere else, you could play with the --geomeptry option where 100%:100% mean bottom right corner. The HEIGHT and WIDTH can't be changed as you like, since the most webcams support specified dimensions, so you would have to play with it to see what is supported

    mplayer -cache 128 -tv driver=v4l2:width=176:height=177 -vo xv tv:// -noborder -geometry "95%:93%" -ontop
    vkolev · 2010-11-21 00:08:44 0
  • After executing this, click on a window you want to track X Window events in. Explaination: "xev will track events in the window with the following -id, which we get by greping window information obtained by xwininfo" Show Sample Output

    xev -id `xwininfo | grep 'Window id' | awk '{print $4}'`
    ktoso · 2009-09-19 22:47:16 0
  • Add this to your $HOME/.bashrc file. It will only set this prompt if it is running inside screen ($WINDOW var is set) Looks like this... ion@atomos:~[2]$ Show Sample Output

    [[ "$WINDOW" ]] && PS1="\u@\h:\w[$WINDOW]\$ "
    recursiverse · 2009-07-23 06:46:19 2

  • 4
    import -window `xwininfo | awk '/Window id/{print $4; exit}'` `uuidgen`.png
    kev · 2011-11-23 03:48:40 3

What Others Think

This is really great to make a tiny shortcut for killing unreponsive windows: kill -9 $(xprop | awk '/PID/ {print $3}') Thank you!
michelsberg · 278 weeks and 2 days ago
Nifty. Seems like xkill would work if your disto has it.
__ · 277 weeks and 3 days ago
killing unreponsive windows xkill -button 1
totti · 276 weeks and 6 days ago
Use the X 3 finger salute: ctrl-alt-esc and click on the unresponsive window
seattlegaucho · 273 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: