예제 #1
0
func doLogout() {
	if m, err := sessionmanager.NewSessionManager("com.deepin.SessionManager", "/com/deepin/SessionManager"); err != nil {
		logger.Warning("can't build SessionManager Object:", err)
	} else {
		if err = m.Logout(); err != nil {
			logger.Warning("ShutDown failed:", err)
		}
		sessionmanager.DestroySessionManager(m)
	}
}
예제 #2
0
func doSuspend() {
	if m, err := sessionmanager.NewSessionManager("com.deepin.SessionManager", "/com/deepin/SessionManager"); err != nil {
		logger.Warning("can't build SessionManager Object:", err)
	} else {
		if err = m.RequestSuspend(); err != nil {
			logger.Warning("Suspend failed:", err)
		}
		logger.Debug("RequestSuspend...", err)
		sessionmanager.DestroySessionManager(m)
	}
}