Closed vikdevelop closed 2 months ago
Here is a script I use, it should be useful to you
#!/bin/bash
set -e
if [[ -z "$DESKTOP_SESSION" ]]; then
echo 'Error: DESKTOP_SESSION is not defined'
exit 1
elif [[ "$DESKTOP_SESSION" == "plasma" ]]; then
dbus-send --session --dest=org.kde.Shutdown --type=method_call /Shutdown org.kde.Shutdown.logout
elif [[ "$DESKTOP_SESSION" == "gnome" ]]; then
gnome-session-quit --no-prompt
elif [[ "$DESKTOP_SESSION" == "gnome-xorg" ]]; then
gnome-session-quit --no-prompt
elif [[ "$DESKTOP_SESSION" == "cosmic" ]]; then
dbus-send --session --dest=com.system76.CosmicSession --type=method_call /com/system76/CosmicSession com.system76.CosmicSession.Exit
else
loginctl terminate-user "{USER}"
fi
echo "Closing $DESKTOP_SESSION session..."
exit 0
The provided command for the logging out of the COSMIC desktop works correctly. Thanks :)
Hello, I'm programming the SaveDesktop app, and I have a problem with logging out of the system using dbus. For example, in KDE6 is available this command:
dbus-send --print-reply --dest=org.kde.LogoutPrompt /LogoutPrompt org.kde.LogoutPrompt.promptLogout
, but what command is available for COSMIC?