Friday, October 13, 2023

xdotool workaround for opening an email in conversation view in thunderbird 115.3.1

With a recent update of Thunderbird, I've noticed that when I open an
email with conversation view (with Ctrol+Shift+O), the messages are
not properly sorted anymore. I had to click the sort-by-date menu and
sort-by-thread menu, respectively, every time.
 

I've written a script to automate that boring process as you can see below.

#!/usr/bin/bash

xdotool mousemove 500 500
xdotool click 1
xdotool key ctrl+shift+o
sleep 1
xdotool key --delay 100 alt+v s e
sleep 1
xdotool key ctrl+shift+o
sleep 1
xdotool key --delay 100 alt+v s t
sleep 1
xdotool key 0x002a
xdotool mousemove 500 335

I store this script in dom0 and name it xdo-thread. I map this script
with F5 key. Now, every time I want to see the messages in
conversation view, I simply press F5. 


There's one tricky part I'd like to point out. The line "xdotool click 1" is a trick. Without it, we can't use "xdotool key". I'm not sure what the reason is yet. Maybe it's about window focus.