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);
}
}