I wanted Thunderbird to stay in the Background to notify me of incoming mails.
After a bit of searching, I found this post.
How to keep Thunderbird and Pidgin running on background?
The solution is to install an addon so that when we close Thunderbird it just stays in the background.
Now, to have thunderbird running at Start up we can just add it to Startup Applications
.
But, when I open my system, Thunderbird
also gets opened and I have to manually press the close button everytime to make Thunderbird go into the background.
The solution given in the above post for this problem is to select Minimize on start
. But doing so affects the way in which Thunderbird works when invoked from the Messaging menu. So I deselected this option.
But, if there is a way to emulate pressing the Close button from a script, I can just add that script to Startup Applications
So is there a way to achieve this?
Note : If there is a simpler way to solve my original problem of keeping Thunderbird in background please post that also.
Many thanks.
Best Answer
In the probable absence of a
Thunderbird
command-line option that you could use to start it minimized or in the background, your best option is probably to use something likexdotool
, which is in the repositories. (See my later note on the minimize to tray addon).This is the command you need to minimise the instance of
Thunderbird
;xdotool
searches for theThunderbird
window on the window stack and then minimizes itMaximise Thunderbird and then try it in the terminal; it seems to be the command you are looking for. Often when used in scripts the
--sync
argument is added, as noted in the man page:You may also have to delay the command a bit until Thunderbird has actually started up, and there is a sleep command built into
xdotool
, so you could useand set the sleep interval at whatever value you needed.
This minimises
Thunderbird
, but not to the background like when you use the minimize to tray addon, as you set up that addon so that pressing exit sendsThunderbird
to the tray. Assuming that addon is installed, it may be possible to usexdotool
to emulate the mouse-click of the x in Thunderbird's window and so background it. However, usingwindowkill
instead ofwindowminimize
withThunderbird
(when the tray addon is installed) closes the entire application.After discussion it was said that the
windowunmap
option was the one necessary to actually hide the window; this is much easier than trying to emulate a click on the thunderbird window.