我按照本教程将启动时的Thunderbird设置为最小化模式,但这并没有帮助。
按照说明进行操作后,我什至无法启动Thunderbird。因此,我被迫以安全模式启动TB,以删除“ FireTray插件”并解决此问题。之后,它开始工作,但是删除了我所有的电子邮件帐户,我不得不再次做那件事。
那么,有什么可行的方法可以在启动时最小化启动Thunderbird?
我按照本教程将启动时的Thunderbird设置为最小化模式,但这并没有帮助。
按照说明进行操作后,我什至无法启动Thunderbird。因此,我被迫以安全模式启动TB,以删除“ FireTray插件”并解决此问题。之后,它开始工作,但是删除了我所有的电子邮件帐户,我不得不再次做那件事。
那么,有什么可行的方法可以在启动时最小化启动Thunderbird?
Answers:
让我说清楚,至少对于像我这样的人。
确保雷鸟在登录时自动启动,仅涉及三个步骤:
Thunderbird -> Tools -> addons -> firetray -> preferences -> under tab "windows"
)thunderbird
或/usr/bin/thunderbird
)请注意,FireTray插件是必须具备的。实际上,大多数人并不是说要完全“退出”窗口时才说完全退出默认行为。他们肯定希望雷鸟在后台运行并通知所有新电子邮件到达。FireTray恰好解决了这个问题。
我实际上使用的是Ubuntu 13.10,但此解决方案至少应该可以正常工作到12.04。Firetray是Firefox的扩展,因此您可以使其在关闭时最小化并在启动时最小化(您会很快看到Thunderbird窗口弹出,但这并不是问题)。然后只需将雷鸟添加到启动应用程序中,当您登录时,雷鸟将闪烁一秒钟,然后在系统托盘中将其最小化。它还完全支持默认消息菜单,因此不会创建第二个雷鸟图标。
现在,对于那些过去可能曾经尝试过的人来说,我知道我几年前尝试过Firetray,它根本不起作用,与现代Ubuntu一起使用时,它存在很多错误,但是最新版本似乎可以完美地工作与Ubuntu(至少13.10版,但我不明白为什么它不能与任何其他版本一起使用)。
对于Ubuntu 18.04。
1)安装devilspie
软件包:
sudo apt install devilspie
2)在该文件夹中创建~/.devilspie
文件夹和thunderbird.ds
文件:
mkdir -p ~/.devilspie && touch ~/.devilspie/thunderbird.ds
3)将此代码粘贴到~/.devilspie/thunderbird.ds
文件中:
(if
(is (window_name) "Mozilla Thunderbird")
(begin
(minimize)
)
)
4)添加devilspie
到启动应用程序
5)添加thunderbird
到启动应用程序
6)(可选)在任务栏中安装Keep(Thunderbird的附加组件,使“关闭”按钮的行为与“最小化”按钮的行为完全相同)
7)重新启动。
提示: 如何延迟启动特定程序
devilspie'的文档:
https://web.archive.org/web/20160415011438/http://foosel.org/linux/devilspie
Ubuntu 16.04。
发生了相同的问题,并使用以下方法来达到目标。自动启动条目通过以下脚本添加了正在运行的雷鸟:
#!/usr/bin/env python3
import subprocess
import sys
import time
#
# Check out command
#
command = sys.argv[1]
#
# Run it as a subservice in own bash
#
subprocess.Popen(["/bin/bash", "-c", command])
#
# If a window name does not match command process name, add here.
# Check out by running :~$ wmctrl -lp
# Do not forget to enable the feature, seperate new by comma.
#
#windowProcessMatcher = {'CommandName':'WindowName'}
#if command in windowProcessMatcher:
# command = ''.join(windowProcessMatcher[command])
#print("Command after terminator" + command)
#
# Set some values. t is the iteration counter, maxIter guess what?, and a careCycle to check twice.
#
t = 1
maxIter=30
wellDone=False
careCycle=True
sleepValue=0.1
#
# MaxIter OR if the minimize job is done will stop the script.
#
while not wellDone:
# And iteration count still under limit. Count*Sleep, example: 60*0.2 = 6 seconds should be enough.
# When we found a program
if t >= maxIter:
break
# Try while it could fail.
try:
# Gives us a list with all entries
w_list = [output.split() for output in subprocess.check_output(["wmctrl", "-lp"]).decode("utf-8").splitlines()]
# Why not check the list?
for entry in w_list:
# Can we find our command string in one of the lines? Here is the tricky part:
# When starting for example terminator is shows yourname@yourmaschine ~.
# Maybee some matching is needed here for your purposes. Simply replace the command name
# But for our purposes it should work out.
#
# Go ahead if nothing found!
if command not in (''.join(entry)).lower():
continue
#######
print("mt### We got a match and minimize the window!!!")
# First entry is our window pid
match = entry[0]
# If something is wrong with the value...try another one :-)
subprocess.Popen(["xdotool", "windowminimize", match])
#
# Maybee there will be more than one window running with our command name.
# Check the list till the end. And go one more iteration!
if careCycle:
# Boolean gives us one more iteration.
careCycle=False
break
else:
wellDone=True
except (IndexError, subprocess.CalledProcessError):
pass
t += 1
time.sleep(sleepValue)
if wellDone:
print(" ")
print("mt### Well Done!")
print("mt### Window found and minimize command send.")
print("mt### ByBy")
else:
print(" ")
print("mt### Seems that the window while counter expired or your process command did not start well.")
print("mt### == Go ahead. What can you do/try out now? ")
这也应该适用于所有其他应用程序。
良好的编码