Script to focus and raise window demanding attention
I’m running Openbox with Gnome on Linux, and windows demanding attention show in
the taskbar with a yellow highlight, usually Skype IMs or something.
I’ve created the following bash script that I bind to a hotkey win-j, and pressing it changes to the correct desktop, raises the window, and focuses it. Huge time saver!
for id in `wmctrl -l | cut -d " " -f 1`; do
xprop -id $id | grep "_NET_WM_STATE_DEMANDS_ATTENTION" 2>&1 > /dev/null
if [ "$?" = "0" ]; then
wmctrl -i -a $id
exit 0
fi
done
exit 1
Requirements: Wmctrl (sudo apt-get install wmctrl)
Here’s another adaptation I’ve added. Two scripts, one bound to Win-r to jump to the window demanding attention, and another bound to W-Shift-r that jumps back to the window you were busy with.
First:
#!/bin/bash
activeWinIdLine=`xprop -root | grep _NET_ACTIVE_WINDOW\(WINDOW\) `
activeWinId="${activeWinIdLine:40}"
echo $activeWinId > ~/activeWinId
for id in `wmctrl -l | cut -d " " -f 1`; do
xprop -id $id | grep "_NET_WM_STATE_DEMANDS_ATTENTION" 2>&1 > /dev/null
if [ "$?" = "0" ]; then
wmctrl -i -a $id
exit 0
fi
done
exit 1
Second:
#!/bin/bash if [ -f ~/activeWinId ]; then origWinId=`cat ~/activeWinId` wmctrl -i -a $origWinId fi
Researchers Say Women Secretly Desire Hairy Geeks
“The Daily Mail has a story about a study looking into women’s preference for men. More specifically, about how women say they want one kind of man, but really want another. From the article: ‘Most women claim to be attracted to tall, dark and handsome men, but a new study has revealed that facial stubble and a geeky personality are their biggest secret turn-ons. Despite complaining that it looks unkempt and feels rough to touch, the unshaven look on a man is actually a turn-on for 41 per cent of women. A slightly geeky personality came second, proving that women really do like a guy who knows their stuff when it comes to technology. A hairy chest was voted third, followed by a man who loves to read or cries at a soppy film.’”
[via Slashdot]
