Hello,

Finally I reverted to a more classic '.xsession', using 'exec' command with 'wmaker' and lauching GWorkspace then as a subprocess (autolaunch docked app). With this hierarchy, the menu command of GWorkspace to disconnect only closes its app, not the underlying Window Manager. So I need now a clean way to logout in one shot: i.e., closing apps and Window Manager with one action.

I created an in-purpose little app with one button using this method as action:

- (void)endSession
{
    NSTask *task = [[NSTask alloc] init];
    NSString *userName = NSUserName();
    [task setLaunchPath:@"/usr/bin/loginctl"];
[task setArguments:[NSArray arrayWithObjects:@"terminate-user", userName, nil]];
    [task launch];
}


Well, it is working as expected. The X session closes and I get the login panel of LigthDM.

However I would be sure this way all remaining opened apps before session ends, namely GWorkspace, have time to save state and database, and to release memory. Do you think my method is a correct answer?

P.S.: I also looked a way to send a 'terminate:' message to the NSWorkspace instance of GWorkspace, before my task above will launch, but not found yet how it could be done. And if it is accurate to do this.

--
Patrick Cardona - Pi500 - GNU/Linux aarch64 (Debian 13.3)
Xorg (1:7.7+24) - libcairo2 (1.18.4-1+rpt1 arm64) - Window Maker (0.96.0-4) GWorkspace (1.1.0 - 02 2025) - Theme: AGNOSTEP - Classic - MUA: GNUMail (1.4.0 - rev.947)


Reply via email to