sleep期间唤醒网络后调用evolution接收邮件,借鉴evolution --help选项,可增加自动接收邮件功能,在upower.sh中调用此命令。
不能用dbus,因为dbus需要loop等待,evolutin会hold
evolution代码中mail/mail-send-rece.c 中有receive mail接口可调用
在e-shell.c中new一个signal,并emit,在mail/mail-send-rece.c中connect此信号调用接收邮件接口
在脚本中通过参数调用时调用main函数中一个handle接口,在e-shell.c中判断shell是否remote,在通过g_action_group_activate_action激活自动接收邮件的action:
void e_shell_handle_mail_rec (EShell *shell)
{
if (g_application_get_is_remote (G_APPLICATION (shell))){
g_action_group_activate_action(G_ACTION_GROUP (shell), "automatic", NULL);
}
}