Hey folks - I'm trying to make a switch to chrome and one of the things I didn't want to give up was some of my functionality with tabmix plus, so I thought I'd try to script it with xbindkeys and xdotools. I'm okay with doing this any way possible to achieve the end I'm looking for.
My xbindkeysrc line:
Code:
"/home/xxxx/.scripts/chrome_duptab.sh"
m:0x14 + c:28
Control+Mod2 + t
That works as expected, and it calls the script. The script works as expected in Chrome, but doesn't 'pass through' ctrl+t to other applications like I was expecting/hoping, hence the post!
Code:
#!/bin/sh
# To get the window class of Chrome - run this and then click on chrome:
# xprop -id $(xdotool selectwindow) | awk '/WM_CLASS/{print $4}'
which xdotool >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "xdotool must be installed to use this program."
exit 1
fi
ActiveWindow="$(xdotool getactivewindow)"
ActiveClass="$(xprop -id ${ActiveWindow} | awk '/WM_CLASS/{print $4}' | sed 's/\"//g')"
SearchClass="Chromium"
if [ "${ActiveClass}" = "${SearchClass}" ]; then
xdotool keydown alt
sleep 0.1
xdotool key d
sleep 0.1
xdotool key Return
sleep 0.1
xdotool keyup alt
else
xdotool key ctrl+t
fi
exit
I've tried a few variations, and I'm not seeing an infinite loop like I was worried about, but it's certainly not working... Thanks in advance for any help!
Edit: Have a more immediate hack of just sending that key combo to firefox as well, so they both work as expected, but still would prefer to know how I should have done this