I am trying to create an alias for logout current session.
I found an old topic. But none of it is working. What would be the proper way to logout current session? qdbus isn’t available. But /usr/bin/qdbus-qt6 available.
If you don’t care about proper termination of the shell - i.e. letting applications close gracefully, saving the contents of prompting the user to do so, which is what the Plasma logout command does - then you can use the loginctl tool to terminate the session: either run loginctl terminate-user $USER - to close all logged in sessions (including virtual terminal sessions); or run loginctl list-sessions to list all the existing session and use some grep or something to figure out which session you want to terminatem then run loginctl terminate-session SESSIONID.
The old topic is about triggering the Plasma shell’s built-in session management to logout. For me, qdbus org.kde.LogoutPrompt /LogoutPrompt org.kde.LogoutPrompt.promptLogout works well.
The qdbus command may be available under different file names depending on your operating system, but if you found something that looks reasonable - its probably the correct command.